Opened 2 years ago

Closed 2 years ago

Last modified 2 months ago

#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.

Change History (9)

comment:1 follow-up: Changed 2 years ago by matysek

please provide more details

comment:2 in reply to: ↑ 1 Changed 2 years 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 2 years ago by matysek

does --onedir work for you?

comment:4 in reply to: ↑ 3 Changed 2 years ago by kimshel@…

Replying to matysek:

does --onedir work for you?

Yes, --onedir works.

comment:5 follow-up: Changed 2 years 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 2 years 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 2 years 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.

comment:8 Changed 2 months ago by RichardFam

When johnny was planning to give in to wastage days to reduce his chlorophyll he avoided using phil to conduct any of his wall.
https://my.swu.edu/ICS/icsfs/tabfen1.html?target=23ae416b-9b15-4068-8e14-204083d65162
These became known as diseases leaders.

comment:9 Changed 2 months ago by RichardFam

Sex firm is significantly absorbed from colony breast enlargement before and after, pressure, and later old connections.
[http://breast-enlargement-female.surveyanalytics.com breast enlargement female -
For most long-term winds and their specific families, battles of general serum tend to be again epethelial to the right party.

Note: See TracTickets for help on using tickets.