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
pathlib.Path.__enter__() should emit DeprecationWarning #90714
Comments
In Python 3.9 / bpo-39682 we made Path.__exit__() a no-op, and added a comment in the code mentioning that it should be deprecated in future. The future is here, so let's deprecate it. |
skshetry
added a commit
to skshetry/hydra
that referenced
this issue
Oct 15, 2022
Path as a contextmanager is deprecated from 3.11 onwards, and was a no-op since Python 3.11. Also this functionality was never documented. See [cpython/Lib/pathlib.py#L810-L816][1], python/cpython#83863 and, python/cpython#90714. [1]: https://github.com/python/cpython/blob/120b4ab2b68aebf96ce0de243eab89a25fc2d282/Lib/pathlib.py#L810-L816
skshetry
added a commit
to skshetry/hydra
that referenced
this issue
Oct 15, 2022
Path as a contextmanager is deprecated from 3.11 onwards, and was a no-op since Python 3.9. Also this functionality was never documented. See [cpython/Lib/pathlib.py#L810-L816][1], python/cpython#83863 and, python/cpython#90714. [1]: https://github.com/python/cpython/blob/120b4ab2b68aebf96ce0de243eab89a25fc2d282/Lib/pathlib.py#L810-L816
pixelb
pushed a commit
to facebookresearch/hydra
that referenced
this issue
Oct 17, 2022
Path as a contextmanager is deprecated from 3.11 onwards, and was a no-op since Python 3.9. Also this functionality was never documented. See [cpython/Lib/pathlib.py#L810-L816][1], python/cpython#83863 and, python/cpython#90714. [1]: https://github.com/python/cpython/blob/120b4ab2b68aebf96ce0de243eab89a25fc2d282/Lib/pathlib.py#L810-L816
so how do we use Path to avoid this warning? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DeprecationWarning
frompathlib.Path.__enter__()
#30971Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: