Skip to content
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

Fix #70 #77

Merged
merged 1 commit into from
May 28, 2021
Merged

Fix #70 #77

merged 1 commit into from
May 28, 2021

Conversation

uptoratlen
Copy link
Contributor

@uptoratlen uptoratlen commented May 28, 2021

Hi,
I found your WA Reader and found it very useful already. I noticed Issue #70, as I saw it during the upload of a chat with ~ 4000 lines. But after investigating on which line it actually breaks, I found that in that chat someone posted a joke of binary text.
If you eg. create a chat file like:
...
13/10/2017, 12:12 a.m. - The Joker: Let's not BLOW this out of proportion.
13/10/2017, 12:12 a.m. - Gambol: You think you can steal from us and just walk away?
00001100110000111100010101111111000001111000
13/10/2017, 12:12 a.m. - The Joker: Yeah.
...
(yes, there is a line break starting the new line with only text or here numbers)
The dateutil.parser parser tries to find some date in it and fails on the message: OverflowError: Python int too large to convert to C long in
Sample code to prove:
from dateutil.parser import parse dt = parse('Sun, 05/12/1999, 12:30PM') print(dt.date()) dt = parse('00001100110000111100010101111111000001111000') print(dt.date())

I added a line to the utils.py to catch this error as well. In the Issue #70 you already mentioned some weird chars. Maybe this happens also in case of some unicode chars?

regards

parsing aline with eg. only numbers like '00001100110000111100010101111111000001111000' causes
exception: OverflowError: Python int too large to convert to C long in
dateutil.parser
@prabhakar267 prabhakar267 changed the title Fix for Issue:#70 Fix #70 May 28, 2021
@prabhakar267 prabhakar267 merged commit 8e2a7a1 into prabhakar267:master May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants