bpo-25567: Add the support of bytes in quotes.#10871
bpo-25567: Add the support of bytes in quotes.#10871hobbestigrou wants to merge 1 commit intopython:masterfrom
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for your contribution, we look forward to reviewing it! |
0e210a3 to
0235ef5
Compare
0235ef5 to
e82a4c0
Compare
Doc/library/shlex.rst
Outdated
There was a problem hiding this comment.
You should add ".. versionchanged:: 3.8" markup and describe the new feature.
Lib/shlex.py
Outdated
Lib/shlex.py
Outdated
There was a problem hiding this comment.
Move the code inside previous if/else.
There was a problem hiding this comment.
| Added the support of bytes in quote method from shlex module. | |
| Add the bytes support to the :func:`shlex.quote` function. |
vstinner
left a comment
There was a problem hiding this comment.
You might amend the commit message (and use git push --force) to use "Co-Authored-By:" instead of "Co-authored-by:". I don't know if tools checking for "Co-Authored-By:" are case sensitive?
Add the support of bytes in quotes method in shlex module. Co-authored-by: Nan Wu <nanbytesflow@gmail.com>
e82a4c0 to
448bde6
Compare
|
Closing and reopening to trigger CI builds. |
|
|
||
|
|
||
| _find_unsafe = re.compile(r'[^\w@%+=:,./-]', re.ASCII).search | ||
| _find_unsafe_bytes = re.compile(b'[^\w@%+=:,./-]').search |
There was a problem hiding this comment.
| _find_unsafe_bytes = re.compile(b'[^\w@%+=:,./-]').search | |
| _find_unsafe_bytes = re.compile(br'[^\w@%+=:,./-]').search |
This line generates a SyntaxWarning that causes test failure in CI where assert_python_ok asserts for no output in stderr that has this SyntaxWarning. Perhaps use a raw string ?
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/shlex.py:309: SyntaxWarning: invalid escape sequence \w
_find_unsafe_bytes = re.compile(b'[^\w@%+=:,./-]').search
|
@hobbestigrou, please address the code review comments. Thank you! |
|
Closing due to inactivity. This issue is now available for someone else to work on it. If this PR is used in a new PR, please remember to credit to original author. Thanks! |
Add the support of bytes in quotes method.
Co-authored-by: Nan Wu nanbytesflow@gmail.com
https://bugs.python.org/issue25567