[Pywikipedia-l] [ pywikipediabot-Bugs-1999787 ] InvocationException in interwiki_graph.py

SourceForge.net noreply at sourceforge.net
Mon Jan 19 02:48:51 UTC 2009


Bugs item #1999787, was opened at 2008-06-22 06:27
Message generated for change (Comment added) made by mpupat
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1999787&group_id=93107

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Alex S.H. Lin (lin4h)
Assigned to: Nobody/Anonymous (nobody)
Summary: InvocationException in interwiki_graph.py

Initial Comment:
Version:
Microsoft Windows XP Professional with SP3
Pywikipedia [http] trunk/pywikipedia (r5604, Jun 21 2008, 20:20:16)
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]

installed Modules and softwares:pydot,graphviz.

command:interwiki.py -lang:zh -family:wikipedia "插花" -autonomous

It cannot write pictures and return these error:

======Aborted processing [[zh:插花]]======
Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Python25\lib\threading.py", line 486, in __bootstrap_inner
    self.run()
  File "D:\My Documents\SOURCE\pybot\trunk\pywikipedia\interwiki_graph.py", line
 36, in run
    if self.graph.write(filename, prog = 'dot', format = format):
  File "build\bdist.win32\egg\pydot.py", line 1696, in write
    dot_fd.write(self.create(prog, format))
  File "build\bdist.win32\egg\pydot.py", line 1796, in create
    status, stderr_output) )
InvocationException: Program terminated with status: 69. stderr follows: Error:
c:\docume~1\admini~1\locals~1\temp\tmpyfxn5k:2: syntax error near line 2
context: "he:蛂???蚳 蚺蚳???" >>>  [URL=http: <<< //he.wikipedia.org/w/index.php
?useskin=monobook&title=D70X1.370093P-10191D7%D7%D7%D70X1.2F7000P-10228_D70X1.32
BA07P-10194D70X1.01DEF0P+6848D7%D7%D7D&redirect=no, shape=rectangle, fontsize=11
, style=filled, fillcolor=white];



----------------------------------------------------------------------

Comment By: Matthieu Pupat (mpupat)
Date: 2009-01-19 03:48

Message:
I did look at the issue and found that:

* you need to put some double-quotes around the URL address
* pydot does some processing on node names containing columns

Knowing this the following patch makes interwiki_graph work

49c49
<         return (u'"%s:%s"' % (page.site().language(),
page.title())).encode('utf-8')
---
>         return (u'"%s|%s"' % (page.site().language(),
page.title())).encode('utf-8')
53c53
<         node.set_URL('http://%s%s' % (page.site().hostname(),
page.site().get_address(page.urlname())))
---
>         node.set_URL('"http://%s%s' % (page.site().hostname(),
page.site().get_address(page.urlname())) + '"')


----------------------------------------------------------------------

Comment By: Matthieu Pupat (mpupat)
Date: 2009-01-18 05:16

Message:
Same thing here:

$ python ./interwiki.py -lang:fr Acadie
[...]
Which variant should be used [number, (n)one, (g)ive up] : Exception in
thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
    self.run()
  File "/home/almabot/pywikipedia/interwiki_graph.py", line 36, in run
    if self.graph.write(filename, prog = 'dot', format = format):
  File "/usr/lib/python2.5/site-packages/pydot.py", line 1696, in write
    dot_fd.write(self.create(prog, format))
  File "/usr/lib/python2.5/site-packages/pydot.py", line 1796, in create
    status, stderr_output) )
InvocationException: Program terminated with status: 220. stderr follows:
Error: /tmp/tmpWpo-hB:2: syntax error near line 2
context: "lt:Akadija" >>>  [URL=http: <<<
//lt.wikipedia.org/w/index.php?useskin=monobook&title=Akadija&redirect=no,
shape=octagon, fontsize=11, style=filled, fillcolor=white];

$ python ./version.py
Pywikipedia [http] trunk/pywikipedia (r6264, Jan 15 2009, 23:28:54)
Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38)
[GCC 4.3.2 20080917 (Red Hat 4.3.2-4)]

I hope this helps figuring out the issue.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1999787&group_id=93107



More information about the Pywikipedia-l mailing list