Issue #346 new

upload fails without [server-login] but register does not

Chris Jerdonek
created an issue

For some reason, the upload command is stricter than the register command when writing to PyPI. Upload requires a [server-login] section in .pypirc, but register does not. It seems like they should at least use the same logic. This was with 0.6.26. I don't know yet if it affects later versions of Distribute.

This is with a "[distutils] index-servers =" section in the .pypirc.

For example:

$ python setup.py register -r test
using: version '0.6' of <module 'setuptools' from '.../python2.7/site-packages/distribute-0.6.26-py2.7.egg/setuptools/__init__.pyc'>
Registering Foo to http://testpypi.python.org/pypi
Server response (200): OK

$ python setup.py upload -r test
using: version '0.6' of <module 'setuptools' from '.../python2.7/site-packages/distribute-0.6.26-py2.7.egg/setuptools/__init__.pyc'>
running upload
Traceback (most recent call last):
  File "setup.py", line 99, in <module>
    main(sys.argv)
  File "setup.py", line 95, in main
    classifiers=CLASSIFIERS,
  File ".../python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File ".../python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File ".../python2.7/distutils/dist.py", line 971, in run_command
    cmd_obj.ensure_finalized()
  File ".../python2.7/distutils/cmd.py", line 109, in ensure_finalized
    self.finalize_options()
  File ".../python2.7/site-packages/distribute-0.6.26-py2.7.egg/setuptools/command/upload.py", line 64, in finalize_options
    self.username = config.get('server-login', 'username')
  File ".../python2.7/ConfigParser.py", line 607, in get
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'server-login'

Comments (4)

  1. Chris Jerdonek reporter

    After thinking about this more, I think the best thing to do as an early step would be to refactor things so that both register and upload use the same code for setting the repository, username, password, attributes, etc. from the given command-line options and .pypirc file. Since register seems to be working better here, it might make sense to use that code as the basis (or to combine the best of both).

  2. Log in to comment