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

GH-74033: Drop deprecated pathlib.Path keyword arguments #118793

Merged
merged 7 commits into from
May 14, 2024

Conversation

barneygale
Copy link
Contributor

@barneygale barneygale commented May 8, 2024

Remove support for supplying keyword arguments to pathlib.Path(). This has been deprecated since Python 3.12.


📚 Documentation preview 📚: https://cpython-previews--118793.org.readthedocs.build/

Remove support for supplying keyword arguments to `pathlib.Path()`. This
has been deprecated since Python 3.12.
@barneygale barneygale changed the title GH-74033: Drop deprecated pathlib.Path() keyword arguments GH-74033: Drop deprecated pathlib.Path keyword arguments May 8, 2024
@barneygale
Copy link
Contributor Author

Depends on #118780 to remove the other usages of warnings in _local.py.

@barneygale barneygale marked this pull request as ready for review May 10, 2024 16:41
@barneygale barneygale requested a review from pablogsal May 10, 2024 17:06
@barneygale
Copy link
Contributor Author

@pablogsal this undoes a change to the IO tests that you made in 90a1b28. I don't quite understand what's going on here 🙃 but the removal of import warnings in pathlib/_local.py seems to be key.

@barneygale
Copy link
Contributor Author

It looks like test_check_encoding_warning now produces different warnings depending on whether it's run from PyMiscIOTest or CMiscIOTest. Hmmm.

@barneygale
Copy link
Contributor Author

I've logged #119049 for the warnings weirdness.

@barneygale barneygale merged commit 7d8725a into python:main May 14, 2024
33 checks passed
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Ubuntu NoGIL 3.x has failed when building commit 7d8725a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1225/builds/2268) and take a look at the build logs.
  4. Check if the failure is related to this commit (7d8725a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1225/builds/2268

Failed tests:

  • worker>
  • <regrtest

Failed subtests:

  • test_flock - main.FNTLEINTRTest.test_flock
  • test_all - test.test_eintr.EINTRTests.test_all

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/test_eintr.py", line 17, in test_all
    script_helper.run_test_script(script)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/support/script_helper.py", line 316, in run_test_script
    raise AssertionError(f"{name} failed")
AssertionError: script _test_eintr.py failed


Traceback (most recent call last):
Warning --   File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/support/__init__.py", line 199, in _force_run
Warning --     return func(*args)
Warning -- OSError: [Errno 39] Directory not empty: '/tmp/test_python_mxvb_rox/tmpga7ggg02'
Warning -- 
Warning -- During handling of the above exception, another exception occurred:
Warning -- 
Warning -- Traceback (most recent call last):
Warning --   File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/libregrtest/run_workers.py", line 393, in run
Warning --     mp_result = self._runtest(test_name)
Warning --   File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/libregrtest/run_workers.py", line 353, in _runtest
Warning --     retcode, tmp_files = self.run_tmp_files(worker_runtests,
Warning --                          ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
Warning --                                             stdout_file.fileno())
Warning --                                             ^^^^^^^^^^^^^^^^^^^^^
Warning --   File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/libregrtest/run_workers.py", line 293, in run_tmp_files
Warning --     os_helper.rmtree(tmp_dir)
Warning --     ~~~~~~~~~~~~~~~~^^^^^^^^^
Warning --   File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/support/os_helper.py", line 465, in rmtree
Warning --     _rmtree(path)
Warning --     ~~~~~~~^^^^^^
Warning --   File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/support/os_helper.py", line 449, in _rmtree
Warning --     _rmtree_inner(path)
Warning --     ~~~~~~~~~~~~~^^^^^^
Warning --   File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/support/os_helper.py", line 446, in _rmtree_inner
Warning --     _force_run(path, os.rmdir, fullname)
Warning --     ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
Warning --   File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/support/__init__.py", line 210, in _force_run
Warning --     return func(*args)
Warning -- OSError: [Errno 39] Directory not empty: '/tmp/test_python_mxvb_rox/tmpga7ggg02'
Kill <WorkerThread #1 running test=test_math pid=3525254 time=23 min 52 sec> process group
Kill <WorkerThread #2 running test=test.test_asyncio.test_events pid=3555559 time=16.8 sec> process group
Kill <WorkerThread #3 running test=test.test_asyncio.test_sslproto pid=3556371 time=5.2 sec> process group
Kill <WorkerThread #4 running test=test_compileall pid=3546937 time=7 min 11 sec> process group
Kill <WorkerThread #5 running test=test_embed pid=3554374 time=1 min 51 sec> process group
Kill <WorkerThread #6 running test=test_json pid=3554517 time=1 min 37 sec> process group
Kill <WorkerThread #8 running test=test_regrtest pid=3545029 time=10 min 7 sec> process group
Kill <WorkerThread #9 running test=test.test_multiprocessing_forkserver.test_processes pid=3551926 time=4 min 41 sec> process group
Kill <WorkerThread #10 running test=test_statistics pid=3545131 time=10 min 3 sec> process group


Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/libregrtest/single.py", line 178, in _runtest_env_changed_exc
    _load_run_test(result, runtests)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/libregrtest/single.py", line 125, in _load_run_test
    test_mod = importlib.import_module(module_name)
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'test.<regrtest worker>'


Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/_test_eintr.py", line 535, in test_flock
    self._lock(fcntl.flock, "flock")
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/_test_eintr.py", line 517, in _lock
    raise Exception("failed to sync child in %.1f sec" % dt)
Exception: failed to sync child in 300.5 sec

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Ubuntu NoGIL Refleaks 3.x has failed when building commit 7d8725a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1226/builds/1869) and take a look at the build logs.
  4. Check if the failure is related to this commit (7d8725a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1226/builds/1869

Failed subtests:

  • test_check_output_timeout - test.test_subprocess.RunFuncTestCase.test_check_output_timeout
  • test_lockf - main.FNTLEINTRTest.test_lockf
  • test_all - test.test_eintr.EINTRTests.test_all

Summary of the results of the build (if available):

Click to see traceback logs
Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/test_eintr.py", line 17, in test_all
    script_helper.run_test_script(script)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/support/script_helper.py", line 316, in run_test_script
    raise AssertionError(f"{name} failed")
AssertionError: script _test_eintr.py failed


Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/test_subprocess.py", line 1710, in test_check_output_timeout
    self.assertEqual(c.exception.output, b'BDFL')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None != b'BDFL'


Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_eintr.py", line 532, in test_lockf
    self._lock(fcntl.lockf, "lockf")
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_eintr.py", line 517, in _lock
    raise Exception("failed to sync child in %.1f sec" % dt)
Exception: failed to sync child in 300.2 sec

estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
…hon#118793)

Remove support for supplying keyword arguments to `pathlib.Path()`. This
has been deprecated since Python 3.12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants