mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
In our next commit we will use the scheme path to locate files to byte-compile. If the scheme path is a `Path`, then that causes `compileall.compile_file` (via `py_compile.compile`) to fail with: ``` .tox/py38/lib/python3.8/site-packages/pip/_internal/operations/install/wheel.py:615: in install_unpacked_wheel success = compileall.compile_file( ../../../.pyenv/versions/3.8.0/lib/python3.8/compileall.py:157: in compile_file ok = py_compile.compile(fullname, cfile, dfile, True, ../../../.pyenv/versions/3.8.0/lib/python3.8/py_compile.py:162: in compile bytecode = importlib._bootstrap_external._code_to_timestamp_pyc( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ code = <code object <module> at 0x7fa7e274f500, file "/tmp/user/1000/pytest-of-chris/pytest-37/test_std_install_with_direct_u0/dest/lib/sample/__init__.py", line 1>, mtime = 1593910285.2200587, source_size = 134 > ??? E ValueError: unmarshallable object ``` Debugging in gdb shows that the error is set due to the `Path` object being present in the code object, which `marshal.dumps` can't handle (frame 1): ``` 0 w_complex_object (v=<optimized out>, flag=<optimized out>, p=0x7fffffff7160) at Python/marshal.c:564 1 w_object (v=<Path at remote 0x7fffee51f120>, p=0x7fffffff7160) at Python/marshal.c:370 2 w_complex_object (v=<code at remote 0x7fffee591710>, flag=<optimized out>, p=0x7fffffff7160) at Python/marshal.c:544 3 w_object (v=<code at remote 0x7fffee591710>, p=0x7fffffff7160) at Python/marshal.c:370 4 w_complex_object (v=('1.2.0', <code at remote 0x7fffee591710>, 'main', None), flag=<optimized out>, p=0x7fffffff7160) at Python/marshal.c:475 5 w_object (v=('1.2.0', <code at remote 0x7fffee591710>, 'main', None), p=0x7fffffff7160) at Python/marshal.c:370 6 w_complex_object (v=<code at remote 0x7fffee591ea0>, flag=<optimized out>, p=0x7fffffff7160) at Python/marshal.c:539 7 w_object (p=0x7fffffff7160, v=<code at remote 0x7fffee591ea0>) at Python/marshal.c:370 8 PyMarshal_WriteObjectToString (version=<optimized out>, x=<code at remote 0x7fffee591ea0>) at Python/marshal.c:1598 9 marshal_dumps_impl (module=<optimized out>, version=<optimized out>, value=<code at remote 0x7fffee591ea0>) at Python/marshal.c:1739 10 marshal_dumps (module=<optimized out>, args=<optimized out>, nargs=<optimized out>) at Python/clinic/marshal.c.h:124 ``` In the interest of easy git bisects, we commit this fix before the code that would expose the bug. |
||
---|---|---|
.. | ||
data | ||
functional | ||
lib | ||
unit | ||
yaml | ||
__init__.py | ||
conftest.py |