-
-
Notifications
You must be signed in to change notification settings - Fork 217
Limit the length of UTF-8 filenames. #1645
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
Conversation
sanitize_filename() only counts the number of characters and not the multi-byte UTF-8 sequences. This patch converts the string to an array of UTF-8 bytes and then removes each multi-byte sequence until the length is below the limit.
|
<https://github.com/auouymous> @auouymous
[sanitize_filename() only counts the number of characters and not the multi-byte UTF-8 sequences. This patch converts the string to an array of UTF-8 bytes and then removes each multi-byte sequence until the length is below the limit.]
Will this fix be available in the next mac artifact?
Von: auouymous ***@***.***>
Gesendet: Dienstag, 30. Juli 2024 01:41
An: gpodder/gpodder ***@***.***>
Cc: Subscribed ***@***.***>
Betreff: [gpodder/gpodder] Limit the length of UTF-8 filenames. (PR #1645)
sanitize_filename() only counts the number of characters and not the multi-byte UTF-8 sequences. This patch converts the string to an array of UTF-8 bytes and then removes each multi-byte sequence until the length is below the limit.
…_____
You can view, comment on, or merge this pull request online at:
#1645
Commit Summary
* f34d828 <f34d828> Limit the length of UTF-8 filenames.
File Changes
(1 <https://github.com/gpodder/gpodder/pull/1645/files> file)
* M src/gpodder/util.py <https://github.com/gpodder/gpodder/pull/1645/files#diff-982d14a69df560682559dcaf16d344d0371be4f1fda62cb2eead67b47feea109> (14)
Patch Links:
* https://github.com/gpodder/gpodder/pull/1645.patch
* https://github.com/gpodder/gpodder/pull/1645.diff
—
Reply to this email directly, view it on GitHub <#1645> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACNRICWXRB7VH7WMORTQ32DZO3HJFAVCNFSM6AAAAABLVHTTLGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQZTMNJZHEZTOMY> .
You are receiving this because you are subscribed to this thread. <https://github.com/notifications/beacon/ACNRICR5FEEGXVPPIYJSMGTZO3HJFA5CNFSM6AAAAABLVHTTLGWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHJCO4OJU.gif> Message ID: ***@***.*** ***@***.***> >
|
It will be merged into gpodder in a few days assuming no one finds issues with it. I have been using it without problem, and if you want to test it, download http://borg.qzx.com/files/gpodder/util.py and overwrite the The Mac build, like the Windows build, is currently broken. The simplest option is to require macos-14, and everyone on 12 and 13 would be left out. The other option is to move from CircleCI to Github, but that eliminates public access to the artifacts. I should have some time in a couple days to work on it some more, and hopefully it just builds without needing either of those options. |
|
Thanks, I downloaded and found it on mac. It’s located under
/contents/resources/lib/python3.11/side-packages/gpodder/
I’ll test it and will let you know :-)
Von: auouymous ***@***.***>
Gesendet: Mittwoch, 31. Juli 2024 23:44
An: gpodder/gpodder ***@***.***>
Cc: computerfreak105 ***@***.***>; Comment ***@***.***>
Betreff: Re: [gpodder/gpodder] Limit the length of UTF-8 filenames. (PR #1645)
Will this fix be available in the next mac artifact?
It will be merged into gpodder in a few days assuming no one finds issues with it. I have been using it without problem, and if you want to test it, download http://borg.qzx.com/files/gpodder/util.py and overwrite the uitl.py file with it. I don't know where it is on Mac but it is at /home/appveyor/_gpodder_build_root/mingw32/lib/python3.11/site-packages/gpodder/util.py in the Windows build.
The Mac build, like the Windows build, is currently broken. The simplest option is to require macos-14, and everyone on 12 and 13 would be left out. The other option is to move from CircleCI to Github, but that eliminates public access to the artifacts. I should have some time in a couple days to work on it some more, and hopefully it just builds without needing either of those options.
—
Reply to this email directly, view it on GitHub <#1645 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACNRICWMOOL2RGHJ44VL6ADZPFLB3AVCNFSM6AAAAABLVHTTLGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRRGUYTEMJZGI> .
You are receiving this because you commented. <https://github.com/notifications/beacon/ACNRICV6LY7DVDIZNIKCYNDZPFLB3A5CNFSM6AAAAABLVHTTLGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUGZPYAA.gif> Message ID: ***@***.***>
|
|
I let Gpodder run for a few hours and I haven’t gotten any errors because of too long filenames. Your patch is working great, have many thanks!
Von: auouymous ***@***.***>
Gesendet: Mittwoch, 31. Juli 2024 23:44
An: gpodder/gpodder ***@***.***>
Cc: computerfreak105 ***@***.***>; Comment ***@***.***>
Betreff: Re: [gpodder/gpodder] Limit the length of UTF-8 filenames. (PR #1645)
Will this fix be available in the next mac artifact?
It will be merged into gpodder in a few days assuming no one finds issues with it. I have been using it without problem, and if you want to test it, download http://borg.qzx.com/files/gpodder/util.py and overwrite the uitl.py file with it. I don't know where it is on Mac but it is at /home/appveyor/_gpodder_build_root/mingw32/lib/python3.11/site-packages/gpodder/util.py in the Windows build.
The Mac build, like the Windows build, is currently broken. The simplest option is to require macos-14, and everyone on 12 and 13 would be left out. The other option is to move from CircleCI to Github, but that eliminates public access to the artifacts. I should have some time in a couple days to work on it some more, and hopefully it just builds without needing either of those options.
—
Reply to this email directly, view it on GitHub <#1645 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACNRICWMOOL2RGHJ44VL6ADZPFLB3AVCNFSM6AAAAABLVHTTLGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRRGUYTEMJZGI> .
You are receiving this because you commented. <https://github.com/notifications/beacon/ACNRICV6LY7DVDIZNIKCYNDZPFLB3A5CNFSM6AAAAABLVHTTLGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUGZPYAA.gif> Message ID: ***@***.*** ***@***.***> >
|
sanitize_filename() only counts the number of characters and not the multi-byte UTF-8 sequences. This patch converts the string to an array of UTF-8 bytes and then removes each multi-byte sequence until the length is below the limit.