Bugs item #3613288, was opened at 2013-05-14 05:10
Message generated for change (Settings changed) made by uvapalmer
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3613288&group_id=78018
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: win32
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Joshua Palmer (uvapalmer)
Assigned to: Nobody/Anonymous (nobody)
>Summary: Installation of windows service fails when py files in zip
Initial Comment:
Python supports running py (or pyc) files directly out of zip files.
There are two problems with this in pywin32:
First, in GetServiceClassString the fname correctly represents the full path to the python file, but the win32api.FindFiles method does not find it because it is inside of a zip file. I got around this by checking to see if the file exists and if not seeing if there was a file with a .zip extension that exists in the path. If so, assume that it is correct.
Second, when installing python files from within a zip file, the argv parameters from python are as follows: [0] – The full path to the python file, [1] – The full path to the zip file, [2:] – Any other parameters. To get around this, I check to see if [1] references a zip file that exists. If so, I delete [1]. Another option would be to also determine if [1] was a substring of [0].
There are a couple steps to run python files out of a zip file.
- Create a zip file containing python files
- Create a pth file containing a full path to the zip file. Put the file into %PYTHON_HOME%/Lib/site-packages.
- If you are attempting to call the myPyFile.py file in the zip file residing at c:\myZipFile.zip, the command line would look something like: “%PYTHON_HOME%/python.exe –m myPyFile c:/myZipFile.zip install”
----------------------------------------------------------------------
Comment By: Joshua Palmer (uvapalmer)
Date: 2013-05-14 05:16
Message:
I have added files showing the changes I made in order to make this work
for me.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3613288&group_id=78018
|