Repository navigation
Read the Pipfile as UTF-8 in check, scan and --support - #6779
Merged
matteius merged 1 commit intoNov 5, 2026
Merged
Conversation
matteius
approved these changes
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The issue
Follow-up to #6756.
pipenv check,pipenv scanandpipenv --supportstill open the Pipfile (and--supportalsoPipfile.lock) with the locale encoding. On Windows with a legacy code page, a Pipfile with any non-ASCII text, even a comment, makes them fail:A Pipfile saved with a BOM breaks
checkandscanon every platform (EmptyKeyError: Empty key at line 1 col 0).The fix
Open them as
utf-8-sig, like the other Pipfile and lockfile readers. The new cases intests/unit/test_pipfile_encoding.pyfail without the change (all of them on cp932; the BOM cases under-X utf8).The checklist
news/directory to describe this fix with the extension.bugfix.rst,.feature.rst,.behavior.rst,.doc.rst..vendor.rst. or.trivial.rst(this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.