Python 3.2 won't import cookielib

The automatic renaming business only applies if you use 2to3. Therefore, you have to import http.cookiejar.

The error EOFError: EOF read where not expected is only ever thrown by Python marshalling. Most likely, this is caused by a race condition fixed in Python 3.3, where multiple processes tried to write concurrently to the pyc file. Deleting all .pyc files may be a workaround.


The cookielib module has been renamed to http.cookiejar in Python 3.0. The 2to3 tool will automatically adapt imports when converting your sources to 3.0.

Tags:

Python