upload fails if "-r" flag wasn't supplied

Create issue
Issue #246 resolved
Guy Rozendorn created an issue

This bug was introduced after issue #244.

I will update the issue with the complete content shortly.

Comments (2)

  1. Guy Rozendorn reporter
    • changed status to open

    This issue rises from another ambiguity in Python's distutils.

    As you can read in the http://docs.python.org/distutils/packageindex.html, the default repository is http://www.python.org/pypi, but in the code, its http://pypi.python.org/pypi.

    If no repository argument is supplied in the command-line (remember, the argument is actually a section name in .pypirc, or the url itself), then it looks for the default http://pypi.python.org/pypi.

    Then, this default is matched against any section in your .pypirc file. If this default matches a section's name, or its repository value, then it is returned. If nothing is matched, then the upload command gets no username and password.

    If you're following the documentation, you're bound to fail because you wrote down the repository as http://www.python.org/pypi, which will result in a mismatch.

    I can think of two ways to resolve this issue:

    1. Change the DEFAULT_REPOSITORY to "pypi" or http://www.python.org/pypi, which matches the documentation.
    2. Change the logic so that if the URL in the current section matches http://www.python.org/pypi and you didn't supply a repository argument in the command-line, it will return the information from this section, instead of skipping it.

    Option #1 is more 'correct', but #2 is safer and more compatible -- as people may have used pypi.python.org

  2. Log in to comment