homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author scape
Recipients scape
Date 2012年01月19日.14:14:15
SpamBayes Score 1.017368e-05
Marked as misclassified No
Message-id <1326982457.08.0.645011585605.issue13825@psf.upfronthosting.co.za>
In-reply-to
Content
I believe I am having a similar issue to this: http://bugs.python.org/issue7150
I am in the middle of programming a quick script and now I cannot seem to get beyond this issue; as it is printing up the expiration times from the AD user listings (many of which print 1601 year) it finally fails after the same user account, I have compared accounts and the expiration is the same as other accounts in AD: which is set to (never)
any ideas of what's going on here and how I can bypass this error?
error report: 
Traceback (most recent call last):
... line 14, in <module>
 print user.name + ": " + str(user.accountExpires)
 File "C:\Python27\lib\site-packages\active_directory.py", line 425, in __getattr__
 self._delegate_map[name] = converter (attr)
 File "C:\Python27\lib\site-packages\active_directory.py", line 335, in convert_to_datetime
 return ad_time_to_datetime (item)
 File "C:\Python27\lib\site-packages\active_directory.py", line 319, in ad_time_to_datetime
 return BASE_TIME + delta
OverflowError: date value out of range
code:
import active_directory
from datetime import datetime,timedelta
##check AD for account expirations
users = active_directory.AD_object ("LDAP://ou=administration,dc=domain,dc=com")
for user in users.search (objectCategory='Person'):
 dn = user.distinguishedName
 dn = dn.encode("utf-8") #for the occasional apostrophe
 if "Adjuncts" in str(dn):
 print user.name + ": " + str(user.accountExpires)
print "done"
example output:
CN=John Hancock: 1601年01月01日 00:00:00
CN=Jane Smith: 1601年01月01日 00:00:00
...
History
Date User Action Args
2012年01月19日 14:14:17scapesetrecipients: + scape
2012年01月19日 14:14:17scapesetmessageid: <1326982457.08.0.645011585605.issue13825@psf.upfronthosting.co.za>
2012年01月19日 14:14:16scapelinkissue13825 messages
2012年01月19日 14:14:15scapecreate

AltStyle によって変換されたページ (->オリジナル) /