From: Don D. <ddw...@ad...> - 2013-05-23 15:39:34
|
On 5/6/13 12:37 PM, Don Dwiggins wrote: > On 5/2/13 9:25 PM, Mark Hammond wrote: >> I'd love to know where that arg array comes from though - it may well be something specific to x64 Windows or just Windows 7. It would be interesting to know what sys.argv is from the service process when running the service via src - if it is exactly the same, then I'd infer it is just windows trying to be helpful or something :) Here's a recap, based on what I've learned: First, the extra argument was caused by something I did quite a while ago: I added _exe_args_ to the service class attributes (I don't remember why). I'm not sure why this didn't cause problems right away, but, as our dialogue shows, it was a factor in the current situation. I'd recommend changing the py2exe/win32serviceutil code to ignore it, or to handle it properly when it's present. I don't need it for my service, though, so I've deleted it. My service depends on a set of configuration files located in the same folder as the service. Most of the problems I was having stemmed from my attempt to have the code, in various places, figure out where the service folder is. So, with cmdline_style='custom' in setup, I've rewritten it to have the module's HandleCommandLine (called from boot_service with no args) chdir to the executable's directory as soon as it's clear that the current process is the service process. Mark, thanks for the assistance, -- Don Dwiggins Advanced Publishing Technology |