Open wh-timme opened 6 days ago
Anyway, you shouldn't use chinese path. 不建议使用中文目录,这会出现什么问题,我也不知道。
How are CJK pathnames handled nowadays? Unicode or some other weirdness? To my knowledge, Sanic and Python ought to handle Unicode conversions properly, if the browser supplies the path in UTF-8.
To triage, could you print request.url_bytes
and request.url
, and try if you can open the file with Python open(...), and if so, how do you need to write the CJK characters in that.
How are CJK pathnames handled nowadays? Unicode or some other weirdness? To my knowledge, Sanic and Python ought to handle Unicode conversions properly, if the browser supplies the path in UTF-8.
It is usually URL encoding. example website
Is there an existing issue for this?
Describe the bug
file path: ./public/hello/你好/index.html will return 404 when accessing to http://serving_domain/hello/你好
Code snippet
app.static('/', './public', index='index.html')
Expected Behavior
redirect to ./public/hello/你好/index.html instead of 404 page
How do you run Sanic?
As a script (
app.run
orSanic.serve
)Operating System
Linux
Sanic Version
24.6.0
Additional context
No response