Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

venv.EnvBuilder.ensure_directories() no longer accepts Path for env_dir parameter #92675

Closed
Labels
stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@davidfstr

Description

@davidfstr

Bug report

The Poetry project'sinstall-poetry.py setup script relies on the ability to pass aPath instance tovenv.EnvBuilder.ensure_directories(), which is possible in Python 3.10. However Python 3.11b1 introduced code that assumed the use of astr path which crashes when given aPath.

Repro steps:

$ wget https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py$ python3 install-poetry.py [...]Installing Poetry (1.1.13): Creating environmentTraceback (most recent call last):  File "/Users/davidf/Projects/trycast/install-poetry.py", line 908, in <module>    sys.exit(main())             ^^^^^^  File "/Users/davidf/Projects/trycast/install-poetry.py", line 876, in main    return installer.run()           ^^^^^^^^^^^^^^^  File "/Users/davidf/Projects/trycast/install-poetry.py", line 507, in run    self.install(version)    ^^^^^^^^^^^^^^^^^^^^^  File "/Users/davidf/Projects/trycast/install-poetry.py", line 528, in install    with self.make_env(version) as env:    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/contextlib.py", line 137, in __enter__    return next(self.gen)           ^^^^^^^^^^^^^^  File "/Users/davidf/Projects/trycast/install-poetry.py", line 600, in make_env    raise e    ^^^^^^^  File "/Users/davidf/Projects/trycast/install-poetry.py", line 586, in make_env    yield VirtualEnvironment.make(env_path)          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/Users/davidf/Projects/trycast/install-poetry.py", line 292, in make    builder.ensure_directories(target)    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/venv/__init__.py", line 119, in ensure_directories    if os.pathsep in env_dir:       ^^^^^^^^^^^^^^^^^^^^^TypeError: argument of type 'PosixPath' is not iterable

Your environment

  • CPython 3.11b1

I have a patch to fix, which I will be posting as a PR shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp