PyDev.Debugger icon indicating copy to clipboard operation
PyDev.Debugger copied to clipboard

"U" mode is no longer accepted from Python 3.9

Open tirkarthi opened this issue 5 years ago • 2 comments

PyDev.Debugger/_pydev_imps/_pydev_pkgutil_old.py
261:                self.file = open(self.filename, 'rU')
306:                    f = open(self.filename[:-1], 'rU')

PyDev.Debugger/_pydev_runfiles/pydev_runfiles.py
212:                f = open(config_file, 'rU')

PyDev.Debugger/third_party/pep8/pycodestyle.py
1326:        with open(filename, 'rU') as f:

PyDev.Debugger/third_party/isort_container/isort/settings.py
217:    with open(file_path, 'rU') as config_file:

https://github.com/python/cpython/pull/16959

tirkarthi avatar Mar 01 '20 06:03 tirkarthi

Thanks for the report... it seems the change was reverted (https://github.com/python/cpython/pull/18767), so, at least for 3.9 it will still be accepted (so, there's until 3.10 to fix it).

We should probably run test checking for deprecation issues to avoid such things in the future (https://docs.python.org/dev/whatsnew/3.9.html#you-should-check-for-deprecationwarning-in-your-code).

fabioz avatar Mar 04 '20 17:03 fabioz

That shouldn't be an issue as _pydev_imps/_pydev_pkgutil_old.py is only imported if not IS_PY3K, so Python 3.9 and above will never see this Python 2.x code.

juliangilbey avatar Feb 07 '22 19:02 juliangilbey