Skip to content

gh-109748: Fix again venv test_zippath_from_non_installed_posix() #110149

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

Merged
merged 1 commit into from
Sep 30, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Sep 30, 2023

Call also copy_python_src_ignore() on listdir() names.

shutil.copytree(): replace set() with an empty tuple. An empty tuple becomes a constant in the compiler and checking if an item is in an empty tuple is cheap.

Call also copy_python_src_ignore() on listdir() names.

shutil.copytree(): replace set() with an empty tuple. An empty tuple
becomes a constant in the compiler and checking if an item is in an
empty tuple is cheap.
@vstinner
Copy link
Member Author

My first fix was not enough. Failure on GHA macOS:

ERROR: test_zippath_from_non_installed_posix (test.test_venv.BasicTest.test_zippath_from_non_installed_posix)
Test that when create venv from non-installed python, the zip path
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/runner/work/cpython/cpython/Lib/test/test_venv.py", line 579, in test_zippath_from_non_installed_posix
    shutil.copytree(fn, os.path.join(libdir, name),
  File "/Users/runner/work/cpython/cpython/Lib/shutil.py", line 588, in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/runner/work/cpython/cpython/Lib/shutil.py", line 542, in _copytree
    raise Error(errors)
shutil.Error: [('/Users/runner/work/cpython/cpython/Lib/__pycache__/traceback.cpython-313.opt-1.pyc.4525821920', '/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/test_python_wx1p8mrf/tmpnm5mlmxx/lib/python3.13/__pycache__/traceback.cpython-313.opt-1.pyc.4525821920', "[Errno 2] No such file or directory: '/Users/runner/work/cpython/cpython/Lib/__pycache__/traceback.cpython-313.opt-1.pyc.4525821920'")]

build: https://github.com/python/cpython/actions/runs/6364093656/job/17280144785?pr=110139

@vstinner vstinner added skip news and removed needs backport to 3.12 only security fixes labels Sep 30, 2023
@vstinner
Copy link
Member Author

The 3.12 should be included in PR gh-109950.

@vstinner vstinner merged commit 0def8c7 into python:main Sep 30, 2023
@vstinner vstinner deleted the test_venv2 branch September 30, 2023 18:23
@miss-islington
Copy link
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@bedevere-app
Copy link

bedevere-app bot commented Sep 30, 2023

GH-110153 is a backport of this pull request to the 3.11 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 30, 2023
…() (pythonGH-110149)

Call also copy_python_src_ignore() on listdir() names.

shutil.copytree(): replace set() with an empty tuple. An empty tuple
becomes a constant in the compiler and checking if an item is in an
empty tuple is cheap.
(cherry picked from commit 0def8c7)

Co-authored-by: Victor Stinner <[email protected]>
@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Sep 30, 2023
vstinner added a commit that referenced this pull request Sep 30, 2023
…x() (GH-110149) (#110153)

gh-109748: Fix again venv test_zippath_from_non_installed_posix() (GH-110149)

Call also copy_python_src_ignore() on listdir() names.

shutil.copytree(): replace set() with an empty tuple. An empty tuple
becomes a constant in the compiler and checking if an item is in an
empty tuple is cheap.
(cherry picked from commit 0def8c7)

Co-authored-by: Victor Stinner <[email protected]>
@bedevere-bot
Copy link

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

Hi! The buildbot wasm32-emscripten node (pthreads) 3.x has failed when building commit 0def8c7.

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/1050/builds/3211) and take a look at the build logs.
  4. Check if the failure is related to this commit (0def8c7) 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/1050/builds/3211

Failed tests:

  • test_fileio

Failed subtests:

  • testErrnoOnClosedTruncate - test.test_fileio.CAutoFileTests.testErrnoOnClosedTruncate

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.emscripten-node-pthreads/build/Lib/test/test_fileio.py", line 274, in wrapper
    self.assertEqual(e.errno, errno.EBADF)
AssertionError: 28 != 8


Traceback (most recent call last):
  File "/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.emscripten-node-pthreads/build/Lib/test/test_fileio.py", line 272, in wrapper
    func(self, f)
  File "/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.emscripten-node-pthreads/build/Lib/test/test_fileio.py", line 302, in testErrnoOnClosedTruncate
    f.truncate(0)
OSError: [Errno 28] Invalid argument

vstinner added a commit to vstinner/cpython that referenced this pull request Oct 4, 2023
…() (python#110149)

Call also copy_python_src_ignore() on listdir() names.

shutil.copytree(): replace set() with an empty tuple. An empty tuple
becomes a constant in the compiler and checking if an item is in an
empty tuple is cheap.

(cherry picked from commit 0def8c7)
vstinner added a commit that referenced this pull request Oct 4, 2023
…#110340)

* gh-109615: Fix support test_copy_python_src_ignore() (#109958)

Fix the test when run on an installed Python: use "abs_srcdir" of
sysconfig, and skip the test if the Python source code cannot be
found.

* Tools/patchcheck/patchcheck.py, Tools/freeze/test/freeze.py and
  Lib/test/libregrtest/utils.py now first try to get "abs_srcdir"
  from sysconfig, before getting "srcdir" from sysconfig.
* test.pythoninfo logs sysconfig "abs_srcdir".

(cherry picked from commit b89ed9d)

* gh-109615: Fix support test_copy_python_src_ignore() on WASM (#109970)

Not only check if src_dir exists, but look also for Lib/os.py
landmark.

(cherry picked from commit cc54bcf)

* gh-109615: Look for 'Modules' as landmark for test_copy_python_src_ignore (GH-110108)

(cherry picked from commit 20bc5f7)

* gh-109748: Fix again venv test_zippath_from_non_installed_posix() (#110149)

Call also copy_python_src_ignore() on listdir() names.

shutil.copytree(): replace set() with an empty tuple. An empty tuple
becomes a constant in the compiler and checking if an item is in an
empty tuple is cheap.

(cherry picked from commit 0def8c7)

---------

Co-authored-by: Steve Dower <[email protected]>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…() (python#110149)

Call also copy_python_src_ignore() on listdir() names.

shutil.copytree(): replace set() with an empty tuple. An empty tuple
becomes a constant in the compiler and checking if an item is in an
empty tuple is cheap.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants