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

bpo-39356, zipfile: Remove code handling DeprecationWarning #18027

Merged
merged 1 commit into from Jan 17, 2020

Conversation

@vstinner
Copy link
Member

vstinner commented Jan 16, 2020

Remove old "except DeprecationWarning:" code path added by
commit bf02e3b. It's no longer
needed.

https://bugs.python.org/issue39356

Remove old "except DeprecationWarning:" code path added by
commit bf02e3b. It's no longer
needed.
@vstinner

This comment has been minimized.

Copy link
Member Author

vstinner commented Jan 16, 2020

@gpshead: Do you recall why you added this code in commit bf02e3b?

@vstinner

This comment has been minimized.

Copy link
Member Author

vstinner commented Jan 17, 2020

@gpshead: Do you recall why you added this code in commit bf02e3b?

At this commit, the _struct.pack() function emitted DeprecatedWarning when getting a float whereas an integer is expected.

These warnings have been removed by commit ea835e7. It's now an hard error. Example:

vstinner@apu$ python3
Python 3.7.6 (default, Dec 19 2019, 22:52:49) 
>>> import struct
>>> struct.pack("i", 1.0)
struct.error: required argument is not an integer

So "except DeprecationWarning:" is no longer needed in zipfile.

@vstinner vstinner merged commit 1d3b0aa into python:master Jan 17, 2020
8 checks passed
8 checks passed
Windows (x86)
Details
Windows (x64)
Details
macOS
Details
Ubuntu
Details
Azure Pipelines PR #20200116.13 succeeded
Details
bedevere/issue-number Issue number 39356 found
Details
bedevere/news "skip news" label found
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@vstinner vstinner deleted the vstinner:zipfile_except_deprecation branch Jan 17, 2020
petdance added a commit to petdance/cpython that referenced this pull request Jan 18, 2020
…-18027)

Remove old "except DeprecationWarning:" code path added by
commit bf02e3b. It's no longer
needed.

struct.pack() no longer emit DeprecationWarning if getting a float
whereas an integer is expected. It now raises an hard error instead.
petdance added a commit to petdance/cpython that referenced this pull request Jan 21, 2020
…-18027)

Remove old "except DeprecationWarning:" code path added by
commit bf02e3b. It's no longer
needed.

struct.pack() no longer emit DeprecationWarning if getting a float
whereas an integer is expected. It now raises an hard error instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.