[Pywikipedia-l] SVN: [5469] trunk/pywikipedia/diskcache.py

nicdumz at svn.wikimedia.org nicdumz at svn.wikimedia.org
Fri May 30 05:46:52 UTC 2008


Revision: 5469
Author:   nicdumz
Date:     2008-05-30 05:46:52 +0000 (Fri, 30 May 2008)

Log Message:
-----------
Bug #1978787, "diskcache.py sometimes requests missing attribute 'SEEK_CUR'". 

I could not reproduce that bug, fix found here : http://mail.python.org/pipermail/python-list/2006-March/375280.html

Modified Paths:
--------------
    trunk/pywikipedia/diskcache.py

Modified: trunk/pywikipedia/diskcache.py
===================================================================
--- trunk/pywikipedia/diskcache.py	2008-05-30 05:37:12 UTC (rev 5468)
+++ trunk/pywikipedia/diskcache.py	2008-05-30 05:46:52 UTC (rev 5469)
@@ -1,5 +1,10 @@
+import random
 import os
-import random
+# http://mail.python.org/pipermail/python-list/2006-March/375280.html
+try:
+     os.SEEK_SET
+except AttributeError:
+     os.SEEK_SET, os.SEEK_CUR, os.SEEK_END = range(3)
 
 ## Dictionary like disk caching module
 ## (c) Copyright 2008 - Bryan Tong Minh / The Pywikipediabot team





More information about the Pywikipedia-l mailing list