重启时pep381run坏了:httplib.ResponseNotReady

时间:2013-07-25 11:32:37

标签: python repository pypi

我正在尝试设置本地pypi服务器。我使用pep381client来同步官方PYPI服务器。

工作正常。但今天我遇到了一个问题:我停止(通过Ctr + C)然后重新启动,pep381run引发错误如下:

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  

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

在对以下代码进行肮脏且绝望的更改后,由question提醒:

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

再次有效。