-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
pathlib passed to tornado StaticFileHandler when it expects str #538
Comments
@dukrat, could you try Mopidy-Local also? I'd imagine this suffers from the same problem. |
@kingosticks Do you think there's anything Mopidy core can do differently here? And yes, it seems Mopidy-Local is passing two pathlib objects to Tornado here: https://github.com/mopidy/mopidy-local/blob/master/mopidy_local/__init__.py#L53-L54 |
Mopidy-Local is not affected by this for some reason. Tornado seems to handle the conversion in some (most?) situations. I think it is because self.path is being set directly during initialize of ReactRouterHandler. Furthermore, the proposed fix causes another error but this seems to be fine
|
tornado's StaticFileHandler expects str but it is being passed pathlib. This works most of the time, but when os.path.sep is not "/" (like on Windows) it causes this error:
EDIT: This doesn't work, see #538 (comment)
I believe wrapping what is passed in str is sufficient to fix this and will not hurt anything. i.e. changing the end of
__init__.py
toLet me know if you want a PR of that.
The text was updated successfully, but these errors were encountered: