close Comments you submit will be routed for moderation. If you have an account, please log in first.
Modify

#597 closed defect (duplicate)

pyinstaller application not starting with subprocess module in onefile mode (win32)

Reported by: kimshel@… Owned by: giovannibajo
Priority: normal Milestone: PyInstaller 2.1
Component: Loader Version: 2.0
Severity: normal Keywords: onefile, windows, subprocess
Cc:

Description

There are some applications all packed by pyinstaller2.0 with --onefile option on windows.
One of them call others through subporcess, but the others can't startup.

The other applications work when startup through cmd or other applications not packed by pyinstaller2.0.

pyinstaller 1.5 works.

Attachments (0)

Change History (7)

comment:1 follow-up: Changed 20 months ago by matysek

please provide more details

comment:2 in reply to: ↑ 1 Changed 20 months ago by kimshel@…

Replying to matysek:

please provide more details

the codes snippet in python script likes this:

def some_work():
  print 'hello'

if __name__ == '__main__':
  import sys
  import subprocess
  if len(sys.argv) == 2:
    subprocess.Popen(sys.argv[1])
  else:
    some_work()

Packed it throught pytinstaller with --onefile option and got a exe I named it app.exe, then I copy it to a duplicate named subapp.exe. In the cmd console, run app.exe subapp.exe I got these:

  File "<string>", line 3, in <module>
  File "C:\pyist\PyInstaller\loader\iu.py", line 386, in importHook
    mod = _self_doimport(nm, ctx, fqname)
  File "C:\pyist\PyInstaller\loader\iu.py", line 459, in doimport
    mod = director.getmod(nm)
  File "C:\pyist\PyInstaller\loader\iu.py", line 248, in getmod
    mod = owner.getmod(nm)
  File "C:\pyist\PyInstaller\loader\archive.py", line 471, in getmod
    localpath: ExtInPkgImporter(localpath, nm)},
  File "C:\pyist\PyInstaller\loader\archive.py", line 491, in __init__
    iu.DirOwner.__init__(self, path)
  File "C:\pyist\PyInstaller\loader\iu.py", line 82, in __init__
    raise OwnerError("%s is not a directory" % path)
iu.OwnerError: <OwnerError C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/_MEI17722/ is not
a directory>

If packed the script with pyinstaller1.5.1, the app works fine. Even a 1.5.1 packed app call a 2.0 packed app or reversely both work fine.

I check it on windows xp and win7, with python2.6 and python2.7, same results.

comment:3 follow-up: Changed 20 months ago by matysek

does --onedir work for you?

comment:4 in reply to: ↑ 3 Changed 20 months ago by kimshel@…

Replying to matysek:

does --onedir work for you?

Yes, --onedir works.

comment:5 follow-up: Changed 20 months ago by matysek

  • Component changed from PyInstaller to Loader
  • Keywords onefile windows subprocess added
  • Milestone set to PyInstaller 2.1
  • Owner changed from matysek to giovannibajo
  • Summary changed from A pyinstaller application can't start other pyinstaller applications to pyinstaller application not starting with subprocess module in onefile mode (win32)

Could it be that with --onefile you should not rename the created exe file?

comment:6 in reply to: ↑ 5 Changed 20 months ago by kimshel@…

Replying to matysek:

Could it be that with --onefile you should not rename the created exe file?

No, file name doesn't effect. It's just for reproduce the problem. I have different files actually, and the renamed application works through the cmd.

I got a message from Dwig who had the same problem. There ticket he submitted is on #569.
I think it's the same bug.

comment:7 Changed 20 months ago by matysek

  • Resolution set to duplicate
  • Status changed from new to closed

Please test latest dev branch. I'm closing it since it seems a duplicate bug.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.