Revision: 8703 Author: xqt Date: 2010-11-06 19:13:28 +0000 (Sat, 06 Nov 2010) Log Message: ----------- global test for unicode bug #3081100 enable removing hi-interwikis if code is not affected (follow up for r8607, r8634, r8687)
Modified Paths: -------------- trunk/pywikipedia/interwiki.py trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/interwiki.py =================================================================== --- trunk/pywikipedia/interwiki.py 2010-11-06 13:20:55 UTC (rev 8702) +++ trunk/pywikipedia/interwiki.py 2010-11-06 19:13:28 UTC (rev 8703) @@ -1867,7 +1867,7 @@ if not globalvar.cleanup or \ rmPage.aslink(forceInterwiki=True) not in globalvar.remove or \ rmPage.site().sitename() == 'wikipedia:hi' and \ - page.site().sitename() != 'wikipedia:de': #work-arround for bug #3081100 (do not remove hi-pages) + pywikibot.unicode_error: #work-arround for bug #3081100 (do not remove hi-pages) new[rmsite] = rmPage pywikibot.output( u"WARNING: %s is either deleted or has a mismatching disambiguation state." @@ -2566,17 +2566,6 @@ globalvar=Global()
if __name__ == "__main__": - # TEST for bug #3081100 - if not __import__('unicodedata').normalize('NFC', u'\u092e\u093e\u0930\u094d\u0915 \u091c\u093c\u0941\u0915\u0947\u0930\u092c\u0930\u094d\u0917') == u'\u092e\u093e\u0930\u094d\u0915 \u091c\u093c\u0941\u0915\u0947\u0930\u092c\u0930\u094d\u0917': - pywikibot.output(""" - -================================================================================ -\03{lightyellow}WARNING:\03{lightred} your python version might trigger issue #3081100\03{default} -See https://sourceforge.net/tracker/index.php?func=detail&aid=3081100&gr... for more information. -\03{lightyellow}Use an older python version (<2.6.5) if you are running on wikimedia sites!\03{default} -================================================================================ - -""") try: main() finally:
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2010-11-06 13:20:55 UTC (rev 8702) +++ trunk/pywikipedia/wikipedia.py 2010-11-06 19:13:28 UTC (rev 8703) @@ -7462,6 +7462,18 @@ # the argument is not global. Let the specific bot script care # about it. nonGlobalArgs.append(arg) + + # TEST for bug #3081100 + if unicode_error and (default_code == 'hi' or moduleName=='interwiki'): + output(""" + +================================================================================ +\03{lightyellow}WARNING:\03{lightred} your python version might trigger issue #3081100\03{default} +See https://sourceforge.net/tracker/index.php?func=detail&aid=3081100&gr... for more information. +\03{lightyellow}Use an older python version (<2.6.5) if you are running on wikimedia sites!\03{default} +================================================================================ + +""") if verbose: output(u'Pywikipediabot %s' % (version.getversion())) output(u'Python %s' % (sys.version)) @@ -7478,6 +7490,14 @@ verbose = 0 debug = False
+# TEST for bug #3081100 +unicode_error = __import__('unicodedata').normalize( + 'NFC', + u'\u092e\u093e\u0930\u094d\u0915 \u091c\u093c\u0941\u0915\u0947\u0930\u092c\u0930\u094d\u0917' + ) != u'\u092e\u093e\u0930\u094d\u0915 \u091c\u093c\u0941\u0915\u0947\u0930\u092c\u0930\u094d\u0917' +if unicode_error: + print u'unicode test: triggers problem #3081100' + default_family = config.family default_code = config.mylang logfile = None
pywikipedia-svn@lists.wikimedia.org