You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works when I use pip but not with UV. I tried to look for a similar issue but couldn't find one. If this is a duplicate, I apologise. Would you be so kind to give me a link to the issue where the solution for this is discussed? Thanks!
Can you upload an exact copy of your requirements.txt as an attachment? My hunch is that it's UTF-16 or otherwise contains invalid UTF-8 based on the error message you're getting.
That is the one, I installed the packages myself using uv and then i created a requirements file so other people can run my program on their computers as well
Activity
BurntSushi commentedon Mar 7, 2024
Can you upload an exact copy of your
requirements.txtas an attachment? My hunch is that it's UTF-16 or otherwise contains invalid UTF-8 based on the error message you're getting.yashranjan1 commentedon Mar 7, 2024
My requirements file -> requirements.txt
I had uv write this out for me using the command:
BurntSushi commentedon Mar 7, 2024
Can you share the original
requirements.txt? The one that produced the error in the original issue.yashranjan1 commentedon Mar 7, 2024
That is the one, I installed the packages myself using uv and then i created a requirements file so other people can run my program on their computers as well
notatallshaw commentedon Mar 7, 2024
No idea on the cause, but FYI this file is "UTF-16 LE BOM" , not "UTF-8".
BurntSushi commentedon Mar 7, 2024
Oh interesting, okay, thank you. Sorry, I misunderstood. I can actually reproduce the problem:
So the file is indeed UTF-16. Specifically, it starts with a
0xFF 0xFEbyte order mark, which indicates UTF-16 little endian:And
xxdconfirms:When writing to a console, Rust will write data as UTF-16. Since you're piping the output via stdout, this is indeed the code path being exercised.
So I think the solution to this is for
uvto transparently accept UTF-16 encoded files in addition to UTF-8 encoded files.yashranjan1 commentedon Mar 7, 2024
Thanks for the explanation and the prompt response Please do tag me on the PR for fixing this issue!
zanieb commentedon Mar 7, 2024
@BurntSushi we previously said we would not change this behavior:
We could still change our mind though.
uv-fs: transparently support reading UTF-16 files