Conversation
…racters. I don't remember exactly what the problem is, but I believe it had to do something with how the = operator and string objects don't play perfectly well together when it comes to unicode and need to be handled delicately. This fix is backported from a dead pull request from 2022 that I half remember working on.
Emersont1
left a comment
There was a problem hiding this comment.
The code should be using pathlib, it makes it easier to use throughout the codebase
Should be good now |
|
I used this branch today ( When downloading: When restart downloading (so it will use local files?):
|
I need to test this, but I think I understand what's going on here, it's trying to call rename on an object that still purely a string and not a |
Pertains to issue #74
This PR fixes a bug that occurs when downloading files that use UTF-8 characters, the characters they're meant to represent will get "smeared" into a different encoding format, the root cause I believe is this line in utils.py:
#filename_re = re.search(r'filename="(.+)"', cd)What's going on here has something to do either with re.search returning an ascii formated byte string, or a weird consequence of passing the string through the assignment operator. My memory is a bit hazy on the specifics. in addition to fixing that issue the directory handling code was improved in other sections, using existing functions to replace blocks of code and making the variable names slightly more readable.
Also apologies for the weird duplicate commits on the branch, I'm a little rusty with git.