[Pywikipedia-l] SVN: [5417] trunk/pywikipedia/reflinks.py

nicdumz at svn.wikimedia.org nicdumz at svn.wikimedia.org
Wed May 21 17:07:12 UTC 2008


Revision: 5417
Author:   nicdumz
Date:     2008-05-21 17:07:12 +0000 (Wed, 21 May 2008)

Log Message:
-----------
Removing that httpError log. Turns out that it was a bad idea afterall; I did not find an utility for the logged errors.

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

Modified: trunk/pywikipedia/reflinks.py
===================================================================
--- trunk/pywikipedia/reflinks.py	2008-05-20 21:34:18 UTC (rev 5416)
+++ trunk/pywikipedia/reflinks.py	2008-05-21 17:07:12 UTC (rev 5417)
@@ -258,14 +258,6 @@
         wikipedia.output(u'HTTP error (%s) for %s on %s' 
                           % (err_num, link, pagetitleaslink),
                          toStdout = True)
-        f = codecs.open(
-                wikipedia.config.datafilepath(
-                    'reflinks-httpErrorLog', 
-                    'reflinks-%s-%s.txt' % (self.site.family.name, 
-                                            self.site.lang)),
-                'a', 'utf-8')
-        f.write(u'%s: %s from %s\n' % (err_num, link, pagetitleaslink))
-        f.close()
 
     def getPDFTitle(self, ref, f): 
         wikipedia.output( u'PDF file.' )
@@ -378,7 +370,9 @@
                     wikipedia.output(u'\03{lightred}Bad link\03{default} : %s in %s' % (ref.url, page.aslink()))
                     continue
                 except urllib2.HTTPError, e:
-                    self.httpError(e.code, ref.url, page.aslink())
+                    wikipedia.output(u'HTTP error (%s) for %s on %s' 
+                                        % (e.code, ref.url, page.aslink()),
+                                    toStdout = True)
                     if e.code == 410: # 410 Gone, indicates that the resource has been purposely removed
                         repl = ref.refDead()
                         new_text = new_text.replace(match.group(), repl)





More information about the Pywikipedia-l mailing list