سؤال

I'm trying to setup a local pypi server. I use pep381client to synchronize the official PYPI server.

It works fine. But today I encountered a problem: I stop (by Ctr+C) it and then restart , pep381run raise error as the following:

E:\tmp>pep381run.py pypi
Synchronizing OBITools
Copying /packages/source/O/OBITools/OBITools-0.2.000.tar.gz
Copying /packages/source/O/OBITools/OBITools-0.2.002.tar.gz
Copying /packages/source/O/OBITools/OBITools-00.02.503.tar.gz
Copying /packages/source/O/OBITools/OBITools-00.02.500.tar.gz
Traceback (most recent call last):
  File "D:\Python27\Scripts\pep381run.py", line 31, in <module>
    state.synchronize()
  File "D:\Python27\lib\site-packages\pep381client\__init__.py", line 119, in synchronize
    self._synchronize()
  File "D:\Python27\lib\site-packages\pep381client\__init__.py", line 159, in _synchronize
    self.maybe_copy_file(project, file)
  File "D:\Python27\lib\site-packages\pep381client\__init__.py", line 237, in maybe_copy_file
    r = h.getresponse()
  File "D:\Python27\lib\httplib.py", line 1033, in getresponse
    raise ResponseNotReady()
httplib.ResponseNotReady  

Any idea ?

هل كانت مفيدة؟

المحلول

Reminded by this question , after making a dirty and desperate change to the code as the following:

def http():
    global _conn
    _conn = httplib.HTTPSConnection(pypi) 
    _conn.connect()
    return _conn

It works again.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top