Problem with py2exe
Philippe Roussel <[email protected]>
| Newsgroups | gmane.comp.python.formencode |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
I'm trying to package an application using FormEncode with py2exe. The
resulting exe ends with the following error :
NotImplementedError: resource_filename() only supported for .egg, not .zip
As I didn't understand why api.py used resource_filename from
setuptools, I tried to use something simpler. The following patch
works for me but I have no idea if it's correct. What do you think ?
Philippe
--- api.py.orig Thu May 24 21:44:45 2007
+++ api.py Thu May 24 23:10:49 2007
@@ -6,7 +6,6 @@
import textwrap
import re
import os
-from pkg_resources import resource_filename
__all__ = ['NoDefault', 'Invalid', 'Validator', 'Identity',
'FancyValidator', 'is_validator']
@@ -14,7 +13,7 @@
import gettext
def get_localedir():
- return resource_filename(__name__, "/i18n")
+ return os.path.join(os.path.dirname(__file__), 'i18n')
def set_stdtranslation(domain="FormEncode", languages=None, \
localedir = get_localedir()):
--
Je me console d'être femme en songeant que, de la sorte, je n'en épouserai jamais une. Lady Montagu
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/