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

pathlib.Path.__enter__() is deprecated and scheduled for removal in Python 3.13 #133

Open
dannyhand opened this issue Sep 4, 2023 · 2 comments

Comments

@dannyhand
Copy link

Just set up this script and ran it for the first time. Excellent work!

I get this message upon running:

PS C:\Radarr\collector> python rcm.py ./config

C:\Radarr\collector\rcm.py:328: DeprecationWarning: pathlib.Path.enter() is deprecated and scheduled for removal in Python 3.13; Path objects as a context manager is a no-op
with Path.joinpath(output_path, folder) as fold:

C:\Radarr\collector\rcm.py:358: DeprecationWarning: pathlib.Path.enter() is deprecated and scheduled for removal in Python 3.13; Path objects as a context manager is a no-op
with Path.joinpath(config_path, u'memory.dat') as file:

My python info:

Python 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] on win32

@mgaulton
Copy link

I'm also experiencing this and my poking at it hasn't changed the erorr.

@mgaulton
Copy link

This got rid of the error, now i'm getting something else lol

Change this line

with pathlib.Path.joinpath(output_path, folder) as fold:

to this

fold = output_path.joinpath(folder)

Change this line

with pathlib.Path.joinpath(config_path, u'memory.dat') as file:

to this

file = config_path.joinpath(u'memory.dat')
You'll need to unindent the code under this change.

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