This function wants a str (which represents a path) and returns a str.
We normalize input to str and output to bytes.
Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG9310037f0636: py3: pass str and return bytes from mimetypes.guess_type()
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
+ mt = pycompat.sysbytes(
+ mimetypes.guess_type(pycompat.fsdecode(f))[0]
+ or 'application/octet-stream')
The default value has to be either r'' prefixed or moved out of the
sysbytes().