kas/doomsday
1
0
Fork
You've already forked doomsday
0

Checking MINYEAR..MAXYEAR is insufficient on Python 2 #3

Closed
opened 2015年08月15日 14:52:24 +02:00 by kseistrup · 0 comments
kseistrup commented 2015年08月15日 14:52:24 +02:00 (Migrated from github.com)
Copy link

Python 3:

$ python3 doomsday 0
Year not in range 1..9999
$ python3 doomsday 1
Wednesday

Python 2:

$ python2 doomsday 1
Traceback (most recent call last):
 File "doomsday", line 137, in <module>
 sys.exit(main(os.path.basename(sys.argv[0])))
 File "doomsday", line 132, in main
 print(doomsday(args.YEAR).strftime(args.format.strip('"\'')))
ValueError: year=1 is before 1900; the datetime strftime() methods require year >= 1900
**Python 3:** ``` sh $ python3 doomsday 0 Year not in range 1..9999 $ python3 doomsday 1 Wednesday ``` **Python 2:** ``` pytb $ python2 doomsday 1 Traceback (most recent call last): File "doomsday", line 137, in <module> sys.exit(main(os.path.basename(sys.argv[0]))) File "doomsday", line 132, in main print(doomsday(args.YEAR).strftime(args.format.strip('"\''))) ValueError: year=1 is before 1900; the datetime strftime() methods require year >= 1900 ```
Sign in to join this conversation.
No Branch/Tag specified
master
No results found.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kas/doomsday#3
Reference in a new issue
kas/doomsday
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?