Skip to content
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

cannot assign bytearray to mmap bytes #4006

Closed
gitlab-importer opened this issue Oct 1, 2023 · 3 comments
Closed

cannot assign bytearray to mmap bytes #4006

gitlab-importer opened this issue Oct 1, 2023 · 3 comments
Milestone

Comments

@gitlab-importer
Copy link

In Heptapod by @Timme on Oct 1, 2023, 05:00

PyPy Version: 3.8.16
OS: macOS (Apple Silicon)
Code:

import mmap

fileid = open('test', "w+")
fileid.truncate(4)

bytes = mmap.mmap(fileid.fileno(), 0)

bytes[0:4] = b'abcd'
bytes[1:3] = bytearray(b'BC')  # CPython passed, while Pypy raises TypeError

print(bytes[0:4])  # CPython prints b'aBCd'
@gitlab-importer
Copy link
Author

In Heptapod by @mattip on Oct 1, 2023, 06:59

Can confirm: this happens on 3.9 as well.

@gitlab-importer
Copy link
Author

In Heptapod by @cfbolz on Oct 16, 2023, 08:19

mentioned in commit be682aa992e423f6d44fa027994197b72ce3ff02

@gitlab-importer
Copy link
Author

In Heptapod by @cfbolz on Oct 16, 2023, 08:20

fixed in the above commit, thanks for the report!

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

No branches or pull requests

1 participant