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

Use binary file objects with tomli to avoid DeprecationWarning #10933

Closed

Conversation

pranavrajpal
Copy link
Contributor

tomli recently (in 1.2.0) deprecated support for passing file objects opened in text mode to tomli.load, which is causing DeprecationWarnings in CI runs (see https://app.travis-ci.com/github/python/mypy/jobs/529150228 for an example).

This updates the 2 uses of tomli in mypy to open the toml file in binary mode, and also updates the requirements for tomli to be at least 1.1.0 (because support for binary file objects was added in 1.1.0).

Test Plan

I ran the tests for the test files that previously caused DeprecationWarnings with tomli 1.2.0 installed and confirmed that there were no DeprecationWarnings.

tomli recently (in 1.2.0) deprecated support for passing file objects
opened in text mode to `tomli.load`, which is causing
DeprecationWarnings in CI runs (see
https://app.travis-ci.com/github/python/mypy/jobs/529150228 for an
example).

This updates the 2 uses of tomli in mypy to open the toml file in binary
mode, and also updates the requirements for tomli to be at least 1.1.0
(because support for binary file objects was added in 1.1.0).
@hauntsaninja
Copy link
Collaborator

Dupe of #10893

I think there's a small amount of controversy on this one. I think @JelleZijlstra 's plan was to monitor pypa/pip#10238 (comment) and do what they do (pradyunsg is a maintainer of both TOML and pip)

@pranavrajpal pranavrajpal deleted the tomli-binary-file-objects branch August 4, 2021 22:26
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

Successfully merging this pull request may close these issues.

None yet

2 participants