[Pythonmac-SIG] Unclickable window when not running from shell...

David Remahl chmod007 at mac.com
Tue Aug 12 23:05:01 EDT 2003


Could it be that the cups daemon runs as another user? The only users 
allowed to bring up applications are root and the currently logged in 
user. The cups or lp user that owns the cupsd process is not allowed to 
interact with the windowserver in that fashion.

/ Rgds, David

On Tuesday, August 12, 2003, at 10:03:29 PM, Adam Augustine wrote:

> I am using MacPython 2.3 with 10.2.6. I am trying to get pyla (a 
> HylaFAX client http://www.teamsw.it/pyla/) set up as a cups printer.
>
> When I run:
>
> /usr/local/bin/pythonw pyla.py -i
>
> Things run normally, meaning I get my 16-ton paperweight in the dock 
> and I can interact with the tkinter GUI as I would expect to be able 
> to. When I run a similar command from within a shell script, it works 
> normally as well (provided I run the script rom a shell).
>
> If I run the script through the cups daemon, the window appears, but I 
> don't get a 16-ton paperweight in the dock. I cannot click on the 
> window to bring it to the front, and I don't seem to be getting any 
> errors that I can find (well, that is not entirely true, I get one 
> message that shows up even when things work properly when run from the 
> shell, "GetProfileBySpaceFromShmem returned NULL for 'RRRR' : Calling 
> Dispatch").
>
> This seems to be similar to the difference between running 
> /usr/local/bin/python and /usr/local/bin/pythonw, but I am sure I am 
> running pythonw in both instances.
>
> Thinking it has something to do with the environment variables I 
> dumped them for both executions. For the shell executed script I have:
>
> HOME=/var/root
> SHELL=/bin/tcsh
> USER=root
> PATH=/bin:/sbin:/usr/bin:/usr/sbin
> __CF_USER_TEXT_ENCODING=0x0:0:0
>
> TERM=vt100
> TERMCAP=¿ÿØ
> TERM_PROGRAM=Apple_Terminal
> TERM_PROGRAM_VERSION=81
> LOGNAME=root
> HOSTTYPE=macintosh
> VENDOR=apple
> OSTYPE=darwin
> MACHTYPE=powerpc
> SHLVL=1
> PWD=/
> GROUP=wheel
> HOST=Blue.local.
>
> When run from cups I get:
>
> CUPS_SERVERROOT=/private/etc/cups
> PWD=/
> TZ=GMT
> RIP_MAX_CACHE=8m
> TMPDIR=/private/var/spool/cups/tmp
> CUPS_DATADIR=/usr/share/cups
> USER=root
> PPD=/private/etc/cups/ppd/test_hylafax_on_milo_ac20_com.ppd
> CUPS_FONTPATH=/usr/share/cups/fonts
> LANG=en_US
> CFProcessPath=/usr/libexec/cups/backend/hylafax
> SOFTWARE=CUPS/1.1
> SHLVL=1
> PRINTER=test_hylafax_on_milo_ac20_com
> CHARSET=iso-8859-1
> DEVICE_URI=hylafax://milo.ac20.com/test-hylafax
> PATH=/usr/libexec/cups/filter:/bin:/usr/bin
> CONTENT_TYPE=application/pdf
> _=/usr/bin/env
>
> So my question is, Does MacPython (or does MacOS) care about 
> enviroment variables as far as allowing interaction with a tkinter 
> application? Do I need to set a variable or command line option or 
> something to allow the user to interact with the window that will pop 
> up?
>
> Thanks,
> 	Adam Augustine



More information about the Pythonmac-SIG mailing list