Raw download and filename character code

Mads Kiilerich mads at kiilerich.com
Mon Feb 7 23:25:26 UTC 2022


Hi

Thanks for the report.

It took a while to reproduce. Many filenames work ok. An exact example 
would have been helpful.

I reproduced the problem (or another similar one) on Linux with a 
Mercurial repository with a file created as
   python -c 'open("\U0001f4a9", "w").write("\U0001f4a9")'

I pushed a fix to the stable branch on 
https://kallithea-scm.org/repos/kallithea/changeset/8993d401575bad2d085158738b09e0bd02c7f135 
. Please let me know if that doesn't solve your problem.

/Mads


On 2/7/22 16:39, toras wrote:
> Hello.
>
> In Kallithea 0.7.0, there was a problem when raw downloading the file 
> in the repository from the web interface.
> It seems to be an error if the filename registered in the repository 
> cannot be encoded with 'latin-1'.
> It's not a big issue, as you can work around the problem by cloning 
> the repository, but I'll report it here.
>
> When an error occurs, the following will be displayed on the browser.
> ----
> Internal Server Error
> The server encountered an unexpected internal server error
> (generated by waitress)
> ----
>
> In addition, the following traceback is output to the console.
> ----
> Traceback (most recent call last):
>   File 
> "/home/kallithea/.local/lib/python3.8/site-packages/waitress/channel.py", 
> line 350, in service
>     task.service()
>   File 
> "/home/kallithea/.local/lib/python3.8/site-packages/waitress/task.py", 
> line 171, in service
>     self.execute()
>   File 
> "/home/kallithea/.local/lib/python3.8/site-packages/waitress/task.py", 
> line 479, in execute
>     self.write(chunk)
>   File 
> "/home/kallithea/.local/lib/python3.8/site-packages/waitress/task.py", 
> line 311, in write
>     rh = self.build_response_header()
>   File 
> "/home/kallithea/.local/lib/python3.8/site-packages/waitress/task.py", 
> line 284, in build_response_header
>     return tobytes(res)
>   File 
> "/home/kallithea/.local/lib/python3.8/site-packages/waitress/compat.py", 
> line 69, in tobytes
>     return bytes(s, "latin-1")
> UnicodeEncodeError: 'latin-1' codec can't encode characters in 
> position 84-85: ordinal not in range(256)
> ----
>
> Thanks
>
> -- 
> toras9000
>
>
> _______________________________________________
> kallithea-general mailing list
> kallithea-general at sfconservancy.org
> https://lists.sfconservancy.org/mailman/listinfo/kallithea-general




More information about the kallithea-general mailing list