Tags

Tuesday, December 20, 2011

[SOLVED] TypeError: structseq() takes at least 1 argument (0 given)

Problem: 

Copying and pasting a Python datastructure into an interpreter or script throws an exception:

Error message:

TypeError: structseq() takes at least 1 argument (0 given)

Root cause: 
The difference in how time.struct_time is presented and instantiated.



Fix: 

Try this
time.struct_time((2011, 12, 20, 15, 29, 44, 1, 354, -1))

instead of this
time.struct_time(tm_year=2011, tm_mon=12, tm_mday=20, tm_hour=15, tm_min=29, tm_sec=44, tm_wday=1, tm_yday=354, tm_isdst=-1)


No comments: