GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Update zlib from 3.12.6 and _ZlibDecompressor implementation by arihant2math · Pull Request #5476 · RustPython/RustPython

Conversation

@arihant2math

@arihant2math arihant2math commented Jan 14, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

After this is merged a few GZip tests are unblocked.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
arihant2math added 3 commits January 3, 2025 23:47
@arihant2math
add is_s390x and skip_on_s390x to test support
42bb0bd
@arihant2math
update zlib tests to 3.12
471e2a0
@arihant2math
attempted _ZlibDecompressor implementation
1f59f69
@coolreader18

coolreader18 commented Jan 14, 2025

Copy link
Copy Markdown
Member

To fix the failing test, you can run cargo fmt in the repository.

arihant2math reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

arihant2math added 2 commits January 13, 2025 23:17
@arihant2math
updated zlib tests
83e539a
@arihant2math
formatting
cfad24a
@arihant2math

arihant2math commented Jan 14, 2025

Copy link
Copy Markdown
Contributor Author

I can't seem to see how

zlibd = zlib._ZlibDecompressor()
self.assertRaises(TypeError, zlibd.decompress)

can produce a TypeError when using #[pymethod] on the rust side, unless it already does and I'm reading something incorrectly.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@youknowone

youknowone commented Jan 14, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Not only Constructor, it may also requires Initializer. Constructor corresponds to __new__ while Initializer corresponds to __init__

Sorry, I just checked CPython code but it doesn't look like that

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

youknowone
youknowone reviewed Jan 14, 2025
View reviewed changes
Comment thread stdlib/src/zlib.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

arihant2math added 2 commits January 14, 2025 08:43
@arihant2math
type error if _ZlibDecompressor gets a non-zero number of arguments p…
760b192
…assed to it's __init__
@arihant2math
eof error if _ZlibDecompressor decompresses a byte string that termin…
f3048cf
…ates pre-emptively
@arihant2math

arihant2math commented Jan 14, 2025

Copy link
Copy Markdown
Contributor Author

I resolved a few issues, but currently I'm getting a bunch of
RuntimeError: Expected payload '_ZlibDecompressor' but '_ZlibDecompressor' found

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

arihant2math added 3 commits January 14, 2025 09:20
@arihant2math
reverted bad changes
32394ad
@arihant2math
disabled some tests
c9b0ad0
@arihant2math
tried to fix zlibd
54b45a9
@arihant2math

arihant2math commented Jan 14, 2025

Copy link
Copy Markdown
Contributor Author

Additionally _ZlibDecompressor has to be unpicklable for another test to pass, but I'm fine with just disabling that one.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@youknowone
Fix Expected payload error
9127467
@youknowone youknowone mentioned this pull request Jan 15, 2025
Add better panic for abnormal downcast error #5477
Merged
arihant2math added 4 commits January 15, 2025 10:38
@arihant2math
force type cohesion
31e6e0a
@arihant2math
Merge branch 'zlib-312' of https://github.com/arihant2math/RustPython …
14531ac
…into zlib-312
@arihant2math
passed more tests
0be849d
@arihant2math
all tests pass
8eb49a2
@arihant2math
arihant2math requested a review from youknowone January 15, 2025 19:03
@arihant2math
arihant2math marked this pull request as ready for review January 15, 2025 19:03
@arihant2math

arihant2math commented Jan 15, 2025

Copy link
Copy Markdown
Contributor Author

Also it seems to my knowledge __getstate__ isn't a magic method I can use? It would be nice to use it because then I could pass the pickling test rather trivially.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@youknowone

youknowone commented Jan 16, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Each class need to implement __getstate__ to support pickling. pickle library will use getstate in priority. Searching for fn getstate will result other types' implementation

Oh... unlike setstate, getstate doesn't have many implementations

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

youknowone
youknowone reviewed Jan 16, 2025
View reviewed changes

@youknowone youknowone left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

would you leave a comment which version of CPython did you brought python source from? (including x in 3.12.x)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

arihant2math reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Lib/test/support/__init__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@arihant2math
added comment as per review
041553c
@arihant2math
arihant2math requested a review from youknowone January 16, 2025 03:57
@youknowone youknowone changed the title _ZlibDecompressor implementation Update zlib from 3.12.6 and _ZlibDecompressor implementation Jan 16, 2025
youknowone
youknowone approved these changes Jan 16, 2025
View reviewed changes

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thank you so much!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/test/support/__init__.py

has_fork_support = hasattr(os, "fork") and not is_emscripten and not is_wasi

# From python 3.12.6

@youknowone youknowone Jan 16, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I am sorry to confuse you. Version was required for commit message, but this is also fine too

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@youknowone
youknowone merged commit 2d83a67 into RustPython:main Jan 16, 2025
@arihant2math
arihant2math deleted the zlib-312 branch January 16, 2025 04:33
This was referenced Jan 16, 2025
Update Python libraries and tests from CPython 3.12 #5104
Closed
Update gzip & tarfile & xmlrpc & pydoc + associated tests to 3.12.7 #5480
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@youknowone youknowone youknowone approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@arihant2math @coolreader18 @youknowone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.