pypa / virtualenv

Virtual Python Environment builder
https://virtualenv.pypa.io
MIT License
4.78k stars 1.02k forks source link

Issue with latest filelock (3.15.0) #2737

Closed ggydush closed 2 months ago

ggydush commented 2 months ago

Issue

Cannot create a virtual environment with the latest filelock. Environment

Provide at least:

test-pypa > pip list                     
Package              Version
-------------------- ---------
build                1.2.1
CacheControl         0.14.0
certifi              2024.6.2
cffi                 1.16.0
charset-normalizer   3.3.2
cleo                 2.1.0
crashtest            0.4.1
distlib              0.3.8
dulwich              0.21.7
fastjsonschema       2.19.1
filelock             3.15.0
idna                 3.7
importlib_metadata   7.1.0
installer            0.7.0
jaraco.classes       3.4.0
keyring              24.3.1
more-itertools       10.3.0
msgpack              1.0.8
packaging            24.1
pexpect              4.9.0
pip                  24.0
pkginfo              1.11.1
platformdirs         4.2.2
poetry               1.8.1
poetry-core          1.9.0
poetry-plugin-export 1.8.0
ptyprocess           0.7.0
pycparser            2.22
pyproject_hooks      1.1.0
rapidfuzz            3.9.3
requests             2.32.3
requests-toolbelt    1.0.0
setuptools           69.5.1
shellingham          1.5.4
tomlkit              0.12.5
trove-classifiers    2024.5.22
urllib3              2.2.1
virtualenv           20.26.2
wheel                0.43.0
xattr                1.1.0
zipp                 3.19.2

Output of the virtual environment creation

Make sure to run the creation with -vvv --with-traceback:

test-pypa > python -m virtualenv 'test-other' -vvv -with-traceback
155 setup logging to NOTSET [DEBUG report:36]
166 find interpreter for spec PythonSpec(path=/private/tmp/test-pypa/bin/python) [INFO builtin:72]
168 filesystem is not case-sensitive [DEBUG info:25]
168 TypeError: object.__init__() takes exactly one argument (the instance to initialize) [ERROR __main__:62]
Exception ignored in: <function BaseFileLock.__del__ at 0x1031f80e0>
Traceback (most recent call last):
  File "/private/tmp/test-pypa/lib/python3.11/site-packages/filelock/_api.py", line 365, in __del__
    self.release(force=True)
  File "/private/tmp/test-pypa/lib/python3.11/site-packages/virtualenv/util/lock.py", line 34, in release
    with self.thread_safe:
         ^^^^^^^^^^^^^^^^
AttributeError: '_CountedFileLock' object has no attribute 'thread_safe'
ggydush commented 2 months ago

Closing as duplicate of https://github.com/pypa/virtualenv/issues/2735