pyinstaller and logging

1,788 views
Skip to first unread message

Mike

unread,
May 5, 2009, 1:46:29 PM5/5/09
to PyInstaller
Pyinstaller seems to have a problem with logging ...

I installed pyinstaller 1.3 - using it together with Python 2.6. I
used pyinstaller for a small project, the created .exe worked fine.
After some additional changes to my project I got strange run time
errors when running the .exe (but no problems when running the .py
file directly with the python interpreter). I stripped down my program
and tracked the problem down to the first log message being written.

So this is a stripped down version of the python script:

import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)-15s %(levelname)-8s %(message)
s',
datefmt='%Y-%m-%d %H:%M:%S',
filename="test1.log",
filemode='w')
print "written via print"
logging.info("written via logging")

when I start this from the python shell I am getting
IDLE 2.6.2 ==== No Subprocess ====
>>>
written via print
>>>
and test1.log contains
2009-05-05 19:39:52 INFO written via logging
as expected.

When I start test1.exe I am getting

written via print
Traceback (most recent call last):
File "<string>", line 8, in <module>
File "c:\dokumente und einstellungen\dieter\eigene dateien\collector
\v0r0m2\buildtest1\out1.pyz/logging", line 1451, in info
File "c:\dokumente und einstellungen\dieter\eigene dateien\collector
\v0r0m2\buildtest1\out1.pyz/logging", line 1030, in info
File "c:\dokumente und einstellungen\dieter\eigene dateien\collector
\v0r0m2\buildtest1\out1.pyz/logging", line 1142, in _log
File "c:\dokumente und einstellungen\dieter\eigene dateien\collector
\v0r0m2\buildtest1\out1.pyz/logging", line 1117, in makeRecord
File "c:\dokumente und einstellungen\dieter\eigene dateien\collector
\v0r0m2\buildtest1\out1.pyz/logging", line 272, in __init__
File "C:\Programme\pyinstaller-1.3\iu.py", line 312, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "C:\Programme\pyinstaller-1.3\iu.py", line 398, in doimport
exec co in mod.__dict__
File "c:\dokumente und einstellungen\dieter\eigene dateien\collector
\v0r0m2\buildtest1\out1.pyz/multiprocessing", line 83, in <module>
File "C:\Programme\pyinstaller-1.3\iu.py", line 312, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "C:\Programme\pyinstaller-1.3\iu.py", line 382, in doimport
mod = director.getmod(nm)
File "C:\Programme\pyinstaller-1.3\iu.py", line 215, in getmod
mod = owner.getmod(nm)
File "C:\Programme\pyinstaller-1.3\iu.py", line 77, in getmod
mod = imp.load_module(nm, fp, attempt, (ext, mode, typ))
TypeError: importHook() takes at most 5 arguments (6 given)


What am I doing wrong?

Mike

unread,
May 6, 2009, 1:26:35 PM5/6/09
to PyInstaller
Shame on me - I somehow skipped the requirement from pyinstaller just
supporting python between 1.5 and 2.4 . Thanks for the help of Vinay
( http://groups.google.de/group/comp.lang.python/browse_thread/thread/e002d1e0ad682c90?hl=de#
)

As I do not want to switch to python 2.4 I will have to look for
something else. I tried py2exe today, which seems to work fine for my
project (and officially supports python 2.6 ;-) ) - it is able to
create an exe file within a dist directory, but not a single
executable like pyinstaller is doing it. But this is fine enough for
me just now.

Stephen Dolan

unread,
May 7, 2009, 6:05:55 AM5/7/09
to PyIns...@googlegroups.com
2009/5/6 Mike <tornad...@gmx.net>:

>
> Shame on me - I somehow skipped the requirement from pyinstaller just
> supporting python between 1.5 and 2.4 . Thanks for the help of Vinay
> ( http://groups.google.de/group/comp.lang.python/browse_thread/thread/e002d1e0ad682c90?hl=de#
> )
>
> As I do not want to switch to python 2.4 I will have to look for
> something else. I tried py2exe today, which seems to work fine for my
> project (and officially supports python 2.6 ;-) ) - it is able to
> create an exe file within a dist directory, but not a single
> executable like pyinstaller is doing it. But this is fine enough for
> me just now.
>
pyinstaller 1.3 works fine with python2.5 and head of development from
svn has also been sucessfully used with python 2.6 (see thread here
http://groups.google.com/group/PyInstaller/browse_thread/thread/4b5d827412deb1c2?hl=en)

Stephen

Giovanni Bajo

unread,
May 12, 2009, 8:36:38 AM5/12/09
to PyIns...@googlegroups.com
On 5/6/2009 7:26 PM, Mike wrote:
> Shame on me - I somehow skipped the requirement from pyinstaller just
> supporting python between 1.5 and 2.4 . Thanks for the help of Vinay
> ( http://groups.google.de/group/comp.lang.python/browse_thread/thread/e002d1e0ad682c90?hl=de#
> )

PyInstaller SVN trunk supports up to Python 2.5 without problems. It
doesn't support Python 2.6 on Windows, though.
--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com

Reply all
Reply to author
Forward
0 new messages