| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -53,3 +53,20 @@ def finalize(self): | |
| cx.create_aggregate("aggtxt", 1, AggrText) | ||
| cur.execute("select aggtxt(key) from foo") | ||
| assert cur.fetchone()[0] == "341011" | ||
|
|
||
| # Blob extended-slice assignment with negative step | ||
| # Guard: CPython 3.11 has a SystemError bug with negative-step Blob slicing; | ||
| # this test only runs on RustPython where the fix is being validated. | ||
| # TODO: remove this once https://github.com/python/cpython/pull/150450 is released and RustPython CI uses it. | ||
| import sys | ||
|
|
||
| if sys.implementation.name == "rustpython": | ||
|
Comment thread
Copy link
Copy Markdown
Member
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. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualitywe usually don't add rustpython-only code. is this CPython bug? Then is this reported to CPython?
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
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. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityYes, the negative-step slice crash is a CPython bug — I've filed it upstream as python/cpython#150449 and submitted a fix PR (python/cpython#150450). However, this PR also contains a few pre-existing RustPython-only bugs unrelated to that CPython issue:
Should I split this into two PRs — one for the CPython-mirrored negative-step fix (which could be reverted or marked TODO: RUSTPYTHON until upstream lands), and one for the RustPython-specific behavior alignment?
Sorry, something went wrong.
All reactions
|
||
| cx.execute("CREATE TABLE blobtest(b BLOB)") | ||
| data = b"this blob data string is exactly fifty bytes long!" | ||
| cx.execute("INSERT INTO blobtest(b) VALUES (?)", (data,)) | ||
| blob = cx.blobopen("blobtest", "b", 1) | ||
| blob[9:0:-2] = b"12345" # writes to indices 9, 7, 5, 3, 1 | ||
| actual = cx.execute("select b from blobtest").fetchone()[0] | ||
| expected = b"t5i4 3l2b1" + data[10:] | ||
| assert actual == expected, f"got {actual!r}, expected {expected!r}" | ||
| blob.close() | ||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.