Loading ...
Sorry, an error occurred while loading the content.
 

[Cheetahtemplate-discuss] ImportError: No module named __CheetahTemp_xxx ??

Expand Messages
  • Jarosław Zabiełło
    I get strange warnings (WebKit & Cheetah CVS 2003-09-25): File /usr/local/lib/python2.2/site-packages/Cheetah/Template.py , line 494, in
    Message 1 of 5 , Sep 25 6:55 PM
      I get strange warnings (WebKit & Cheetah CVS 2003-09-25):

      File "/usr/local/lib/python2.2/site-packages/Cheetah/Template.py", line 494, in _impModFromDummyPackage [edit]
      moduleDir, forceReload=1)
      File "/usr/local/lib/python2.2/site-packages/Cheetah/Template.py", line 523, in _importModuleFromDirectory [edit]
      fp, pathname, stuff = imp.find_module(moduleName, [directory])
      ImportError: No module named __CheetahTemp_2003092603152598091

      I do not know why it happens... I cannot find any error in my
      templates or python code...

      --
      JZ




      -------------------------------------------------------
      This sf.net email is sponsored by:ThinkGeek
      Welcome to geek heaven.
      http://thinkgeek.com/sf
      _______________________________________________
      Cheetahtemplate-discuss mailing list
      Cheetahtemplate-discuss@...
      https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
    • Mike Orr
      ... The only problem I ve seen with __CheetahTemp_* files is that they re sometimes left lying around in the tmp directory. What circumstances does it happen
      Message 2 of 5 , Sep 25 9:21 PM
        On Fri, Sep 26, 2003 at 03:55:37AM +0200, Jaros?aw Zabie??o wrote:
        > File "/usr/local/lib/python2.2/site-packages/Cheetah/Template.py", line 494, in _impModFromDummyPackage [edit]
        > moduleDir, forceReload=1)
        > File "/usr/local/lib/python2.2/site-packages/Cheetah/Template.py", line 523, in _importModuleFromDirectory [edit]
        > fp, pathname, stuff = imp.find_module(moduleName, [directory])
        > ImportError: No module named __CheetahTemp_2003092603152598091

        The only problem I've seen with __CheetahTemp_* files is that they're
        sometimes left lying around in the tmp directory.

        What circumstances does it happen in? Only with Webware? Only certain
        templates? Only template-servlets? How long have you been using Cheetah?

        I suspect this happens only with dynamically-compiled templates and not
        with precompiled templates, no? Compiling templates in memory is a bit of a
        black art, and it wouldn't surprise me if it writes a temporary module
        and imports it.

        --
        -Mike (Iron) Orr, mso@... (iron@...)
        http://iron.cx/ English * Esperanto * Russkiy * Deutsch * Espan~ol


        -------------------------------------------------------
        This sf.net email is sponsored by:ThinkGeek
        Welcome to geek heaven.
        http://thinkgeek.com/sf
        _______________________________________________
        Cheetahtemplate-discuss mailing list
        Cheetahtemplate-discuss@...
        https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
      • Jarosław Zabiełło
        W pi±tek 26 wrze¶nia 2003 o godz. 06:21:12 ... I am using Webware with settings: ExtraPathInfo : 1, CacheServletClasses : 1, CacheServletInstances : 1, I
        Message 3 of 5 , Sep 26 5:20 AM
          W piątek 26 września 2003 o godz. 06:21:12
          Mike Orr <mso@...> napisał(a):

          >> 523, in _importModuleFromDirectory [edit]
          >> fp, pathname, stuff = imp.find_module(moduleName, [directory])
          >> ImportError: No module named __CheetahTemp_2003092603152598091

          > The only problem I've seen with __CheetahTemp_* files is that
          > they're sometimes left lying around in the tmp directory.

          > What circumstances does it happen in? Only with Webware? Only
          > certain templates? Only template-servlets? How long have you been
          > using Cheetah?

          I am using Webware with settings:
          'ExtraPathInfo': 1,
          'CacheServletClasses': 1,
          'CacheServletInstances': 1,

          I am using object oriented templates. I am not sure, what templates
          are responsible for this bug. I have been using Cheetah for a few
          months, but this problem I found recently because I did not use email
          warnings feature of Webware before. I cannot find any bug on the web.
          I discovered it because WebKit sends me such errors by email.

          I got even stranger errors like:

          File "/tmp/__CheetahTemp_2003092611192228134.py", line 1
          from StronaPodstawowa import StronaPodstawowaath import getmtime,exists

          where I have NOT such code anywhere. It looks like a mix of one
          template and something else. The phrase "ath import getmtime, exists"
          is added from strange source because I do *not* use "import getmtime"
          in templates nor in my pythonic files. There are no files with such
          content...

          > I suspect this happens only with dynamically-compiled templates and
          > not with precompiled templates, no? Compiling templates in memory is
          > a bit of a black art, and it wouldn't surprise me if it writes a
          > temporary module and imports it.

          I do not know if they are dynamically compiled or not. I always
          compile all templates from cheetah-compile script after updating any
          template.

          --
          JZ




          -------------------------------------------------------
          This sf.net email is sponsored by:ThinkGeek
          Welcome to geek heaven.
          http://thinkgeek.com/sf
          _______________________________________________
          Cheetahtemplate-discuss mailing list
          Cheetahtemplate-discuss@...
          https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
        • Mike Orr
          ... By dynamically-compiled templates I mean those that are *not* created via cheetah-compile. Precompiling templates cuts down the number of things that
          Message 4 of 5 , Sep 26 7:08 AM
            On Fri, Sep 26, 2003 at 02:20:03PM +0200, Jaros?aw Zabie??o wrote:
            > W pi?tek 26 wrze?nia 2003 o godz. 06:21:12
            > Mike Orr <mso@...> napisa?(a):
            >
            > >> 523, in _importModuleFromDirectory [edit]
            > >> fp, pathname, stuff = imp.find_module(moduleName, [directory])
            > >> ImportError: No module named __CheetahTemp_2003092603152598091
            >
            > > The only problem I've seen with __CheetahTemp_* files is that
            > > they're sometimes left lying around in the tmp directory.
            >
            > > What circumstances does it happen in? Only with Webware? Only
            > > certain templates? Only template-servlets? How long have you been
            > > using Cheetah?
            >
            > I am using Webware with settings:
            > 'ExtraPathInfo': 1,
            > 'CacheServletClasses': 1,
            > 'CacheServletInstances': 1,
            >
            > I am using object oriented templates. I am not sure, what templates
            > are responsible for this bug. I have been using Cheetah for a few
            > months, but this problem I found recently because I did not use email
            > warnings feature of Webware before. I cannot find any bug on the web.
            > I discovered it because WebKit sends me such errors by email.
            >
            > I got even stranger errors like:
            >
            > File "/tmp/__CheetahTemp_2003092611192228134.py", line 1
            > from StronaPodstawowa import StronaPodstawowaath import getmtime,exists
            >
            > where I have NOT such code anywhere. It looks like a mix of one
            > template and something else. The phrase "ath import getmtime, exists"
            > is added from strange source because I do *not* use "import getmtime"
            > in templates nor in my pythonic files. There are no files with such
            > content...
            >
            > > I suspect this happens only with dynamically-compiled templates and
            > > not with precompiled templates, no? Compiling templates in memory is
            > > a bit of a black art, and it wouldn't surprise me if it writes a
            > > temporary module and imports it.
            >
            > I do not know if they are dynamically compiled or not. I always
            > compile all templates from cheetah-compile script after updating any
            > template.

            By dynamically-compiled templates I mean those that are *not* created
            via cheetah-compile. Precompiling templates cuts down the number of
            things that might go wrong, because you can see exactly where it puts
            the compiled module, which directory should be in your Python path,
            and you can even inspect the Python source.

            It almost looks like a cracker/virus has sabotaged your computer, but
            it's hard to imagine one that could cause this particular corruption
            without also corrupting other files on the system. So we'll have to
            assume it's something weird about your Webware/Cheetah setup, or some
            obscure bug.

            Do the tracebacks say anything more about *where* the problem occurred,
            or what was invoking the temporary files?

            Do the users get error messages when this happens, or does the servlet
            still display what it's supposed to anyway? Or maybe you don't know
            since it hasn't happened in your presence.

            Can others who are using Webware turn on their email-warnings feature
            and see if they can duplicate the problem? I'm using a nonstandard
            version of Webware so I can't do it myself.

            It's possible, as you say, that some concurrency/thread problem is
            causing two different modules to be written simultaneously in the
            same file, or corrupting the module data before/during. I haven't
            seen any similar thread problems reported with Webware. The only
            known limitations Cheetah has with threads is that template instances
            aren't thread safe, and Cheetah's #cache mechanisms don't mesh well
            with Webware's servlet caching. (#cache and friends don't cause
            errors, but they end up not doing much useful because Webware's
            servlet caching prob'ly does what you wanted to do in the first place.)

            When you say "object-oriented" templates, what do you mean?

            --
            -Mike (Iron) Orr, mso@... (iron@...)
            http://iron.cx/ English * Esperanto * Russkiy * Deutsch * Espan~ol


            -------------------------------------------------------
            This sf.net email is sponsored by:ThinkGeek
            Welcome to geek heaven.
            http://thinkgeek.com/sf
            _______________________________________________
            Cheetahtemplate-discuss mailing list
            Cheetahtemplate-discuss@...
            https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
          • Jarosław Zabiełło
            W pi±tek 26 wrze¶nia 2003 o godz. 16:08:50 ... I always use cheetah-compile. ... That s right. ... Yes. In the main index.py displays StronaGlowna.tmpl. It
            Message 5 of 5 , Sep 26 9:21 AM
              W piątek 26 września 2003 o godz. 16:08:50
              Mike Orr <mso@...> napisał(a):

              > By dynamically-compiled templates I mean those that are *not* created
              > via cheetah-compile.

              I always use cheetah-compile.

              > So we'll have to assume it's something weird about your Webware/Cheetah
              > setup, or some obscure bug.

              That's right.

              > Do the tracebacks say anything more about *where* the problem occurred,
              > or what was invoking the temporary files?

              Yes. In the main index.py displays StronaGlowna.tmpl. It is very
              strange, because this is the main page of my web serwice and if this
              template is corrupted I should know about it at once. This template
              starts with:

              #from StronaPodstawowa import StronaPodstawowa
              #extends StronaPodstawowa
              ...

              StronaPodstawowa.tmpl starts with:

              #from StronaBazowa import StronaBazowa
              #extends StronaBazowa

              This file has two blocks with #cache dirrective inside.

              StronaBazowa.tmpl starts with

              #from SiteTemplate import SiteTemplate
              #extends SiteTemplate
              #implements BodyContent

              etc.

              I cannot find any errors. It looks and works fine. _The error occurs
              from time to time, not every reload of the page._ And I know about
              errors only because WebKit sends me the email raport. I could not see
              any error with browser.

              > Do the users get error messages when this happens, or does the servlet
              > still display what it's supposed to anyway? Or maybe you don't know
              > since it hasn't happened in your presence.

              I am afraid, the third options may be true. It has not happend in my
              presence.

              > Can others who are using Webware turn on their email-warnings feature
              > and see if they can duplicate the problem? I'm using a nonstandard
              > version of Webware so I can't do it myself.

              I am using CVS version of Cheetah and Webware (version from
              2003-09-25). I have only one user of Webware.

              > It's possible, as you say, that some concurrency/thread problem is
              > causing two different modules to be written simultaneously in the
              > same file, or corrupting the module data before/during. I haven't
              > seen any similar thread problems reported with Webware. The only
              > known limitations Cheetah has with threads is that template instances
              > aren't thread safe, and Cheetah's #cache mechanisms don't mesh well
              > with Webware's servlet caching. (#cache and friends don't cause
              > errors, but they end up not doing much useful because Webware's
              > servlet caching prob'ly does what you wanted to do in the first place.)

              Hmmm. I am using cache from Webware and cache from Cheetah. But why
              Webkit send error that it cannot even find __CheetahTemp file?

              > When you say "object-oriented" templates, what do you mean?

              Cascade of templates extended one from another. Like
              http://www.cheetahtemplate.org/docs/users_guide_html_multipage/howWorks.objoriented.html


              --
              JZ





              -------------------------------------------------------
              This sf.net email is sponsored by:ThinkGeek
              Welcome to geek heaven.
              http://thinkgeek.com/sf
              _______________________________________________
              Cheetahtemplate-discuss mailing list
              Cheetahtemplate-discuss@...
              https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
            Your message has been successfully submitted and would be delivered to recipients shortly.