This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: register --repository is broken
Type: Stage: resolved
Components: Distutils Versions:
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: dstufft, eric.araujo, shimizukawa, steve.dower
Priority: normal Keywords:

Created on 2018-01-29 22:58 by shimizukawa, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg311195 - (view) Author: Takayuki SHIMIZUKAWA (shimizukawa) Date: 2018-01-29 22:58
Although document says "The --repository or -r option lets you specify a PyPI server different from the default", if there is no URL specified in ``.pypirc`` it will display "ValueError: <URL> not found in .pypirc".


  $ python3 register -r
  running register
  running egg_info
  writing dependency_links to test.egg-info/dependency_links.txt
  writing top-level names to test.egg-info/top_level.txt
  writing test.egg-info/PKG-INFO
  reading manifest file 'test.egg-info/SOURCES.txt'
  writing manifest file 'test.egg-info/SOURCES.txt'
  Traceback (most recent call last):
    File "", line 4, in <module>
    File "/usr/lib/python3.5/distutils/", line 148, in setup
    File "/usr/lib/python3.5/distutils/", line 955, in run_commands
    File "/usr/lib/python3.5/distutils/", line 974, in run_command
    File "/usr/lib/python3/dist-packages/setuptools/command/", line 10, in run
    File "/usr/lib/python3.5/distutils/command/", line 45, in run
    File "/usr/lib/python3.5/distutils/command/", line 80, in _set_config
      raise ValueError('%s not found in .pypirc' % self.repository)
  ValueError: not found in .pypirc

  $ python3 -V
  Python 3.5.2

  $ lsb_release -a
  No LSB modules are available.
  Distributor ID: Ubuntu
  Description:    Ubuntu 16.04.3 LTS
  Release:        16.04
  Codename:       xenial

This behavior could be confirmed on Windows.

I think there are two correction methods.
One is to fix it so that we can specify any URL regardless of the setting of .pypirc.
The other is to write in the document that "-r option can specify server name or URL in .pypirc".
msg312290 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2018-02-18 00:08
There are many open issues with .pypirc.

I don’t think that -r URL is a supported use case though; the docs should say that the usage is to add a section in .pypirc to define a repo, then use -r repo-section-name.
msg386331 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:19
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at
Date User Action Args
2022-04-11 14:58:57adminsetgithub: 76897
2021-02-03 18:19:24steve.dowersetstatus: open -> closed

nosy: + steve.dower
messages: + msg386331

resolution: out of date
stage: resolved
2018-02-18 00:08:31eric.araujosetmessages: + msg312290
versions: - Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7
2018-01-29 22:58:48shimizukawacreate