-
Notifications
You must be signed in to change notification settings - Fork 6
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
Error when attempting to run run clippy.py #1
Comments
Hi, I'd like to help get this fixed for you. Would you mind sharing your "My Clippings.txt" file to help me replicate the issue? Based on this I'm guessing your file is encoded in a weird format the program doesn't expect. One simple test could be to copy and paste the contents of your file (open it in a notepad) into a new file which you then provide to Let me know how it goes. |
Hi dangbert, I tried paste the contents into a new .txt file but that didnt seem to resolve the issue. Here is a copy of my clippings.txt, perhaps there are some characters within the file that are causing the issue. I wasnt too sure from the error message which particular characters/lines to look at though. Thanks in advance |
Interestingly when I downloaded your file I didn't run into that encoding issue (although I'm using Ubuntu 20 and Python 3.8.5). Either uploading the file to github changed its encoding, or this particular issue has something to do with our python versions differing or running on windows vs ubuntu. However, when I ran clippy.py on your file, I ran into another issue which stems from something I've already suspected: some different versions of Kindle format "My Clippings.txt" in slightly different ways. Here you can see the difference between a highlight in my file (top) and yours (bottom): Specifically the problem is that your file lists both a page number and a location range for every highlight, currently my program fails to parse your file as it expects either just a page number to be provided or a location range instead but not both. I built this program originally because the existing alternatives I tried didn't parse my Kindle's "My Clippings.txt" file correctly. The "My Clippings.txt" format is not great, and the fact that it seems to vary across different Kindle versions and language settings is a pain when it comes to parsing it. But it's my goal to make clippy-kindle robust to different versions of kindles (and eventually to the language setting used as well). I can try to spend some time this week reworking the parser to support your file format, and then we can further investigate the encoding issue. Sorry for the troubles :/ |
I've had issues with this as well. Normal:
Very rare, short or blank highlights:
Rare:
If book has pages (not all publishers seem to have to the trouble of adding pages):
Something else to note is that it seems vary between "Your highlight at location" and "Your highlight on page" |
The parsing issues related to this issue are addressed and fixed now after #5 and c53fec7, thank you @AmmarShaqeel for the contribution! However this doesn't address the original encoding problem in the OP. I haven't experienced this issue on Ubuntu 20 with this "My Clippings.txt" file, but I can try to replicate by running this in Windows... Edit: I'm also experiencing the same "charmap" codec error when running in windows (windows 8, python 3.6.5) Update: Nov 10, 2022:
|
TODO: add chardet to requirements.txt, test in linux
Tried running the python script and passed in the .txt file as instructed on the git page & YT video however, I keep encountering this error:
Please let me know if there's anything that I can do to resolve the issue
Additional info:
Python 3.91
Kindle PW
Windows 10
The text was updated successfully, but these errors were encountered: