Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python 3 pip install non-ASCII payload error

Using python3.4 w/ pip trying to install django-floppyforms==1.1 and got this non-ASCII payload error. I don't get this error with python2.7. What's going on?

Downloading/unpacking django-floppyforms==1.1 (from -r ../requirements/base.txt (line 22))
  Downloading django_floppyforms-1.1-py33-none-any.whl (51kB): 51kB downloaded
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/home/admin/.virtualenvs/py3/lib/python3.4/site-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/home/admin/.virtualenvs/py3/lib/python3.4/site-packages/pip/commands/install.py", line 274, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/home/admin/.virtualenvs/py3/lib/python3.4/site-packages/pip/req.py", line 1206, in prepare_files
    for subreq in dist.requires(req_to_install.extras):
  File "/home/admin/.virtualenvs/py3/lib/python3.4/site-packages/pip/_vendor/pkg_resources.py", line 2236, in requires
    dm = self._dep_map
  File "/home/admin/.virtualenvs/py3/lib/python3.4/site-packages/pip/_vendor/pkg_resources.py", line 2429, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/home/admin/.virtualenvs/py3/lib/python3.4/site-packages/pip/_vendor/pkg_resources.py", line 2451, in _compute_dependencies
    for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
  File "/home/admin/.virtualenvs/py3/lib/python3.4/site-packages/pip/_vendor/pkg_resources.py", line 2421, in _parsed_pkg_info
    self._pkg_info = Parser().parsestr(self.get_metadata(self.PKG_INFO))
  File "/usr/local/lib/python3.4/email/parser.py", line 70, in parsestr
    return self.parse(StringIO(text), headersonly=headersonly)
  File "/usr/local/lib/python3.4/email/parser.py", line 60, in parse
    return feedparser.close()
  File "/usr/local/lib/python3.4/email/feedparser.py", line 170, in close
    self._call_parse()
  File "/usr/local/lib/python3.4/email/feedparser.py", line 163, in _call_parse
    self._parse()
  File "/usr/local/lib/python3.4/email/feedparser.py", line 449, in _parsegen
    self._cur.set_payload(EMPTYSTRING.join(lines))
  File "/usr/local/lib/python3.4/email/message.py", line 311, in set_payload
    " payload") from None
TypeError: charset argument must be specified when non-ASCII characters are used in the payload

Storing debug log for failure in /tmp/tmpletnstcp
like image 849
Derek Avatar asked Jan 30 '14 08:01

Derek


1 Answers

This is due to a bug in Python-3.4.0b3. This bug has been fixed 2014-02-07 18:30 (http://bugs.python.org/issue20531).

You can either use Python-3.4.0rc1 or fix it by copying the email package over Python 3.4.0b3 as confirmed in http://bugs.python.org/issue20531#msg210508.

I've just tested it with Python-3.4.0rc1 on squeeze and the package was succesfully installed:

$ pip install django-floppyforms==1.1
Downloading/unpacking django-floppyforms==1.1
  Downloading django_floppyforms-1.1-py33-none-any.whl (51kB): 51kB downloaded
Installing collected packages: django-floppyforms
Successfully installed django-floppyforms
like image 110
wolfrevo Avatar answered Oct 10 '22 10:10

wolfrevo