Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update importlib/test_importlib from CPython 3.10.6 #3919

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 17, 2022

Conversation

youknowone
Copy link
Member

@youknowone youknowone commented Jul 18, 2022

I have no idea whats going on its failure.

blocked by #3863, #3961

@fanninpm
Copy link
Contributor

Directory tree in RustPython (as it stands right now):

Lib/importlib/
├── __init__.py
├── _bootstrap.py
├── _bootstrap_external.py
├── abc.py
├── machinery.py
├── metadata.py
├── resources.py
└── util.py

Directory tree in CPython 3.10:

Lib/importlib/
├── metadata/
│   ├── __init__.py
│   ├── _adapters.py
│   ├── _collections.py
│   ├── _functools.py
│   ├── _itertools.py
│   ├── _meta.py
│   └── _text.py
├── __init__.py
├── _abc.py
├── _adapters.py
├── _bootstrap.py
├── _bootstrap_external.py
├── _common.py
├── abc.py
├── machinery.py
├── readers.py
├── resources.py
└── util.py

@youknowone
Copy link
Member Author

I am sorry, it was my mistake to miss new files in commit. The error is very unexpected:

Traceback (most recent call last):
  File "/Users/user/Projects/RustPython/vm/pylib-crate/Lib/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/Users/user/Projects/RustPython/vm/pylib-crate/Lib/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "_frozen_importlib", line 1129, in __import__
  File "_frozen_importlib", line 1050, in _gcd_import
  File "_frozen_importlib", line 1027, in _find_and_load
  File "_frozen_importlib", line 1027, in _find_and_load
  File "_frozen_importlib", line 1006, in _find_and_load_unlocked
  File "_frozen_importlib", line 703, in _load_unlocked
  File "_frozen_importlib", line 701, in _load_unlocked
  File "_frozen_importlib", line 694, in _load_unlocked
  File "_frozen_importlib", line 688, in _load_unlocked
  File "_frozen_importlib_external", line 879, in exec_module
  File "_frozen_importlib_external", line 1017, in get_code
  File "_frozen_importlib_external", line 948, in source_to_code
  File "_frozen_importlib", line 241, in _call_with_frames_removed
  File "/Users/user/Projects/RustPython/vm/pylib-crate/Lib/test/test_importlib/test_util.py", line 1
    from . import util
     ^
SyntaxError: Got unexpected token  at line 1 column 2
from . import util
 ^

@youknowone
Copy link
Member Author

Thank you, that explains the diff. It means we don't support bom for files.

@youknowone
Copy link
Member Author

plistlib depends on new importlib

@fanninpm
Copy link
Contributor

@fanninpm fanninpm mentioned this pull request Jul 24, 2022
8 tasks
@youknowone youknowone force-pushed the importlib branch 2 times, most recently from 638c8ab to 3a16e84 Compare August 13, 2022 18:35
@youknowone youknowone marked this pull request as ready for review August 13, 2022 18:35
@youknowone youknowone mentioned this pull request Aug 13, 2022
2 tasks
@youknowone youknowone changed the title update importlib/test_importlib Update importlib/test_importlib from CPython 3.10.6 Aug 13, 2022
@youknowone youknowone force-pushed the importlib branch 2 times, most recently from a24fd70 to c79d9df Compare August 13, 2022 21:53
@@ -295,7 +307,7 @@ def writes_bytecode_files(fxn):
"""Decorator to protect sys.dont_write_bytecode from mutation and to skip
tests that require it to be set to False."""
if sys.dont_write_bytecode:
return lambda *args, **kwargs: None
return unittest.skip(fxn)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is submitted to python/cpython#95972

@youknowone youknowone force-pushed the importlib branch 8 times, most recently from 68fd66d to 726d5af Compare August 16, 2022 18:11
@youknowone youknowone merged commit 99b34a9 into RustPython:main Aug 17, 2022
@youknowone youknowone deleted the importlib branch August 17, 2022 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants