Skip to content

Keyring support broken on Windows when keyring.exe is found on PATH after #11589 #11658

@Darsstar

Description

@Darsstar

Description

#11589 assumes all OSes have \n as the line seperator, that is incorrect for WIndows. Python already has os.linesep which should be used instead.

I included the fix in #11029, which currently is part of the 23.0 milestone.

See #11399 (comment) for additional context.

Expected behavior

os.linesep should be used so the password used by Pip won't end with \r on Windows.

pip version

unreleased

Python version

all

OS

Windows

How to Reproduce

  1. Configure python to use a private repository and be sure to include a username in the url credential section
  2. install keyring somewhere and make sure keyring.exe can only be found via PATH lookup and not by importing it as a package
  3. make sure pip can find the password for the configured url and username combination only via keyring.exe on the PATH
  4. try to pip install something
  5. it will fail because Pip does not strip \r from the password

Output

Looking in indexes:
WARNING: 401 Error, Credentials not correct for

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions