1. Tarek Ziadé
  2. distribute
  3. Issues
Issue #117 resolved

upload_docs receiving a 200 under Python 3

Brett Cannon
created an issue

Starting from roughly r665, the upload_docs command under Python 3 will run from completion w/o an exception, but it gets a 200 from the servers. This is not the expected response as 301 is the correct one (and what is received when run under at least Python 2.6).

Comments (8)

  1. Brett Cannon reporter
    • changed status to open

    Here is the output of what headers are sent along with the body (sans zipfile) for Python 2.6:

    '/pypi'
    '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
    '153264'
    'Basic ********'
    '\n----------------GHSKFJDLGDS7543FJKLFHRE75642756743254\nContent-Disposition: form-data; name="content";filename="importers.zip"\n\n
    

    <zip file>

    \n----------------GHSKFJDLGDS7543FJKLFHRE75642756743254\nContent-Disposition: form-data; name=":action"\n\ndoc_upload\n----------------GHSKFJDLGDS7543FJKLFHRE75642756743254\nContent-Disposition: form-data; name="name"\n\nimporters\n----------------GHSKFJDLGDS7543FJKLFHRE75642756743254--\n'
    

    And here is it under Python 3.1:

    '/pypi'
    b'--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
    '153264'
    b'Basic ********'
    b'\n----------------GHSKFJDLGDS7543FJKLFHRE75642756743254\nContent-Disposition: form-data; name="content";filename="importers.zip"\n\n
    

    <zip file>

    \n----------------GHSKFJDLGDS7543FJKLFHRE75642756743254\nContent-Disposition: form-data; name=":action"\n\ndoc_upload\n----------------GHSKFJDLGDS7543FJKLFHRE75642756743254\nContent-Disposition: form-data; name="name"\n\nimporters\n----------------GHSKFJDLGDS7543FJKLFHRE75642756743254--\n'
    

    Now I personally cannot see a difference between the two outputs short of the prepended 'b' for the repr of the bytes type. Unless I'm wrong, that would suggest either PyPI is doing something weird or there is a bug in httplib that is being triggered.

  2. James Pye

    I'm getting this with the latest distribute on PyPI:

    *jwp@torch[x]:io/jwp/py-traffic 0% python3 ./setup.py upload_docs
    running upload_docs
    Traceback (most recent call last):
      File "./setup.py", line 20, in <module>
        setup(**defaults)
      File "/x/lib/python3.2/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/x/lib/python3.2/distutils/dist.py", line 917, in run_commands
        self.run_command(cmd)
      File "/x/lib/python3.2/distutils/dist.py", line 936, in run_command
        cmd_obj.run()
      File "/x/lib/python3.2/site-packages/distribute-0.6.26-py3.2.egg/setuptools/command/upload_docs.py", line 87, in run
        self.upload_file(zip_file)
      File "/x/lib/python3.2/site-packages/distribute-0.6.26-py3.2.egg/setuptools/command/upload_docs.py", line 101, in upload_file
        auth = bytes("Basic ")
    TypeError: string argument without an encoding
    

    setup.cfg:

    *jwp@torch[x]:io/jwp/py-traffic 0% cat setup.cfg
    [upload_docs]
    upload-dir = traffic/documentation/html
    
  3. Anonymous
  4. Anonymous

    My bug reported in the comment appears to have been fixed in the latest version. Thanks, upload_docs is wonderful. =)

  5. Log in to comment