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

DeprecationWarning from tomli when loading metadata #134

Closed
jaraco opened this issue Oct 18, 2021 · 4 comments
Closed

DeprecationWarning from tomli when loading metadata #134

jaraco opened this issue Oct 18, 2021 · 4 comments

Comments

@jaraco
Copy link
Member

jaraco commented Oct 18, 2021

.tox/python/lib/python3.10/site-packages/pep517/build.py:35: in load_system
    pyproject_data = toml_load(f)
.tox/python/lib/python3.10/site-packages/tomli/_parser.py:71: in load
    warnings.warn(
E   DeprecationWarning: Text file object support is deprecated in favor of binary file objects. Use `open("foo.toml", "rb")` to open the file in binary mode.

Triggered thus:

~ $ pip-run pep517 -- -We -c 'import pep517.meta; pep517.meta.load("/Users/jaraco/p/pypa/pep517")'
Collecting pep517
  Using cached pep517-0.11.0-py2.py3-none-any.whl (19 kB)
Collecting tomli
  Using cached tomli-1.2.1-py3-none-any.whl (11 kB)
Installing collected packages: tomli, pep517
Successfully installed pep517-0.11.0 tomli-1.2.1
Traceback (most recent call last):
  File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-k4b9iyx6/tomli/_parser.py", line 69, in load
    s = s_bytes.decode()
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-k4b9iyx6/pep517/meta.py", line 69, in load
    system = compat_system(root)
  File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-k4b9iyx6/pep517/build.py", line 47, in compat_system
    system = load_system(source_dir)
  File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-k4b9iyx6/pep517/build.py", line 35, in load_system
    pyproject_data = toml_load(f)
  File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-k4b9iyx6/tomli/_parser.py", line 71, in load
    warnings.warn(
DeprecationWarning: Text file object support is deprecated in favor of binary file objects. Use `open("foo.toml", "rb")` to open the file in binary mode.

I observed that the error did not occur if the current working directory is the pep517 repo, suggesting the issue might not exist on main.

@jaraco
Copy link
Member Author

jaraco commented Oct 18, 2021

Indeed, it looks like this was fixed in #122. Maybe cut a release and save people the trouble?

~ $ pip-run -q git+https://github.com/pypa/pep517 -- -We -c 'import pep517.meta; pep517.meta.load("/Users/jaraco/p/pypa/pep517")'
<no output>

@jaraco
Copy link
Member Author

jaraco commented Oct 18, 2021

Oh look. I have access to cut releases. In that case, I'll do it.

@jaraco
Copy link
Member Author

jaraco commented Oct 18, 2021

Presumably fixed in e18227d.

@jaraco jaraco closed this as completed Oct 18, 2021
@takluyver
Copy link
Member

Thanks for taking care of it!

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

2 participants