-
Notifications
You must be signed in to change notification settings - Fork 1.6k
MAINT: Enforce PLW2901 (avoid loop/context var overwrite) #3513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 8 commits
ff2509a
12353fd
6da4f06
b1bee72
ca1e7ef
e33d82a
e385405
66157a2
412599b
bdbabf1
320d53d
04f1365
e79a99f
a63fb4c
a233371
d1e8189
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -759,30 +759,31 @@ def decode_stream_data(stream: Any) -> bytes: | |
| # If there is no data to decode, we should not try to decode it. | ||
| if not data: | ||
| return data | ||
| for filter_name, params in zip(filters, decode_parms): | ||
| if isinstance(params, NullObject): | ||
| params = {} | ||
| for filter_name, params_untyped in zip(filters, decode_parms): | ||
| params_typed: Optional[DictionaryObject] = None | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems like you misunderstood me here: I meant to use
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, got it. Fixed this now |
||
| if not isinstance(params_untyped, NullObject): | ||
| params_typed = cast(Optional[DictionaryObject], params_untyped) | ||
| if filter_name in (FT.ASCII_HEX_DECODE, FTA.AHx): | ||
| data = ASCIIHexDecode.decode(data) | ||
| elif filter_name in (FT.ASCII_85_DECODE, FTA.A85): | ||
| data = ASCII85Decode.decode(data) | ||
| elif filter_name in (FT.LZW_DECODE, FTA.LZW): | ||
| data = LZWDecode.decode(data, params) | ||
| data = LZWDecode.decode(data, params_typed) | ||
| elif filter_name in (FT.FLATE_DECODE, FTA.FL): | ||
| data = FlateDecode.decode(data, params) | ||
| data = FlateDecode.decode(data, params_typed) | ||
| elif filter_name in (FT.RUN_LENGTH_DECODE, FTA.RL): | ||
| data = RunLengthDecode.decode(data) | ||
| elif filter_name == FT.CCITT_FAX_DECODE: | ||
| height = stream.get(IA.HEIGHT, ()) | ||
| data = CCITTFaxDecode.decode(data, params, height) | ||
| data = CCITTFaxDecode.decode(data, params_typed, height) | ||
| elif filter_name == FT.DCT_DECODE: | ||
| data = DCTDecode.decode(data) | ||
| elif filter_name == FT.JPX_DECODE: | ||
| data = JPXDecode.decode(data) | ||
| elif filter_name == FT.JBIG2_DECODE: | ||
| data = JBIG2Decode.decode(data, params) | ||
| data = JBIG2Decode.decode(data, params_typed) | ||
| elif filter_name == "/Crypt": | ||
| if "/Name" in params or "/Type" in params: | ||
| if "/Name" in params_untyped or "/Type" in params_untyped: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why untyped? Couldn't we just keep |
||
| raise NotImplementedError( | ||
| "/Crypt filter with /Name or /Type not supported yet" | ||
| ) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.