yes, spank me, please.

This patch was written to solve this crash :

Traceback (most recent call last): 

  File "/home/darkoneko/pywikipedia/replace.py", line 601, in ? 

    main() 

  File "/home/darkoneko/pywikipedia/replace.py", line 597, in main 

    bot.run() 

  File "/home/darkoneko/pywikipedia/replace.py", line 358, in run 

    page.put(new_text) 

  File "/home/darkoneko/pywikipedia/wikipedia.py", line 1187, in put 

    newtext = ccToolkit.change(newtext) 

  File "/home/darkoneko/pywikipedia/cosmetic_changes.py", line 113, in change 

    text = isbn.hyphenateIsbnNumbers(text) 

  File "/home/darkoneko/pywikipedia/isbn.py", line 1354, in hyphenateIsbnNumbers 

    text = isbnR.sub(_hyphenateIsbnNumber, text) 

  File "/home/darkoneko/pywikipedia/isbn.py", line 1345, in _hyphenateIsbnNumber 

    i = getIsbn(code) 

  File "/home/darkoneko/pywikipedia/isbn.py", line 1336, in getIsbn 

    raise InvalidIsbnException(u'ISBN-13: %s / ISBN-10: %s' % (e13.message, e10.message)) 

AttributeError: InvalidIsbnException instance has no attribute 'message' 


Occurring during a simple replace.py with cosmetic changes enabled

2008/2/12, filnik@svn.wikimedia.org <filnik@svn.wikimedia.org>:
Revision: 5013
Author:   filnik
Date:     2008-02-12 19:17:56 +0000 (Tue, 12 Feb 2008)

Log Message:
-----------
Appling a NicDumZ' patch, blame him if there are problems/bugs ;-)

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

Modified: trunk/pywikipedia/isbn.py
===================================================================
--- trunk/pywikipedia/isbn.py   2008-02-12 15:23:38 UTC (rev 5012)
+++ trunk/pywikipedia/isbn.py   2008-02-12 19:17:56 UTC (rev 5013)
@@ -1333,7 +1333,7 @@
         try:
             i = ISBN10(code)
         except InvalidIsbnException, e10:
-            raise InvalidIsbnException(u'ISBN-13: %s / ISBN-10: %s' % (e13.message, e10.message))
+            raise InvalidIsbnException(u'ISBN-13: %s / ISBN-10: %s' % (e13, e10))
     return i

def _hyphenateIsbnNumber(match):
@@ -1389,7 +1389,7 @@
                 try:
                     getIsbn(code)
                 except InvalidIsbnException, e:
-                    wikipedia.output(e.message)
+                    wikipedia.output(e)

             newText = oldText
             if self.to13:



_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l



--
Nicolas Dumazet — NicDumZ
Deuxième année ENSIMAG.