You are probably leaking socket file descriptors. Make sure you are closing all connections and files you read/write from/to. You can get a reference of pycurl error codes at:
http://curl.haxx.se/libcurl/c/libcurl-errors.html
Also you might try to set CURLOPT_VERBOSE option, to get more debug information.