Skip to content

Use shlex.quote instead of deprecated pipes.quote#2351

Merged
gaborbernat merged 1 commit into
pypa:mainfrom
frenzymadness:pipes
Jun 7, 2022
Merged

Use shlex.quote instead of deprecated pipes.quote#2351
gaborbernat merged 1 commit into
pypa:mainfrom
frenzymadness:pipes

Conversation

@frenzymadness

@frenzymadness frenzymadness commented Jun 6, 2022

Copy link
Copy Markdown
Contributor

pipes module is deprecated in Py 3.11 and will be removed in 3.13.
https://docs.python.org/3.11/whatsnew/3.11.html

This is an implementation detail so I believe that it does not need a changelog entry.

  • ran the linter to address style issues (tox -e fix_lint)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation
@hroncok

hroncok commented Jun 6, 2022

Copy link
Copy Markdown
Contributor

I am afraid the code was Python 2 compatible and is no more. The function was moved in 3.3+.

@frenzymadness

Copy link
Copy Markdown
Contributor Author

So, I can either use if PY2 to import from the correct module or handle ImportError and then import from the deprecated module. @gaborbernat what do you prefer?

@frenzymadness frenzymadness force-pushed the pipes branch 2 times, most recently from 9c72816 to 553fa1f Compare June 7, 2022 06:35
@frenzymadness

Copy link
Copy Markdown
Contributor Author

I've decided to use if PY2 because conditions are generally faster than exception handling even if it means adding a new import to some of the modules. And it seems that make_zipapp.py module cannot import from virtualenv so I have to use a copy of sys.version_info[0] == 2 there.

@gaborbernat gaborbernat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's add a changelog here 👍

@frenzymadness

Copy link
Copy Markdown
Contributor Author

Let's add a changelog here +1

Done, I think :)

@gaborbernat gaborbernat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pipes module is deprecated in Py 3.11 and will be removed in 3.13.
https://docs.python.org/3.11/whatsnew/3.11.html
@gaborbernat gaborbernat merged commit a70b019 into pypa:main Jun 7, 2022
@frenzymadness frenzymadness deleted the pipes branch June 7, 2022 11:15
gaborbernat added a commit that referenced this pull request Jun 25, 2022
* Bump pip and setuptools (#2348)

Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>

* Use shlex.quote instead of deprecated pipes.quote (#2351)

* Embeds the "python<VERSION>.zip" for Windows.

For example, for Python 3.10 the embeddable file name would be
"python310.zip". If this file would be found in `sys.path`, the
virtualenv should copy it into the "<venv>\Scripts\python310.zip".

* For Windows CPython3: *.dll/*.pyd -> to_bin

* Fixture for a Python interpreter info.

Helps to test virtualenv creator classes.

* Creators tests: path_mock as separate module.

* Clarifies tests, separates testing tools.

* Tests for CPython3Windows sources.

* Tests for the embedded Python std lib for Windows.

* Add news entry.

* Replaces `yield from` for backward compability.

* FIX: Path mocking in pypy tests.

* Wrap `sys` `Path` with `str` for importlib.

The importlib accepts a Path-like objects from Python 3.6

* Makes PathMock ABC compatible with Python 2

* Does not collect tests for Python3 under Python 2

It is possible to make pass CPython3 tests under Python 2,
but it's better to disable it instead of decreasing the
readability and performance of Python 3 style.

* Allows empty `Path()` in Windows with Python 2

* Allows to load fixture files with PY2 Windows Path

* Skips one PY3 POSIX test in PY2 Windows

Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
Co-authored-by: Lumír 'Frenzy' Balhar <lbalhar@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants