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

Python 2.7.7 on Windows returns Unicode from mimetypes.guess_type #1360

Closed
mcdonc opened this issue Jun 6, 2014 · 8 comments
Closed

Python 2.7.7 on Windows returns Unicode from mimetypes.guess_type #1360

mcdonc opened this issue Jun 6, 2014 · 8 comments
Milestone

Comments

@mcdonc
Copy link
Member

mcdonc commented Jun 6, 2014

This breaks static file serving under Pyramid, where it uses the guess_type API to determine the file type. See https://groups.google.com/forum/#!topic/pylons-devel/bq8XiKlGgv0 for more information.

@mmerickel
Copy link
Member

It seems to me that this should be a webob bug with properly encoding the content_type property.

@mcdonc
Copy link
Member Author

mcdonc commented Jun 6, 2014

Yeah, it's not, however, because we use mimetypes.guess_type directly in FileResponse's __init__.

@mcdonc mcdonc closed this as completed in 3260215 Jun 6, 2014
@mmerickel
Copy link
Member

But it is being passed into the super constructor.

mcdonc added a commit that referenced this issue Jun 6, 2014
@mcdonc
Copy link
Member Author

mcdonc commented Jun 6, 2014

Yeah, I guess I was thinking about it totally sucking that the Paste http server silently cast Unicode to str in headers and then when you switched servers it would start to fail but I suppose we could change webob to do the casting, because it wouldn't have the same fails-sometimes-doesnt-fail-other-times behavior.

@mcdonc
Copy link
Member Author

mcdonc commented Jun 6, 2014

In any case, I think this commit is still fine, because it means we needn't make someone rely on the latest-greatest WebOb to get this workaround.

@georgevreilly
Copy link

Please release an update on PyPI. We are totally broken when developing on Windows with Pyramid 1.5.1.

@mcdonc
Copy link
Member Author

mcdonc commented Jun 19, 2014

If I were you, I'd revert to Python 2.7.6 in the meantime, it's unclear when the next Pyramid release will be.

@mmerickel
Copy link
Member

I'll investigate pushing a bugfix release in the next day or so.

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

No branches or pull requests

3 participants