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

29 February Issue. #51

Closed
Fjsmoreira opened this issue Jan 5, 2020 · 3 comments
Closed

29 February Issue. #51

Fjsmoreira opened this issue Jan 5, 2020 · 3 comments
Assignees
Labels
bug Something isn't working question Further information is requested
Milestone

Comments

@Fjsmoreira
Copy link

When the birthday date is the 29 of February the toll will fail with a fail to parse message

[2020-01-05 21:20:36,777] fb2cal ERROR (parse_birthday_day_month) Failed to parse birthday day/month. Parse failed with tooltip_content: " (2/29)", locale: "en_US". Day name "2/29" is not in the offset dict {'monday': 1, 'tuesday': 2, 'wednesday': 3, 'thursday': 4, 'friday': 5, 'saturday': 6, 'sunday': 7}

I'm no good with Python to help you out with this but take a look at
https://stackoverflow.com/questions/44327109/sorting-a-list-of-string-dates-with-no-year-but-with-29th-feb

Keep the good work!

@mobeigi mobeigi added the question Further information is requested label Jan 6, 2020
@mobeigi
Copy link
Owner

mobeigi commented Jan 6, 2020

Can you enable debug logging and attach the log? (see Troubleshooting in readme):

@Fjsmoreira
Copy link
Author

How i fix it in my case was by adding:
'en_US': '%Y/%m/%d',
and
parsed_date = datetime.strptime('1904/' + birthday_date_str , locale_date_format_mapping[user_locale])

Debug:

`
[2020-01-08 12:58:30,672] fb2cal INFO () Starting fb2cal v1.0.3 (Production) [https://git.io/fjMwr]
[2020-01-08 12:58:30,673] fb2cal INFO () This project is released under the GPLv3 license.
[2020-01-08 12:58:30,675] fb2cal INFO (main) Attemping to parse config file config.ini...
[2020-01-08 12:58:30,681] fb2cal INFO (main) Config successfully loaded.
[2020-01-08 12:58:30,683] fb2cal INFO (main) Logging level set to: DEBUG
[2020-01-08 12:58:30,683] fb2cal INFO (main) Attemping to authenticate with Facebook...
[2020-01-08 12:58:30,692] urllib3.connectionpool DEBUG (_new_conn) Starting new HTTP connection (1): www.facebook.com:80
[2020-01-08 12:58:30,735] urllib3.connectionpool DEBUG (_make_request) http://www.facebook.com:80 "GET /login.php HTTP/1.1" 302 0
[2020-01-08 12:58:30,741] urllib3.connectionpool DEBUG (_new_conn) Starting new HTTPS connection (1): www.facebook.com:443
[2020-01-08 12:58:30,929] urllib3.connectionpool DEBUG (_make_request) https://www.facebook.com:443 "GET /login.php HTTP/1.1" 200 None
[2020-01-08 12:58:30,994] urllib3.connectionpool DEBUG (_make_request) http://www.facebook.com:80 "GET /login.php HTTP/1.1" 302 0
[2020-01-08 12:58:31,258] urllib3.connectionpool DEBUG (_make_request) https://www.facebook.com:443 "GET /login.php HTTP/1.1" 200 None
[2020-01-08 12:58:33,885] urllib3.connectionpool DEBUG (_make_request) https://www.facebook.com:443 "POST /login/device-based/regular/login/?login_attempt=1&lwv=100 HTTP/1.1" 302 0
[2020-01-08 12:58:34,227] urllib3.connectionpool DEBUG (_make_request) https://www.facebook.com:443 "GET / HTTP/1.1" 200 None
[2020-01-08 12:58:38,048] fb2cal INFO (main) Successfully authenticated with Facebook.
[2020-01-08 12:58:38,063] fb2cal INFO (main) Fetching all Birthdays via async endpoint...
[2020-01-08 12:58:38,068] fb2cal DEBUG (get_next_12_month_epoch_timestamps) Epoch timestamps are: [1577865600, 1580544000, 1583049600, 1585724400, 1588316400, 1590994800, 1593586800, 1596265200, 1598943600, 1601535600, 1604214000, 1606809600]

[2020-01-08 12:59:04,543] fb2cal INFO (get_async_birthdays) Processing birthdays for month February.

[2020-01-08 12:59:18,275] fb2cal ERROR (parse_birthday_day_month) Failed to parse birthday day/month. Parse failed with tooltip_content: "(2/29)", locale: "en_US". Day name "2/29" is not in the offset dict {'thursday': 1, 'friday': 2, 'saturday': 3, 'sunday': 4, 'monday': 5, 'tuesday': 6, 'wednesday': 7}
`
I've removed data that I don't believe is needed for the debug and so on.

@mobeigi mobeigi added the bug Something isn't working label Jan 8, 2020
@mobeigi
Copy link
Owner

mobeigi commented Jan 8, 2020

Yeah I think that is a good solution. To hardcode the year as a year which contains the 29th of Feb.

@mobeigi mobeigi added this to the 1.0.4 milestone Jan 12, 2020
@mobeigi mobeigi self-assigned this Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants