Closed sinecode closed 3 years ago
I assume it is handled through https://github.com/blueyed/py/blob/74e8a7191aec981a2bf6826b6519499359fb3b6e/tasks/vendoring.py - not sure how invoke works though myself.
Maybe it should also not be vendored after all?!
I am having this same issue. What is the status on this?
I am still getting this issue as well, is there any update on a fix?
I also see this issue. An update would be appreciated. Thanks.
since pytest
is also using py
, same issue on pytest
:
$ bpython
bpython version 0.19 on top of Python 3.7.4 /home/test/sandbox/.venv/bin/python
>>> import pytest
Traceback (most recent call last):
File "<input>", line 1, in <module>
import pytest
File "/home/test/sandbox/.venv/lib/python3.7/site-packages/pytest/__init__.py", line 6, in <module>
from _pytest.assertion import register_assert_rewrite
File "/home/test/sandbox/.venv/lib/python3.7/site-packages/_pytest/assertion/__init__.py", line 9, in <module>
from _pytest.assertion import rewrite
File "/home/test/sandbox/.venv/lib/python3.7/site-packages/_pytest/assertion/rewrite.py", line 22, in <module>
from _pytest._io.saferepr import saferepr
File "/home/test/sandbox/.venv/lib/python3.7/site-packages/_pytest/_io/__init__.py", line 4, in <module>
from py.io import TerminalWriter as BaseTerminalWriter # noqa: F401
File "/home/test/sandbox/.venv/lib/python3.7/site-packages/py/_vendored_packages/apipkg.py", line 148, in __makeattr
result = importobj(modpath, attrname)
File "/home/test/sandbox/.venv/lib/python3.7/site-packages/py/_vendored_packages/apipkg.py", line 69, in importobj
module = __import__(modpath, None, None, ['__doc__'])
File "/home/test/sandbox/.venv/lib/python3.7/site-packages/py/__init__.py", line 153, in <module>
'Syslog' : '._log.log:Syslog',
File "/home/test/sandbox/.venv/lib/python3.7/site-packages/py/_vendored_packages/apipkg.py", line 63, in initpkg
for module in sys.modules.values():
RuntimeError: dictionary changed size during iteration
have the same issue. fix it please. thanks
Using the bpython REPL when I import
py
I get the following error:In the
py/_vendored_packages/apikpg.py
module there is a loop over a dictionary that breaks the import mechanism in bpython using Python 3:https://github.com/pytest-dev/py/blob/60f50bdcbca0ad3b66960d2bf6bb488f13e5c5fa/py/_vendored_packages/apipkg.py#L61-L65
The fix for this bug is very simple: simply convert the iterable
sys.modules.values()
in a list withlist(sys.modules.values())
This bug was already fixed in the apipkg package with this pull request.I didn't understand how you manage the
apipkg
module in this package, but I'd like to have this bug fixed because it makespytest
andpy
unusable inbpython
.I'm available to work on this changes, so please let me know.