Wintermute0110/plugin.program.AEL.dev

Problem with argument.

Closed this issue · 9 comments

Hi with latest git AEL launcher with commandline option in arguments line failed.
For example with pcsx2
with this
<args>&quot;%rom%&quot;</args>

it work
if I had option like this

<args>--nogui &quot;%rom%&quot;</args>

il failed.
Same problem with retroarch.

You using Linux or Windows?

Linux
The output of pcsx2 give me this error

Command line parsing...
Caractères non attendus suivant l'option « nogui ».

That could be translated by
Non expected character after option « nogui ».

OK... The way ROMs are launched must be upgraded, current implementation is a workaround. I did an experiment that upgrades that in Linux and also introduces the feature of recording the emulator output into a file, however I need a more sophisticated way to deal with arguments. The current new implementation works well if the launching command is of the form: launcher %ROM%, but fails if launching command is more complex, for example: launcher -fs 1 %ROM%

I will revert to the old implementation for the moment.

Issue should be fixed in last commit. Reopen if you find further problems.

fixed it but reintroduce unicode error with some path :

16:03:52 T:139766764881664   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.UnicodeEncodeError'>
                                            Error Contents: 'ascii' codec can't encode character u'\xe9' in position 81: ordinal not in range(128)
                                            Traceback (most recent call last):
                                              File "/home/mac/.kodi/addons/plugin.program.advanced.emulator.launcher/addon.py", line 47, in <module>
                                                plugin.run_plugin()
                                              File "/home/mac/.kodi/addons/plugin.program.advanced.emulator.launcher/resources/main.py", line 236, in run_plugin
                                                self._command_run_rom(args['catID'][0], args['launID'][0], args['romID'][0])
                                              File "/home/mac/.kodi/addons/plugin.program.advanced.emulator.launcher/resources/main.py", line 4062, in _command_run_rom
                                                self._run_process(application, arguments, romext)
                                              File "/home/mac/.kodi/addons/plugin.program.advanced.emulator.launcher/resources/main.py", line 4090, in _run_process
                                                os.system('"{0}" {1}'.format(application, arguments))
                                            UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 81: ordinal not in range(128)
                                            -->End of Python script error report<--

In Kodi settings turn Kodi debug log OFF. In AEL settings -- Advanced turn AEL log level to DEBUG. Post whole log so I can see the launching strings.

17:20:48 T:140431153141504   ERROR: AEL DEBUG: ---------- Called AEL addon.py Main() constructor ----------
17:20:48 T:140431153141504   ERROR: AEL DEBUG: sys.platform = "linux2"
17:20:48 T:140431153141504   ERROR: AEL DEBUG: Python version 2.7.12 (default, Jun 28 2016, 08:31:05) [GCC 6.1.1 20160602]
17:20:48 T:140431153141504   ERROR: AEL DEBUG: __addon_version__ 0.9.0
17:20:48 T:140431153141504   ERROR: AEL DEBUG: sys.argv[0] = "plugin://plugin.program.advanced.emulator.launcher/"
17:20:48 T:140431153141504   ERROR: AEL DEBUG: sys.argv[1] = "-1"
17:20:48 T:140431153141504   ERROR: AEL DEBUG: sys.argv[2] = "?com=LAUNCH_ROM&catID=9e40145e7634ebc67edf13789d8caa93&launID=af1179a2d4568aa10d60319f21918afa&romID=9465816ec4c0e21456a294d52ced8a62"
17:20:48 T:140431153141504   ERROR: AEL DEBUG: args = {'romID': ['9465816ec4c0e21456a294d52ced8a62'], 'launID': ['af1179a2d4568aa10d60319f21918afa'], 'com': ['LAUNCH_ROM'], 'catID': ['9e40145e7634ebc67edf13789d8caa93']}
17:20:48 T:140431153141504   ERROR: AEL DEBUG: content_type = None
17:20:48 T:140431153141504   ERROR: AEL VERB : fs_load_catfile() Loading /home/mac/.kodi/userdata/addon_data/plugin.program.advanced.emulator.launcher/categories.xml
17:20:48 T:140431153141504   ERROR: AEL INFO : _command_run_rom() Launching ROM in Launcher...
17:20:48 T:140431153141504   ERROR: AEL VERB : fs_load_ROMs_JSON() Loading JSON file /home/mac/.kodi/userdata/addon_data/plugin.program.advanced.emulator.launcher/db_ROMs/roms_Emulators_Nintendo_64_af1179.json
17:20:48 T:140431153141504   ERROR: AEL INFO : _command_run_rom() categoryID  = 9e40145e7634ebc67edf13789d8caa93
17:20:48 T:140431153141504   ERROR: AEL INFO : _command_run_rom() launcherID  = af1179a2d4568aa10d60319f21918afa
17:20:48 T:140431153141504   ERROR: AEL INFO : _command_run_rom() romID       = 9465816ec4c0e21456a294d52ced8a62
17:20:48 T:140431153141504   ERROR: AEL INFO : _command_run_rom() application = "/usr/bin/retroarch"
17:20:48 T:140431153141504   ERROR: AEL INFO : _command_run_rom() apppath     = "/usr/bin"
17:20:48 T:140431153141504   ERROR: AEL INFO : _command_run_rom() romfile     = "/home/mac/Téléchargements/torrent/No-Intro/Nintendo - Nintendo 64/Banjo-Kazooie (Europe) (En,Fr,De).zip"
17:20:48 T:140431153141504   ERROR: AEL INFO : _command_run_rom() rompath     = "/home/mac/Téléchargements/torrent/No-Intro/Nintendo - Nintendo 64"
17:20:48 T:140431153141504   ERROR: AEL INFO : _command_run_rom() rombasename = "Banjo-Kazooie (Europe) (En,Fr,De).zip"
17:20:48 T:140431153141504   ERROR: AEL INFO : _command_run_rom() romext      = "zip"
17:20:48 T:140431153141504   ERROR: AEL INFO : _command_run_rom() arguments   = "-L /usr/lib/libretro/libretro-parallel.so "/home/mac/Téléchargements/torrent/No-Intro/Nintendo - Nintendo 64/Banjo-Kazooie (Europe) (En,Fr,De).zip""
17:20:48 T:140431153141504   ERROR: AEL VERB : _run_before_execution() media_state is "Stop" (0)
17:20:48 T:140431153141504   ERROR: AEL VERB : _run_before_execution() Calling xbmc.Player().stop()
17:20:50 T:140431153141504   ERROR: AEL VERB : _run_before_execution() Toggling Kodi fullscreen DEACTIVATED in Launcher
17:20:50 T:140431153141504   ERROR: AEL VERB : _run_before_execution() Calling xbmc.enableNavSounds(False)
17:20:50 T:140431153141504   ERROR: AEL VERB : _run_before_execution() Pausing 500 ms
17:20:50 T:140433174158528   DEBUG: ------ Window Init (DialogNotification.xml) ------
17:20:50 T:140433174158528   DEBUG: Window DialogNotification.xml was already loaded
17:20:50 T:140433174158528   DEBUG: Alloc resources: 0.00ms
17:20:51 T:140431153141504   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.UnicodeEncodeError'>
                                            Error Contents: 'ascii' codec can't encode character u'\xe9' in position 75: ordinal not in range(128)
                                            Traceback (most recent call last):
                                              File "/home/mac/.kodi/addons/plugin.program.advanced.emulator.launcher/addon.py", line 47, in <module>
                                                plugin.run_plugin()
                                              File "/home/mac/.kodi/addons/plugin.program.advanced.emulator.launcher/resources/main.py", line 236, in run_plugin
                                                self._command_run_rom(args['catID'][0], args['launID'][0], args['romID'][0])
                                              File "/home/mac/.kodi/addons/plugin.program.advanced.emulator.launcher/resources/main.py", line 4062, in _command_run_rom
                                                self._run_process(application, arguments, romext)
                                              File "/home/mac/.kodi/addons/plugin.program.advanced.emulator.launcher/resources/main.py", line 4090, in _run_process
                                                os.system('"{0}" {1}'.format(application, arguments))
                                            UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 75: ordinal not in range(128)
                                            -->End of Python script error report<--

I think should be fixed now. Try with last committed version.

fixed.