Skip to content

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.

2 participants