|
From: Jose M. <jos...@gm...> - 2012-01-09 06:59:50
|
On Sun, Jan 8, 2012 at 8:21 PM, Andy Davidson <an...@no...> wrote:
>
>
> Hi there,
>
> Please can I check that this went out? Any ideas?
>
> Andy
>
> Begin forwarded message:
>
> From: Andy Davidson <an...@no...>
> Date: 4 January 2012 14:45:53 GMT
> To: pyt...@li...
> Subject: [Pythondialog-users] Crash!
> dialog.PythonDialogErrorBeforeExecInChildProcess - Please help to debug.
>
>
> Dear pythondialog-users.
>
> Thanks for this software, but please could I request some technical support
> with regards to an issue I am struggling to debug. I am trying to produce a
> dialog.menu and populate the menu with items as discovered in a database.
>
> I see in demo.py that d.menu takes a list of tuples for menu option choices,
> so this is the data type I am building.
>
> This is the code I am using :
>
> def add_check(d, userid, cursor):
> cursor.execute ("SELECT id, hostname FROM host WHERE user_id=%s",
> userid)
> hostchoices = list(cursor.fetchall())
> # print hostchoices;
> while 1:
> (code, tag) = d.menu( "Pick a host to manage?",
> width=60,
> choices=hostchoices )
> if handle_exit_code(d, code):
> break
> d.msgbox ("You picked host " . tag)
> return 0
>
>
>
> When I print hostchoices, I see :
>
> [(1L, 'host1'), (2L, 'host2), (3L, 'host3'), (4L, 'host4'), (6L, 'host6'),
> (7L, 'host7'), (8L, 'host8')]
>
>
>
>
> It produces this traceback :
>
> Traceback (most recent call last):
> File "monshell.py", line 126, in <module>
> if __name__ == "__main__": main()
> File "monshell.py", line 119, in main
> main_menu(d, userid, cursor)
> File "monshell.py", line 98, in main_menu
> options[tag](d,userid,cursor)
> File "monshell.py", line 73, in add_check
> choices=hostchoices )
> File "build/bdist.macosx-10.7-intel/egg/dialog.py", line 1253, in menu
>
> File "build/bdist.macosx-10.7-intel/egg/dialog.py", line 825, in _perform
>
> File "build/bdist.macosx-10.7-intel/egg/dialog.py", line 765, in
> _wait_for_program_termination
>
> dialog.PythonDialogErrorBeforeExecInChildProcess:
> <PythonDialogErrorBeforeExecInChildProcess: perhaps the dialog-like program
> could not be executed; perhaps the system is out of memory; perhaps the
> maximum number of open file descriptors has been reached>
>
>
> It happens on the Linux and OSX version I have.
>
> Any clues about how I can debug this ? Dialog is running ok elsewhere in my
> application - in fact I also use a static menu elsewhere which builds just
> fine.
>
> Thanks
> Andy
> ------------------------------------------------------------------------------
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
> infrastructure or vast IT resources to deliver seamless, secure access to
> virtual desktops. With this all-in-one solution, easily deploy virtual
> desktops for less than the cost of PCs and save 60% on VDI infrastructure
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
> _______________________________________________
> Pythondialog-users mailing list
> Pyt...@li...
> https://lists.sourceforge.net/lists/listinfo/pythondialog-users
>
>
> ------------------------------------------------------------------------------
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
> infrastructure or vast IT resources to deliver seamless, secure access to
> virtual desktops. With this all-in-one solution, easily deploy virtual
> desktops for less than the cost of PCs and save 60% on VDI infrastructure
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
> _______________________________________________
> Pythondialog-users mailing list
> Pyt...@li...
> https://lists.sourceforge.net/lists/listinfo/pythondialog-users
>
I think that in last instance pythondialog runs a shell with dialog cmd.
In function _call_program(self, redirect_child_stdin, cmdargs,
**kwargs) exits the exec command:
os.execve(self._dialog_prg, arglist, new_environ)
Try to print the complete line call and test it in a bash shell.
Bye
|