Re: [pylons-discuss] Serving a Single File from the Root

2020-03-14 Thread Sydo Luciani
Adding 'rb' parameter to open method fixed the issue. Thank you On Sat, 14 Mar 2020 at 14:50, Michael Merickel wrote: > The unicode issue is just due to opening the file in unicode mode (the > default in python 3) and then setting the result to body (which expects > bytes). Modify the open

Re: [pylons-discuss] Serving a Single File from the Root

2020-03-14 Thread Michael Merickel
The unicode issue is just due to opening the file in unicode mode (the default in python 3) and then setting the result to body (which expects bytes). Modify the open calls to use open(..., 'rb') and it should work. > On Mar 14, 2020, at 11:16, Sydo Luciani wrote: > > Procedure to serve

[pylons-discuss] Serving a Single File from the Root

2020-03-14 Thread Sydo Luciani
Procedure to serve favicon.ico from root: https://docs.pylonsproject.org/projects/pyramid-cookbook/en/latest/static_assets/serving-files.html#serving-a-single-file-from-the-root Throws error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9e in position 34: invalid start byte Apparently