Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError in 1.3 python version #11

Open
GoogleCodeExporter opened this issue May 13, 2015 · 3 comments
Open

ValueError in 1.3 python version #11

GoogleCodeExporter opened this issue May 13, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
In [3]: mimeparse.parse_mime_type("text/html, image/gif, image/jpeg, *; q=.2, 
*/*; q=.2")

What is the expected output? What do you see instead?

In [3]: mimeparse.parse_mime_type("text/html, image/gif, image/jpeg, *; q=.2, 
*/*; q=.2")
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/tmp/<ipython console> in <module>()
/tmp/mimeparse.py in parse_mime_type(mime_type)
     36     # Turn it into a legal wildcard.
     37     if full_type == '*': full_type = '*/*'
---> 38     (type, subtype) = full_type.split("/")
     39     return (type.strip(), subtype.strip(), params)
     40 
ValueError: too many values to unpack

What version of the product are you using? On what operating system?
1.3

Please provide any additional information below.
https://bitbucket.org/benoitc/django-authopenid/issue/54/type-subtype-parts-0-sp
lit-valueerror-too#comment-483268

Original issue reported on code.google.com by slav0n...@gmail.com on 20 May 2011 at 10:08

@GoogleCodeExporter
Copy link
Author

Yup, also: 
'*/*,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,image/png,;q
=0.5, application/vnd.nokia.headwrapper'

Original comment by do...@dev.si on 21 Aug 2012 at 6:46

@GoogleCodeExporter
Copy link
Author

Specifically, this breaks the parser: */*,text/xml

Original comment by do...@dev.si on 21 Aug 2012 at 7:07

@GoogleCodeExporter
Copy link
Author

parse_mime_type is for parsing a *single* mime type (and optional quality 
parameters), not a list of them. 

Original comment by pjimen...@gmail.com on 9 Oct 2013 at 1:13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant