Skip to content

gh-69753: added decode bytes to utf-8#121741

Closed
mihai011 wants to merge 5 commits intopython:mainfrom
mihai011:gh-69753-shlex-decode-bytes
Closed

gh-69753: added decode bytes to utf-8#121741
mihai011 wants to merge 5 commits intopython:mainfrom
mihai011:gh-69753-shlex-decode-bytes

Conversation

@mihai011
Copy link
Copy Markdown

@mihai011 mihai011 commented Jul 14, 2024

@ghost
Copy link
Copy Markdown

ghost commented Jul 14, 2024

The following commit authors need to sign the Contributor License Agreement:

Click the button to sign:
CLA not signed

@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Jul 14, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Jul 14, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Jul 14, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@encukou
Copy link
Copy Markdown
Member

encukou commented Jul 14, 2024

Thank you for taking this on!

As stated in the issue:

some operations (e.g. file access to some known paths) decoding and encoding from/to any sort of unicode interpretation can be lossy, specifically when the file path on the filesystem has broken/mixed encoding characters.

In cases where encoding to UTF-8 helps, the user can do it themselves.
Encoding and decoding with surrogateescape, as suggested by @bitdancer, would work better.

The feature will also need tests and a note in the documentation.

@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Jul 14, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@serhiy-storchaka
Copy link
Copy Markdown
Member

I afraid that this does not fix the original issue. Please read the discussion. It was also suggested to add support of bytes to all shlex module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants