Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add trace for fallback encoding use
  • Loading branch information
methane committed Apr 15, 2024
commit 4a09f06af2ef93e0f194a1b01e1da363ae791967
2 changes: 2 additions & 0 deletions Lib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ def addpackage(sitedir, name, known_paths):
# We will deprecate this fallback in the future.
import locale
pth_content = pth_content.decode(locale.getencoding())
_trace(f"Cannot read {fullname!r} as UTF-8. "
f"Using fallback encoding {locale.getencoding()!r}")

for n, line in enumerate(pth_content.splitlines(), 1):
if line.startswith("#"):
Expand Down