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

Re: [Cheetahtemplate-discuss] Testsuite failures

Expand Messages
  • Victor Ng
    This doesn t have to do with having write permission to the current working directory. I ve run cheetah test from /tmp where I have full write permission and
    Message 1 of 16 , Sep 18, 2003
    • 0 Attachment
      This doesn't have to do with having write permission to the current
      working directory.

      I've run "cheetah test" from /tmp where I have full write permission
      and the bug still creeps up.

      Cheetah/Template.py needs a patch to create a package if it doesn't
      exist already. There's code to autocreate the '__init__.py' file if it
      doesn't exist, but there is not check to make create the package
      directory ('tmp').

      Here's the diff output:

      --- /tmp/Cheetah-0.9.15/src/Template.py Thu Sep 18 18:06:56 2003
      +++ Template.py Thu Sep 18 18:04:21 2003
      @@ -518,6 +518,8 @@
      # Check if __init__.py is in the directory -- if not,
      make an empty one.
      packageDir = os.path.join(directory, moduleName)
      initPy = os.path.join(packageDir, '__init__.py')
      + if not os.access(packageDir, os.F_OK):
      + os.mkdir(packageDir)
      if not os.path.exists(initPy):
      file = open(initPy, 'w')
      file.write('#')


      vic


      On Thursday, September 18, 2003, at 02:19 PM, Mike Orr wrote:

      > On Thu, Sep 18, 2003 at 11:48:18AM -0400, Victor Ng wrote:
      >> Running "cheetah test" seems to require that I manually create a "tmp"
      >> directory beneath the current working directory.
      >
      > I changed the CVS version to abort with a helpful error message if you
      > run
      > 'cheetah test' but don't have write permission in the current
      > directory.
      >
      > In the long run, it should probably put temporary files under the
      > system tmp directory instead.
      >
      > --
      > -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



      -------------------------------------------------------
      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
    • Victor Ng
      Whoops. Ignore that last email - something weird is going on with the imp.find_module call. I need to dig around a little more. vic ... This sf.net email is
      Message 2 of 16 , Sep 18, 2003
      • 0 Attachment
        Whoops. Ignore that last email - something weird is going on with the
        imp.find_module call.

        I need to dig around a little more.

        vic

        On Thursday, September 18, 2003, at 06:09 PM, Victor Ng wrote:

        > This doesn't have to do with having write permission to the current
        > working directory.
        >
        > I've run "cheetah test" from /tmp where I have full write permission
        > and the bug still creeps up.
        >
        > Cheetah/Template.py needs a patch to create a package if it doesn't
        > exist already. There's code to autocreate the '__init__.py' file if
        > it doesn't exist, but there is not check to make create the package
        > directory ('tmp').
        >
        > Here's the diff output:
        >
        > --- /tmp/Cheetah-0.9.15/src/Template.py Thu Sep 18 18:06:56 2003
        > +++ Template.py Thu Sep 18 18:04:21 2003
        > @@ -518,6 +518,8 @@
        > # Check if __init__.py is in the directory -- if not,
        > make an empty one.
        > packageDir = os.path.join(directory, moduleName)
        > initPy = os.path.join(packageDir, '__init__.py')
        > + if not os.access(packageDir, os.F_OK):
        > + os.mkdir(packageDir)
        > if not os.path.exists(initPy):
        > file = open(initPy, 'w')
        > file.write('#')
        >
        >
        > vic
        >
        >
        > On Thursday, September 18, 2003, at 02:19 PM, Mike Orr wrote:
        >
        >> On Thu, Sep 18, 2003 at 11:48:18AM -0400, Victor Ng wrote:
        >>> Running "cheetah test" seems to require that I manually create a
        >>> "tmp"
        >>> directory beneath the current working directory.
        >>
        >> I changed the CVS version to abort with a helpful error message if
        >> you run
        >> 'cheetah test' but don't have write permission in the current
        >> directory.
        >>
        >> In the long run, it should probably put temporary files under the
        >> system tmp directory instead.
        >>
        >> --
        >> -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
        >



        -------------------------------------------------------
        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
      • Victor Ng
        I m not sure if this is specific to OSX, but my problems seem to be rooted in the fact that I was running the unittests from /tmp Try invoking:
        Message 3 of 16 , Sep 18, 2003
        • 0 Attachment
          I'm not sure if this is specific to OSX, but my problems seem to be
          rooted in the fact that I was running the unittests from /tmp

          Try invoking:

          imp.find_module('tmp', ['/'])

          when your working directory is /tmp and things seem to fail
          consistently.

          Other than that - things seem to work fine. I just had to run the
          testsuite from my home directory instead of /tmp and everything worked
          (except for those pesky True/False vs 1/0 problems I have with
          Python2.3).

          vic

          On Thursday, September 18, 2003, at 02:19 PM, Mike Orr wrote:

          > On Thu, Sep 18, 2003 at 11:48:18AM -0400, Victor Ng wrote:
          >> Running "cheetah test" seems to require that I manually create a "tmp"
          >> directory beneath the current working directory.
          >
          > I changed the CVS version to abort with a helpful error message if you
          > run
          > 'cheetah test' but don't have write permission in the current
          > directory.
          >
          > In the long run, it should probably put temporary files under the
          > system tmp directory instead.
          >
          > --
          > -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



          -------------------------------------------------------
          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
          ... It s not happening for me on Linux (Debian testing). ... The second argument looks wrong. If you re in /tmp and /tmp/tmp.py exists, the following should
          Message 4 of 16 , Sep 18, 2003
          • 0 Attachment
            On Thu, Sep 18, 2003 at 11:07:09PM -0400, Victor Ng wrote:
            > I'm not sure if this is specific to OSX, but my problems seem to be
            > rooted in the fact that I was running the unittests from /tmp

            It's not happening for me on Linux (Debian testing).

            > Try invoking:
            >
            > imp.find_module('tmp', ['/'])
            >
            > when your working directory is /tmp and things seem to fail
            > consistently.

            The second argument looks wrong. If you're in /tmp and /tmp/tmp.py
            exists, the following should work:

            imp.find_module('tmp', ['/tmp']) # Look in /tmp .
            imp.find_module('tmp') # Look in sys.path and a few special
            # places.

            Neither of them look in subdirectories. See the Python Library
            Reference.

            --
            -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
          Your message has been successfully submitted and would be delivered to recipients shortly.