-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Fix invisible character typo #123933
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
Fix invisible character typo #123933
Conversation
Remove accidental addition of zero-width character (U+FEFF) reported by @jaraco: - python@c3f4a6b#commitcomment-146456562
@jaraco I also took the time to investigate the GitHub pull request's "Files changed" page, where I noticed that the HTML included the invisible character, although it wasn't explicitly displayed. I believe it would be beneficial to suggest a feature to the GitHub development team to improve the visibility of invisible characters in code difference pages, making it easier for developers to identify and address these issues. Update: |
Thanks @xyb. I was planning to let the fix in zipp to make its way here naturally, but I'm also happy to have this fixed here sooner. |
I don't think it's the case that CPython uses |
FYI, we can show the invisible characters in the git commit history using
diff --git a/Lib/zipfile/_path/__init__.py b/Lib/zipfile/_path/__init__.py$
index 5079db90648..c0e53e273cf 100644$
--- a/Lib/zipfile/_path/__init__.py$
+++ b/Lib/zipfile/_path/__init__.py$
@@ -280,7 +280,7 @@ class Path:$
>>> str(path.parent)$
'mem'$
$
- If the zipfile has no filename, such M-oM-;M-?attributes are not$
+ If the zipfile has no filename, such attributes are not$
valid and accessing them will raise an Exception.$
$
>>> zf.filename = None$ |
We use some specific Ruff rules on some specific areas of the CPython codebase. But we do not currently run Ruff on any parts of the standard library (and I think it would have to be extensively discussed before we did so). See https://github.com/python/cpython/blob/main/.pre-commit-config.yaml for details. |
Remove accidental addition of zero-width character (U+FEFF) in #118622, reported by @jaraco:
The character can be found by:
❯ rg '\ufeff' Lib/zipfile/_path/__init__.py 283: If the zipfile has no filename, such attributes are not
The character has been removed and can no longer be found in the cpython repository.
Additionally, @jaraco has requested a new feature in
ruff
to detect invisible characters in the future (astral-sh/ruff#13297). Since cpython usesruff
for linting, this feature will prevent similar issues from occurring in the future.