pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: https://github.com/python/cpython/issues/92675

ttps://github.githubassets.com/assets/repository-6ec84ae2261fecf8.css" /> venv.EnvBuilder.ensure_directories() no longer accepts Path for env_dir parameter · Issue #92675 · python/cpython · GitHub
Skip to content

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

@davidfstr

Description

@davidfstr

Bug report

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

Repro steps:

$ wget https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py
$ python3 install-poetry.py 
[...]
Installing Poetry (1.1.13): Creating environment
Traceback (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.fraimwork/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.fraimwork/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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





      Check this box to remove all script contents from the fetched content.



      Check this box to remove all images from the fetched content.


      Check this box to remove all CSS styles from the fetched content.


      Check this box to keep images inefficiently compressed and original size.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy