Skip to content

Try both ~/.netrc and ~/_netrc files #186

Closed

Description

@lovelydinosaur

Windows uses "_netrc" rather than ".netrc".
Our implementation should simply try both.

We might want something like this...

if 'NETRC' in os.environ:
    NETRC_FILES = (os.environ['NETRC'],)
else:
    try:
        NETRC_FILES = (os.path.expanduser('~/.netrc'), os.path.expanduser('~/_netrc'))
    except KeyError:
        # May be raised if no user home directory is set.
        NETRC_FILES = ()

As part of this change we probably also want to make sure that any netrc file permission error or parse error simply results in netrc permissions not being used, rather than hard erroring.

Related to #177

Activity

  1. sethmlarson commented on Aug 6, 2019

    @sethmlarson
    Contributor

    This issue has been fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions