Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

AttributeError: module 'tarfile' has no attribute 'data_filter' while building #704

Closed
jolanta-precisionlife opened this issue Nov 30, 2023 · 4 comments

Comments

@jolanta-precisionlife
Copy link

Hi,
I faced the issue while building the package. Please find the logs for build-1.0.3 below. It works fine for build-0.10.0.

Installing collected packages: zipp, tomli, pyproject-hooks, packaging, importlib-metadata, build
Successfully installed build-1.0.3 importlib-metadata-6.8.0 packaging-23.2 pyproject-hooks-1.0.0 tomli-2.0.1 zipp-3.17.0
Building Python wheel.
Traceback (most recent call last):
  File "/home/jolanta/.conan/data/cpython/3.9.7/_/_/package/0830d571bdfb6b94a6d1b7c7f36ec7f140dda55c/lib/python3.9/runpy.py", line 188, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/home/jolanta/.conan/data/cpython/3.9.7/_/_/package/0830d571bdfb6b94a6d1b7c7f36ec7f140dda55c/lib/python3.9/runpy.py", line 147, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/home/jolanta/.conan/data/cpython/3.9.7/_/_/package/0830d571bdfb6b94a6d1b7c7f36ec7f140dda55c/lib/python3.9/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/home/jolanta/Search2-build/pysearchPackage/PySearchVEnv/Debug/lib/python3.9/site-packages/build/__init__.py", line 26, in <module>
    from . import env
  File "/home/jolanta/Search2-build/pysearchPackage/PySearchVEnv/Debug/lib/python3.9/site-packages/build/env.py", line 20, in <module>
    from ._util import check_dependency
  File "/home/jolanta/Search2-build/pysearchPackage/PySearchVEnv/Debug/lib/python3.9/site-packages/build/_util.py", line 84, in <module>
    class TarFile(tarfile.TarFile):
  File "/home/jolanta/Search2-build/pysearchPackage/PySearchVEnv/Debug/lib/python3.9/site-packages/build/_util.py", line 85, in TarFile
    extraction_filter = staticmethod(tarfile.data_filter)
AttributeError: module 'tarfile' has no attribute 'data_filter'

I would like to use the newest build version but I cannot install it die to the issue above.

@henryiii
Copy link
Contributor

henryiii commented Nov 30, 2023

What is sys.version_info? Is it possible you have a modern Python (3.9.18+) but it's using an old 3.9.7 standard library somehow? This should be protected via #675.

@jolanta-precisionlife
Copy link
Author

Thank you for the prompt answer. I am using a virtual environment with python 3.9.18 (sys.version_info(major=3, minor=9, micro=18, releaselevel='final', serial=0)) on a machine that has default python3 set as 3.10.12 (sys.version_info(major=3, minor=10, micro=12, releaselevel='final', serial=0)). There is no older python version installed on the machine.

@henryiii
Copy link
Contributor

henryiii commented Nov 30, 2023

Then why this in your traceback:

File "/home/jolanta/.conan/data/cpython/3.9.7/_/_/package/0830d571bdfb6b94a6d1b7c7f36ec7f140dda55c/lib/python3.9/runpy.py
                                        ^^^^^

Conan seems to be causing Python 3.9.18 to be pulling in 3.9.7's standard library, which of course breaks things, this happens to be the first.

@jolanta-precisionlife
Copy link
Author

Oh, now I see it's a problem with my configuration. Thank you for your help and I am sorry for bothering you.

@layday layday closed this as completed Dec 1, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants