close
The Wayback Machine - https://web.archive.org/web/20210609072420/https://github.com/wxWidgets/Phoenix/pull/1680
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

Preserve bytes immutability. #1680

Merged
merged 4 commits into from Jun 16, 2020
Merged

Conversation

@mesalu
Copy link
Collaborator

@mesalu mesalu commented Jun 15, 2020

nanosvg modifies its input char arrays in place (see: https://github.com/wxWidgets/nanosvg/blob/9dd92bbfc6f709e889578a724724ffbd42ac3004/src/nanosvg.h#L348),
which will lead to issues attempting to use the same python bytes object multiple times. Since bytes objects promise immutability its undesirable to permit them to be modified like this.
To correct for this, we'll copy the bytes object into a new location in memory and pass that new memory location to nanosvg.

mesalu added 4 commits Jun 15, 2020
`nanosvg` modifies its input strings in place (see: https://github.com/wxWidgets/nanosvg/blob/9dd92bbfc6f709e889578a724724ffbd42ac3004/src/nanosvg.h#L348),
which will lead to issues attempting to use the same python `bytes` object multiple times. Since bytes objects promise immutability its undesirable to permit them to be modified like this.
To correct for this, we'll copy the bytes object into a new location in memory and pass that new memory location to nanosvg.
@RobinD42 RobinD42 merged commit 3923a16 into master Jun 16, 2020
13 checks passed
13 checks passed
@azure-pipelines
wxWidgets.Phoenix Build #CI.20200615..2 succeeded
Details
@azure-pipelines
wxWidgets.Phoenix (Linux CI Py27) Linux CI Py27 succeeded
Details
@azure-pipelines
wxWidgets.Phoenix (Linux CI Py36) Linux CI Py36 succeeded
Details
@azure-pipelines
wxWidgets.Phoenix (Linux CI Py37) Linux CI Py37 succeeded
Details
@azure-pipelines
wxWidgets.Phoenix (Linux CI Py38) Linux CI Py38 succeeded
Details
@azure-pipelines
wxWidgets.Phoenix (MacOS CI Py27) MacOS CI Py27 succeeded
Details
@azure-pipelines
wxWidgets.Phoenix (MacOS CI Py36) MacOS CI Py36 succeeded
Details
@azure-pipelines
wxWidgets.Phoenix (MacOS CI Py37) MacOS CI Py37 succeeded
Details
@azure-pipelines
wxWidgets.Phoenix (MacOS CI Py38) MacOS CI Py38 succeeded
Details
@azure-pipelines
wxWidgets.Phoenix (Windows CI Py36_x64) Windows CI Py36_x64 succeeded
Details
@azure-pipelines
wxWidgets.Phoenix (Windows CI Py36_x86) Windows CI Py36_x86 succeeded
Details
@azure-pipelines
wxWidgets.Phoenix (Windows CI Py37_x64) Windows CI Py37_x64 succeeded
Details
@azure-pipelines
wxWidgets.Phoenix (Windows CI Py37_x86) Windows CI Py37_x86 succeeded
Details
@RobinD42 RobinD42 deleted the nsvg_preserve_immutability_of_bytes branch Jun 17, 2020
@RobinD42
Copy link
Member

@RobinD42 RobinD42 commented Nov 26, 2020

This pull request has been mentioned on Discuss wxPython. There might be relevant details there:

https://discuss.wxpython.org/t/wxpython-4-1-1-released/35043/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants