Hi,

The import pwd doesn't actually occur in your code, but in a standard
library that is called by django/utils/translation/ trans_real.py.

Due to the sandbox restrictions, I believe that there are still some issues
using all of Django's internationalization functionality.  It seems as
though this might be one of those issues.

If you aren't directly using the i18n features of Django, it may still be an
issue since, according to their documentation
http://docs.djangoproject.com/en/dev/topics/i18n/, internationalization is
on by default:

"Django's internationalization hooks are on by default, and that means
there's a bit of i18n-related overhead in certain places of the framework.
If you don't use internationalization, you should take the two seconds to
set USE_I18N = 
False<http://docs.djangoproject.com/en/dev/ref/settings/#setting-USE_I18N>in
your settings file. If
USE_I18N<http://docs.djangoproject.com/en/dev/ref/settings/#setting-USE_I18N>is
set to
False, then Django will make some optimizations so as not to load the
internationalization machinery.

You'll probably also want to remove
'django.core.context_processors.i18n'from your
TEMPLATE_CONTEXT_PROCESSORS setting."
Hopefully this will help some,
Marzia

On Mon, Sep 29, 2008 at 2:09 PM, jamesv <[EMAIL PROTECTED]> wrote:

>
> Good afternoon, I have a bit of a vexing problem.
>
> After deploying my application, everything runs perfectly well for a
> while (5 minutes to a couple hours) then out of the blue I get the
> following error:
>
> <class 'django.template.TemplateSyntaxError'>: Caught an exception
> while rendering: No module named pwd
>
> Original Traceback (most recent call last):
>  File "/base/data/home/apps/site/1.XXX/django/template/debug.py",
> line 71, in render_node
>    result = node.render(context)
>  File "/base/data/home/apps/site/1.XXX/django/template/debug.py",
> line 87, in render
>    output = force_unicode(self.filter_expression.resolve(context))
>  File "/base/data/home/apps/site/1.XXX/django/template/__init__.py",
> line 559, in resolve
>    new_obj = func(obj, *arg_vals)
>  File "/base/data/home/apps/site/1.XXX/django/template/
> defaultfilters.py", line 631, in date
>    return format(value, arg)
>  File "/base/data/home/apps/site/1.XXX/django/utils/dateformat.py",
> line 264, in format
>    return df.format(format_string)
>  File "/base/data/home/apps/site/1.XXX/django/utils/dateformat.py",
> line 29, in format
>    pieces.append(force_unicode(getattr(self, piece)()))
>  File "/base/data/home/apps/site/1.XXX/django/utils/dateformat.py",
> line 174, in r
>    return self.format('D, j M Y H:i:s O')
>  File "/base/data/home/apps/site/1.XXX/django/utils/dateformat.py",
> line 29, in format
>    pieces.append(force_unicode(getattr(self, piece)()))
>  File "/base/data/home/apps/site/1.XXX/django/utils/encoding.py",
> line 49, in force_unicode
>    s = unicode(s)
>  File "/base/data/home/apps/site/1.XXX/django/utils/functional.py",
> line 201, in __unicode_cast
>    return self.__func(*self.__args, **self.__kw)
>  File "/base/data/home/apps/site/1.XXX/django/utils/translation/
> __init__.py", line 62, in ugettext
>    return real_ugettext(message)
>  File "/base/data/home/apps/site/1.XXX/django/utils/translation/
> trans_real.py", line 290, in ugettext
>    return do_translate(message, 'ugettext')
>  File "/base/data/home/apps/site/1.XXX/django/utils/translation/
> trans_real.py", line 280, in do_translate
>    _default = translation(settings.LANGUAGE_CODE)
>  File "/base/data/home/apps/site/1.XXX/django/utils/translation/
> trans_real.py", line 198, in translation
>    default_translation = _fetch(settings.LANGUAGE_CODE)
>  File "/base/data/home/apps/site/1.XXX/django/utils/translation/
> trans_real.py", line 183, in _fetch
>    app = __import__(appname, {}, {}, [])
>  File "/base/data/home/apps/site/1.XXX/analyze/__init__.py", line 9,
> in <module>
>    from user import __questionPermsForUser
>  File "/base/python_dist/lib/python2.5/user.py", line 30, in <module>
>    home = os.path.expanduser("~/")
>  File "/base/python_dist/lib/python2.5/posixpath.py", line 320, in
> expanduser
>    import pwd
> ImportError: No module named pwd
>
> I am running Django 1.0 with rev52 of the App Engine Helper, and
> nowhere in my codebase is there -any- reference to "import pwd". I
> have even gone so far as to remove the sole reference to "pwd" in the
> Django core, and remove /django/views/static.py (which is the only
> place "import posixpath" is reference, which in turn references "pwd"
>
> This has been confusing me to no end, as I can't replicate the issue
> in the SDK and the site functions without flaw for a while after a
> clean deployment.
>
> _Any_ suggestions or advice would be greatly appreciated
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to