FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update _compression, gzip, and test_gzip for CPython v3.11.2 by tdub0 · Pull Request #4688 · RustPython/RustPython · GitHub

Update _compression, gzip, and test_gzip for CPython v3.11.2 - #4688

Merged
youknowone merged 2 commits into
RustPython:mainfrom
tdub0:compression
Mar 15, 2023
Merged

Update _compression, gzip, and test_gzip for CPython v3.11.2#4688
youknowone merged 2 commits into
RustPython:mainfrom
tdub0:compression

Conversation

tdub0 commented Mar 13, 2023

Copy link
Copy Markdown
Contributor

Updated _compression.py to match CPython v3.11.2. I didn't see any immediate unit test for this, so it seemed fit to test using a library that relies on _compression.py. I updated gzip.py / test_gzip.py and accounted for the unexpected failures on test_gzip.py.

The failures were primarily wbit errors tracing to stdlib/src/zlib.rs, but I am not familiar enough with this module in rust to correct the issues.

tdub0 commented Mar 13, 2023

Copy link
Copy Markdown
Contributor Author

See #4564.

youknowone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

That's really good decision 😄
thank you!

Comment thread Lib/_compression.py
@@ -1,7 +1,7 @@
"""Internal classes used by the gzip, lzma and bz2 modules"""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

by looking the header, bz2 also seems to depending on here. could you also update it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We have no bz2 rust library, unfortunately.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yeah, I hit the SkipTest: No module named ' bz2' when I copied over and ran the test_bz2.py as there were no changes in the Lib/bz2.py. Would this be connected to the bz2.rs in stdlib/src/

Comment thread Lib/_compression.py
# sys.maxsize means the max length of output buffer is unlimited,
# so that the whole input buffer can be decompressed within one
# .decompress() call.
while data := self.read(sys.maxsize):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

maybe we don't support this operator yet

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I did see a reference on L84 of compiler/ast/src/unparse.rs but it might not be handling it as the assignment operator described in PEP 572.

youknowone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

looks good, thank you!

youknowone force-pushed the compression branch 3 times, most recently from 13687c3 to 407f3f5 Compare March 15, 2023 14:15
Comment thread stdlib/src/zlib.rs
youknowone merged commit 134d9f1 into RustPython:main Mar 15, 2023
tdub0 deleted the compression branch March 15, 2023 16:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL