Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format_filename replaces invalid bytes #2553

Merged
merged 1 commit into from Jul 5, 2023
Merged

Conversation

davidism
Copy link
Member

@davidism davidism commented Jul 5, 2023

continues #2487 by @RazerM
fixes #2395

  • Names are converted to bytes, handling surrogate escapes, then invalid bytes are replaced.
  • Remove _compat.get_filesystem_encoding, sys.getfilesystemencoding does not return None since Python 3.2.
  • Use format_filename in more places.
  • Test that surrogate escapes are not present in error messages.
  • Add information about when surrogate escapes are safe for output to format_filename docstring.
  • Move supports_symlinks check next to test instead of importing.
  • Improve click.Path documentation about str/bytes handling.

@davidism davidism added this to the 8.1.4 milestone Jul 5, 2023
-   Names are converted to bytes, handling surrogate escapes, then
    invalid bytes are replaced.
-   Remove _compat.get_filesystem_encoding, sys.getfilesystemencoding
    does not return None since Python 3.2.
-   Use format_filename in more places.
-   Test that surrogate escapes are not present in error messages.
-   Add information about when surrogate escapes are safe for output to
    format_filename docstring.
-   Move supports_symlinks check next to test instead of importing.
-   Improve click.Path documentation about str/bytes handling.
@davidism davidism linked an issue Jul 5, 2023 that may be closed by this pull request
@davidism davidism merged commit af1e8d4 into 8.1.x Jul 5, 2023
12 checks passed
@davidism davidism deleted the format_filename-errors branch July 5, 2023 18:33
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

click.format_filename regression in click 8 for non-unicode paths
2 participants