Bugs item #1601281, was opened at 2006-11-22 18:39
Message generated for change (Comment added) made by duncanwebb
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=446895&aid=1601281&group_id=46652
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: other
Group: 1.6.0
>Status: Pending
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: ryan (ryanroth)
Assigned to: Nobody/Anonymous (nobody)
Summary: Creating rom list with xmame errors out and crashes Freevo
Initial Comment:
Call MAME command : /usr/bin/xmame
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/freevo/main.py", line 321, in
eventhandler
app.eventhandler(event)
File "/usr/lib/python2.4/site-packages/freevo/menu.py", line 605, in
eventhandler
action( arg=arg, menuw=self )
File "/usr/lib/python2.4/site-packages/freevo/directory.py", line
451, in cwd
self.check_password_and_build(arg=None, menuw=menuw)
File "/usr/lib/python2.4/site-packages/freevo/directory.py", line
506, in check_password_and_build
self.build(arg=arg, menuw=menuw)
File "/usr/lib/python2.4/site-packages/freevo/directory.py", line
612, in build
for i in p.get(self, files):
File "/usr/lib/python2.4/site-packages/freevo/games/__init__.py",
line 92, in get
(rm_files, mame_list) = mame_cache.getMameItemInfoList(mame_files, cmd)
File "/usr/lib/python2.4/site-packages/freevo/games/mame_cache.py",
line 312, in getMameItemInfoList
mame_ok = updateMameRomList(mame_cmd)
File "/usr/lib/python2.4/site-packages/freevo/games/mame_cache.py",
line 289, in updateMameRomList
mameRomList = mameRomListFromListxml( mame_cmd )
File "/usr/lib/python2.4/site-packages/freevo/games/mame_cache.py",
line 222, in mameRomListFromListxml
parser.parse( listinfo )
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py",
line 109, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py",
line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py",
line 220, in feed
self._err_handler.fatalError(exc)
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/handler.py", line
38, in fatalError
raise exception
SAXParseException: /usr/bin/xmame --listxml:1:0: syntax error
---------------------------------------------------------
This error is caused by the way mame_cache.py calls 'xmame --listxml'.
Os.popen is being used and it captures all output from xmame, including the
general information it prints before spitting out the XML data. The way to fix
this is to first call 'os.system( mamecmd + '--listxml -out
/tmp/somefilename')' then use 'listinfo = os.popen( 'cat /tmp/somefilename',
'r')' to read it.
I have tested this solution and it works. The only issue is if the temp file
already exists.
Line 222 in
/usr/lib/python2.4/site-packages/freevo/directory.py
-listinfo = os.popen( mame_cmd + ' --listxml', 'r' )
+os.system( mame_cmd + ' -listxml -out /tmp/roms')
+listinfo = os.popen( 'cat /tmp/roms', 'r')
----------------------------------------------------------------------
>Comment By: Duncan Webb (duncanwebb)
Date: 2006-11-22 22:50
Message:
Logged In: YES
user_id=104395
Originator: NO
Patch has been applied to rel-1-6 at r8603.
Thanks
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=446895&aid=1601281&group_id=46652
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel