Error with my folder name "zlib" #10376
Answered
by
lucky33newman
lucky33newman
asked this question in
Q&A
Replies: 3 comments 1 reply
-
This is a unfortunate quirk of having to add seeming import roots to sys. Path, the zlib folder conflicts with the stdlib that way |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks, I think It is the cause.
It can be solved, by changing the folder name.
But if I do not change the folder name. How may I avoid such conflict?
I know It is stupid to name the folder with a dangerous name 'zlib'. But my
boss decided it's gonna be just like this. :(
Any fancy solutions?
Ronny Pfannschmidt ***@***.***> 于 2022年10月13日周四 14:09写道:
… This is a unfortunate quirk of having to add seeming import roots to sys.
Path, the zlib folder conflicts with the stdlib that way
—
Reply to this email directly, view it on GitHub
<#10376 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWBCZ3MQDDZJESAO7HWVX73WC6RTLANCNFSM6AAAAAARD4RGOU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
lucky33newman
-
Oh yes. :)
…__init__.py helps.
Much thanks.
Ronny Pfannschmidt ***@***.***> 于 2022年10月14日周五 00:26写道:
Add a few __init__.py files to trick pytest into adding something else to
sys. Path
—
Reply to this email directly, view it on GitHub
<#10376 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWBCZ3IA2QIQMKCFPTE45JLWDAZ35ANCNFSM6AAAAAARD4RGOU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys,
I am meeting a strange failure.
ImportError while importing test module '/usr/AGL/agl-test/tests/zlib/test_zlib.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.10/importlib/init.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
E ModuleNotFoundError: No module named 'zlib.test_zlib'; 'zlib' is not a package
It is quite common import error? I do not think so, because the folder ''/usr/AGL/agl-test/tests/zlib''
it can be any other name, just not 'zlib', for example, other test suite like "expat", "bzip2", their folder
was named like "/usr/AGL/agl-test/tests/expat" and "/usr/AGL/agl-test/tests/bzip2", everything works
fine, also if I change the folder name "/usr/AGL/agl-test/tests/zlib" to "/usr/AGL/agl-test/tests/zlib_test"
(just example, it does not have to be fixed like this), the Error Message disappears, why?
Help me and I will thank you :)
Beta Was this translation helpful? Give feedback.
All reactions