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

Fix obvious type error in guessMimetype #42

Open
wants to merge 4 commits into
base: py3
Choose a base branch
from

Conversation

debbiedub
Copy link
Contributor

I consider the fact that guessMimetype returns a tuple on some inputs and a str on other an obvious mistake. Where the result of guessMimetype is used, it looks like a tuple is not expected.

Also, I have verified that mimetypes.guess_type handles this case and returns application/x-tar (and bzip2) already in python 3.3.

This pull request depends on #40.

The change means that now calling mimetypes.guess_type is done with
the argument type that mypy requires.
It seems that everywhere the node.guessMimetype is used, it is
expected to return a str and not a tuple.

Also, mimetypes.guess_type can handle the .tar.bz2 suffix.
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

Successfully merging this pull request may close these issues.

1 participant