path.sep goes missing when importing in a debugger in Python 3.10
See original GitHub issueHi,
I think I’m encountering the same error as https://github.com/pyproj4/pyproj/issues/1028 but with Fiona instead of pyproj
Also related: https://github.com/pytest-dev/pytest/issues/9791#issuecomment-1081617058
Expected behavior and actual behavior.
The following code should run without any error:
import os
print(os.path.sep)
import fiona
print(os.path.sep)
But, I get the following exception:
/Users/idan.miara/.pyenv/versions/py310/bin/python /Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py --multiprocess --qt-support=auto --client 127.0.0.1 --port 49298 --file /Users/idan.miara/workspace/temp/temp.py
/
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1496, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/idan.miara/workspace/temp/temp.py", line 4, in <module>
print(os.path.sep)
AttributeError: module 'posixpath' has no attribute 'sep'```
Steps to reproduce the problem.
Run the code snippet above in Python 3.10 in debug mode (I use PyCharm)
The problem is reproducible on: Python 3.10.7 in debug mode
The problem is not reproducible on: Python 3.10.7 in non-debug mode (normal run) Python 3.9.12 in either mode
Operating system
For example: Mac OS X 12.6
Fiona and GDAL version and provenance
Fiona 1.8.21 installed from PyPI using pip version 22.2.2.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
in VS Code ImportError: cannot import name 'Mapping' from ...
4. I think the problem is inside the test.py: from collections import Mapping · 7. Problem solved by: from collections. · 2. It...
Read more >What's New In Python 3.10 — Python 3.11.1 documentation
PEP 626, Precise line numbers for debugging and other tools. ... but in Python 3.10 a more informative error is emitted: ... Missing...
Read more >How to use the Python debugger (pdb) - Red Hat
Pdb is a powerful tool for finding syntax errors, spelling mistakes, missing code, and other issues in your Python code.
Read more >Python debugger not working while normal run does
The python debugger in Pycharm (I've the latest version) is not working for ... This way import termios in getpass will correctly fail...
Read more >ModuleNotFoundError: no module named Python Error [Fixed]
you are importing a module using the wrong path. How to fix the ModuleNotFoundError in Python. As I mentioned in the previous section,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Done!
I’m not familiar with Python’s development mode, but when I run any pytest test in PyCharm with Python 3.10, that imports fiona, it fails with that error.
I did find a workaround, adding the following code at the top of the test makes the test pass:
On Mon, 3 Oct 2022, 23:41 Sean Gillies, @.***> wrote: