On 4/30/14, 9:10 AM, Werner wrote:
Hi,
A user running my software on a Italian Windows sees this exception:
twcbsrc.app_base - ERROR - app_base.pyo - 292 - Traceback (most recent
call last):
File "twcbsrc\controllers\app_cb.pyo", line 406, in onTBPrint
File "importlib\__init__.pyo", line 37, in import_module
File "zipextimporter.pyo", line 82, in load_module
File "twcbsrc\controllers\dreports.pyo", line 44, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "dabo\__init__.pyo", line 186, in <module>
File "dabo\dLocalize.pyo", line 79, in install
File "dabo\dLocalize.pyo", line 111, in setLanguage
File "logging\__init__.pyo", line 1175, in error
File "logging\__init__.pyo", line 1268, in _log
File "logging\__init__.pyo", line 1278, in handle
File "logging\__init__.pyo", line 1318, in callHandlers
File "logging\__init__.pyo", line 749, in handle
File "logging\__init__.pyo", line 879, in emit
File "logging\__init__.pyo", line 802, in handleError
File "traceback.pyo", line 124, in print_exception
File "traceback.pyo", line 13, in _print
AttributeError: 'unicode' object has no attribute 'write'
I can not recreate this on my dev machines, i.e. I see the correct
exception text generated in setLanguage line 111.
I do see the problem in a py2exe'd version but I can not figure out why
I get the AttributeError instead of the exception text, anyone has an idea?
I currently work around it by changing line 107 in setLanguage to
'dabo.log.info' instead of 'dabo.log.error'.
Translations work for languages which I provide the .mo files for (i.e.
de, fr, and en).
I think that I am not setting up Dabo reportWriter correctly to use the
user selected language and it falls back to the OS defined language.
In other words what do I need to set or call before doing:
import dabo.lib.reportWriter as drw
You gotta work backwards. Not sure what version of Python you are
running, but the exception indicates traceback.py line 13 is expecting a
file-like object, but is instead working with a string-like object. So
what sent it the string-like object in the first place? Etc...
It's good news you can recreate this, because you could sprinkle in some
print statements, generate the exe, and execute.
Could work out to be that py2exe didn't include everything it needed to,
and an exceptional case is being executed that you don't see when using
the python interpreter.
I've had better luck using PyInstaller or even cx-freeze than py2exe
over the past 5 years...
Good luck!
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]