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

[Cheetahtemplate-discuss] Cheetah completely borked under python 2.7?

Expand Messages
  • Mike Bonnet
    I just built Cheetah and ran the unit tests under python 2.7 (Fedora 14 Beta) and it spewed a ton of errors. I haven t had a chance to look into them yet, but
    Message 1 of 7 , Oct 4, 2010
    • 0 Attachment
      I just built Cheetah and ran the unit tests under python 2.7 (Fedora 14
      Beta) and it spewed a ton of errors. I haven't had a chance to look
      into them yet, but they look pretty concerning. Has anyone seen these
      problems yet? Are we going to need serious refactoring to make Cheetah
      work under python 2.7?

      The log is available here:

      http://people.redhat.com/mikeb/cheetah-2.4.3-python27-tests.log

      I'll start looking into possible fixes when I can.

      Thanks,
      Mike

      ------------------------------------------------------------------------------
      Virtualization is moving to the mainstream and overtaking non-virtualized
      environment for deploying applications. Does it make network security
      easier or more difficult to achieve? Read this whitepaper to separate the
      two and get a better understanding.
      http://p.sf.net/sfu/hp-phase2-d2d
      _______________________________________________
      Cheetahtemplate-discuss mailing list
      Cheetahtemplate-discuss@...
      https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
    • R. Tyler Croy
      ... Yes, this is something I ve known about for a few weeks but still haven t had the time to install Python 2.7 to even sit down and assess the situation :-/
      Message 2 of 7 , Oct 4, 2010
      • 0 Attachment
        On Mon, 04 Oct 2010, Mike Bonnet wrote:

        > I just built Cheetah and ran the unit tests under python 2.7 (Fedora 14
        > Beta) and it spewed a ton of errors. I haven't had a chance to look
        > into them yet, but they look pretty concerning. Has anyone seen these
        > problems yet? Are we going to need serious refactoring to make Cheetah
        > work under python 2.7?
        >
        > The log is available here:
        >
        > http://people.redhat.com/mikeb/cheetah-2.4.3-python27-tests.log
        >
        > I'll start looking into possible fixes when I can.

        Yes, this is something I've known about for a few weeks but still haven't had
        the time to install Python 2.7 to even sit down and assess the situation :-/

        If you have the bandwidth, I'd gladly accept some patches and push out a new
        release (I've historically been using Cheetah with older/more stable versions
        of Python).

        - R. Tyler Croy
        --------------------------------------
        GitHub: http://github.com/rtyler
        Twitter: http://twitter.com/agentdero
      • Jon Siddle
        I ve spent a little time trying to track this down, and while I haven t quite pinned it down, I do have some more information. I ve only looked into the
        Message 3 of 7 , Oct 12, 2010
        • 0 Attachment
          I've spent a little time trying to track this down, and while I
          haven't quite pinned it down, I do have some more information. I've only
          looked into the __dict__ errors.

          * The problem seems to be with specifying a base class (changing
          {'baseclass': dict} to {'baseclass': "Template"} in SyntaxAndOutput.py
          fixes those tests).
          * Changing the base class to the following in that same file also fixes
          the problem:

          class MyClass(object):
          def __init__(*args, **kwargs):
          pass
          def shutdown(self):
          pass
          extraCompileKwArgsForDiffBaseclass = {'baseclass': MyClass}

          Any class with a shutdown method seems to work, otherwise the shutdown
          method from Template is called. I can't actually see how Template's
          shutdown method is
          being called. Someone who knows this might be able to see what's wrong here.

          It doesn't look like it would be too hard to fix for someone who knows
          the codebase.

          Has anyone else got any further with this?

          Thanks

          Jon

          On 04/10/10 21:26, Mike Bonnet wrote:
          > I just built Cheetah and ran the unit tests under python 2.7 (Fedora 14
          > Beta) and it spewed a ton of errors. I haven't had a chance to look
          > into them yet, but they look pretty concerning. Has anyone seen these
          > problems yet? Are we going to need serious refactoring to make Cheetah
          > work under python 2.7?
          >
          > The log is available here:
          >
          > http://people.redhat.com/mikeb/cheetah-2.4.3-python27-tests.log
          >
          > I'll start looking into possible fixes when I can.
          >
          > Thanks,
          > Mike
          >
          > ------------------------------------------------------------------------------
          > Virtualization is moving to the mainstream and overtaking non-virtualized
          > environment for deploying applications. Does it make network security
          > easier or more difficult to achieve? Read this whitepaper to separate the
          > two and get a better understanding.
          > http://p.sf.net/sfu/hp-phase2-d2d
          > _______________________________________________
          > Cheetahtemplate-discuss mailing list
          > Cheetahtemplate-discuss@...
          > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss


          ------------------------------------------------------------------------------
          Beautiful is writing same markup. Internet Explorer 9 supports
          standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
          Spend less time writing and rewriting code and more time creating great
          experiences on the web. Be a part of the beta today.
          http://p.sf.net/sfu/beautyoftheweb
          _______________________________________________
          Cheetahtemplate-discuss mailing list
          Cheetahtemplate-discuss@...
          https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
        • Jon Siddle
          There are 35 errors caused by a python version check which breaks under 2.7 See attached for a simple patch to fix it. More details about the change in 2.7
          Message 4 of 7 , Oct 12, 2010
          • 0 Attachment
            There are 35 errors caused by a python version check which breaks
            under 2.7

            See attached for a simple patch to fix it.

            More details about the change in 2.7 which broke it here:
            http://bugs.python.org/issue4285

            Thanks

            Jon
            On 04/10/10 21:26, Mike Bonnet wrote:
            > I just built Cheetah and ran the unit tests under python 2.7 (Fedora 14
            > Beta) and it spewed a ton of errors. I haven't had a chance to look
            > into them yet, but they look pretty concerning. Has anyone seen these
            > problems yet? Are we going to need serious refactoring to make Cheetah
            > work under python 2.7?
            >
            > The log is available here:
            >
            > http://people.redhat.com/mikeb/cheetah-2.4.3-python27-tests.log
            >
            > I'll start looking into possible fixes when I can.
            >
            > Thanks,
            > Mike
            >
            > ------------------------------------------------------------------------------
            > Virtualization is moving to the mainstream and overtaking non-virtualized
            > environment for deploying applications. Does it make network security
            > easier or more difficult to achieve? Read this whitepaper to separate the
            > two and get a better understanding.
            > http://p.sf.net/sfu/hp-phase2-d2d
            > _______________________________________________
            > Cheetahtemplate-discuss mailing list
            > Cheetahtemplate-discuss@...
            > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
          • Jon Siddle
            The remaining failures (6 of them) are line endings tests. Python 2.7 changed the behaviour of the compile() builtin (change documented at
            Message 5 of 7 , Oct 12, 2010
            • 0 Attachment
              The remaining failures (6 of them) are line endings tests. Python 2.7
              changed the behaviour of the compile() builtin (change documented
              at http://docs.python.org/dev/whatsnew/2.7.html). The following
              minimally reproduces the change:

              c = compile('x="""\r\nx\r\n"""', 'file', 'exec')
              exec(c, globals(), locals())

              print x == "\nx\n"

              Under 2.7 this prints "True". Under earlier versions of python, it prints
              "False".

              I can't see a way round this short of replacing all in-string literal
              newlines
              with "\r\n" or "\r". This would require pre-parsing the template to find
              the strings. Hopefully there's a nicer way.

              We don't actually care that literal line endings get converted to UNIX
              line endings; does this matter to anyone? Would it be easier to require
              non-UNIX line endings to be escaped?

              Thanks

              Jon

              On 04/10/10 21:26, Mike Bonnet wrote:
              > I just built Cheetah and ran the unit tests under python 2.7 (Fedora 14
              > Beta) and it spewed a ton of errors. I haven't had a chance to look
              > into them yet, but they look pretty concerning. Has anyone seen these
              > problems yet? Are we going to need serious refactoring to make Cheetah
              > work under python 2.7?
              >
              > The log is available here:
              >
              > http://people.redhat.com/mikeb/cheetah-2.4.3-python27-tests.log
              >
              > I'll start looking into possible fixes when I can.
              >
              > Thanks,
              > Mike
              >
              > ------------------------------------------------------------------------------
              > Virtualization is moving to the mainstream and overtaking non-virtualized
              > environment for deploying applications. Does it make network security
              > easier or more difficult to achieve? Read this whitepaper to separate the
              > two and get a better understanding.
              > http://p.sf.net/sfu/hp-phase2-d2d
              > _______________________________________________
              > Cheetahtemplate-discuss mailing list
              > Cheetahtemplate-discuss@...
              > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss


              ------------------------------------------------------------------------------
              Beautiful is writing same markup. Internet Explorer 9 supports
              standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
              Spend less time writing and rewriting code and more time creating great
              experiences on the web. Be a part of the beta today.
              http://p.sf.net/sfu/beautyoftheweb
              _______________________________________________
              Cheetahtemplate-discuss mailing list
              Cheetahtemplate-discuss@...
              https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
            • Mike Bonnet
              ... Great job tracking this down Jon. I ve applied your patch and rebuilt Cheetah for Fedora:
              Message 6 of 7 , Oct 19, 2010
              • 0 Attachment
                On 10/12/2010 09:01 AM, Jon Siddle wrote:
                > There are 35 errors caused by a python version check which breaks
                > under 2.7
                >
                > See attached for a simple patch to fix it.
                >
                > More details about the change in 2.7 which broke it here:
                > http://bugs.python.org/issue4285

                Great job tracking this down Jon. I've applied your patch and rebuilt
                Cheetah for Fedora:

                http://pkgs.fedoraproject.org/gitweb/?p=python-cheetah.git;a=commit;h=HEAD
                http://koji.fedoraproject.org/koji/buildinfo?buildID=200978

                cheetah-2.4-python2.7-compat.patch also turns off convertEOLs on 3 tests
                that were failing because of changes to the compile(), as you noted in
                your other message. Not sure if there's a better way to handle it, but
                for now this allows the tests to pass.

                The two other patches fix a warning from setuptools, and cause "cheetah
                test" to return with a non-zero exit code when tests are failing. Worth
                picking up for the next release?

                Thanks,
                Mike

                > Thanks
                >
                > Jon
                > On 04/10/10 21:26, Mike Bonnet wrote:
                >> I just built Cheetah and ran the unit tests under python 2.7 (Fedora 14
                >> Beta) and it spewed a ton of errors. I haven't had a chance to look
                >> into them yet, but they look pretty concerning. Has anyone seen these
                >> problems yet? Are we going to need serious refactoring to make Cheetah
                >> work under python 2.7?
                >>
                >> The log is available here:
                >>
                >> http://people.redhat.com/mikeb/cheetah-2.4.3-python27-tests.log
                >>
                >> I'll start looking into possible fixes when I can.
                >>
                >> Thanks,
                >> Mike
                >>
                >> ------------------------------------------------------------------------------
                >>
                >> Virtualization is moving to the mainstream and overtaking non-virtualized
                >> environment for deploying applications. Does it make network security
                >> easier or more difficult to achieve? Read this whitepaper to separate the
                >> two and get a better understanding.
                >> http://p.sf.net/sfu/hp-phase2-d2d
                >> _______________________________________________
                >> Cheetahtemplate-discuss mailing list
                >> Cheetahtemplate-discuss@...
                >> https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
                >
                >
                >
                >
                > ------------------------------------------------------------------------------
                > Beautiful is writing same markup. Internet Explorer 9 supports
                > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
                > Spend less time writing and rewriting code and more time creating great
                > experiences on the web. Be a part of the beta today.
                > http://p.sf.net/sfu/beautyoftheweb
                >
                >
                >
                > _______________________________________________
                > Cheetahtemplate-discuss mailing list
                > Cheetahtemplate-discuss@...
                > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss


                ------------------------------------------------------------------------------
                Download new Adobe(R) Flash(R) Builder(TM) 4
                The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
                Flex(R) Builder(TM)) enable the development of rich applications that run
                across multiple browsers and platforms. Download your free trials today!
                http://p.sf.net/sfu/adobe-dev2dev
                _______________________________________________
                Cheetahtemplate-discuss mailing list
                Cheetahtemplate-discuss@...
                https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
              • R. Tyler Croy
                ... If there s no objections, I might just move the tests over to nose so we can do proper test skipping. ... - R. Tyler Croy ... GitHub:
                Message 7 of 7 , Oct 20, 2010
                • 0 Attachment
                  On Tue, 19 Oct 2010, Mike Bonnet wrote:

                  > On 10/12/2010 09:01 AM, Jon Siddle wrote:
                  > > There are 35 errors caused by a python version check which breaks
                  > > under 2.7
                  > >
                  > > See attached for a simple patch to fix it.
                  > >
                  > > More details about the change in 2.7 which broke it here:
                  > > http://bugs.python.org/issue4285
                  >
                  > Great job tracking this down Jon. I've applied your patch and rebuilt
                  > Cheetah for Fedora:
                  >
                  > http://pkgs.fedoraproject.org/gitweb/?p=python-cheetah.git;a=commit;h=HEAD
                  > http://koji.fedoraproject.org/koji/buildinfo?buildID=200978
                  >
                  > cheetah-2.4-python2.7-compat.patch also turns off convertEOLs on 3 tests
                  > that were failing because of changes to the compile(), as you noted in
                  > your other message. Not sure if there's a better way to handle it, but
                  > for now this allows the tests to pass.
                  >
                  > The two other patches fix a warning from setuptools, and cause "cheetah
                  > test" to return with a non-zero exit code when tests are failing. Worth
                  > picking up for the next release?


                  If there's no objections, I might just move the tests over to nose so we can do
                  proper test skipping.


                  >
                  > Thanks,
                  > Mike
                  >
                  > > Thanks
                  > >
                  > > Jon
                  > > On 04/10/10 21:26, Mike Bonnet wrote:
                  > >> I just built Cheetah and ran the unit tests under python 2.7 (Fedora 14
                  > >> Beta) and it spewed a ton of errors. I haven't had a chance to look
                  > >> into them yet, but they look pretty concerning. Has anyone seen these
                  > >> problems yet? Are we going to need serious refactoring to make Cheetah
                  > >> work under python 2.7?
                  > >>
                  > >> The log is available here:
                  > >>
                  > >> http://people.redhat.com/mikeb/cheetah-2.4.3-python27-tests.log
                  > >>
                  > >> I'll start looking into possible fixes when I can.
                  > >>
                  > >> Thanks,
                  > >> Mike
                  > >>
                  > >> ------------------------------------------------------------------------------
                  > >>
                  > >> Virtualization is moving to the mainstream and overtaking non-virtualized
                  > >> environment for deploying applications. Does it make network security
                  > >> easier or more difficult to achieve? Read this whitepaper to separate the
                  > >> two and get a better understanding.
                  > >> http://p.sf.net/sfu/hp-phase2-d2d
                  > >> _______________________________________________
                  > >> Cheetahtemplate-discuss mailing list
                  > >> Cheetahtemplate-discuss@...
                  > >> https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
                  > >
                  > >
                  > >
                  > >
                  > > ------------------------------------------------------------------------------
                  > > Beautiful is writing same markup. Internet Explorer 9 supports
                  > > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
                  > > Spend less time writing and rewriting code and more time creating great
                  > > experiences on the web. Be a part of the beta today.
                  > > http://p.sf.net/sfu/beautyoftheweb
                  > >
                  > >
                  > >
                  > > _______________________________________________
                  > > Cheetahtemplate-discuss mailing list
                  > > Cheetahtemplate-discuss@...
                  > > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
                  >
                  >
                  > ------------------------------------------------------------------------------
                  > Download new Adobe(R) Flash(R) Builder(TM) 4
                  > The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
                  > Flex(R) Builder(TM)) enable the development of rich applications that run
                  > across multiple browsers and platforms. Download your free trials today!
                  > http://p.sf.net/sfu/adobe-dev2dev
                  > _______________________________________________
                  > Cheetahtemplate-discuss mailing list
                  > Cheetahtemplate-discuss@...
                  > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
                  - R. Tyler Croy
                  --------------------------------------
                  GitHub: http://github.com/rtyler
                  Twitter: http://twitter.com/agentdero
                Your message has been successfully submitted and would be delivered to recipients shortly.