[Pywikipedia-l] SVN: [4955] trunk/pywikipedia/wikipedia.py

filnik at svn.wikimedia.org filnik at svn.wikimedia.org
Thu Jan 31 16:15:16 UTC 2008


Revision: 4955
Author:   filnik
Date:     2008-01-31 16:15:16 +0000 (Thu, 31 Jan 2008)

Log Message:
-----------
Forgot: I had another fix to do, the pid issue continues, fixing as already fixed above

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

Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py	2008-01-31 16:10:17 UTC (rev 4954)
+++ trunk/pywikipedia/wikipedia.py	2008-01-31 16:15:16 UTC (rev 4955)
@@ -2773,14 +2773,10 @@
                     line = line.split(' ')
                     pid = int(line[0])
                     ptime = int(line[1].split('.')[0])
-                except (IndexError, ValueError):
-                    # I go a lot of crontab errors because line is not a number.
-                    # Better to prevent that. If you find out the error, feel free
-                    # to fix it better.
-                    pid = 1
-                    ptime = time.time()
-                if now - ptime <= self.releasepid and pid != self.pid:
-                    processes[pid] = ptime
+                    if now - ptime <= self.releasepid and pid != self.pid:
+                        processes[pid] = ptime                    
+                except (IndexError,ValueError):
+                    pass    # Sometimes the file gets corrupted - ignore that line
         f = open(self.logfn(), 'w')
         for p in processes.keys():
             f.write(str(p)+' '+str(processes[p])+'\n')





More information about the Pywikipedia-l mailing list