RELEASED Python 2.4, alpha 1

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martin v. Löwis

    #16
    Re: RELEASED Python 2.4, alpha 1

    Irmen de Jong wrote:[color=blue]
    > I'm wondering where the u'1,000000' comes from... because when I type
    > on the interactive prompt:
    > Python 2.4a1 (#1, Jul 9 2004, 15:42:46)
    > [GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2
    > Type "help", "copyright" , "credits" or "license" for more information.[color=green][color=darkred]
    > >>> u'%f' % (1.0,)[/color][/color]
    > u'1.000000'[color=green][color=darkred]
    > >>>[/color][/color][/color]

    Does the test also fail if you run it as "python Lib/test/regrtest.py
    test_format"? If not, does it fail if you run it as
    python Lib/test/regrtest.py <all test cases that are executed before
    test_format> test_format? If yes, please try to eliminate all prior
    test cases that don't contribute to the failure, and report the
    minimum sequence of test cases needed to make it fail.

    Regards,
    Martin

    Comment

    • Martin v. Löwis

      #17
      Re: RELEASED Python 2.4, alpha 1

      Irmen de Jong wrote:[color=blue]
      > I'm wondering where the u'1,000000' comes from... because when I type
      > on the interactive prompt:
      > Python 2.4a1 (#1, Jul 9 2004, 15:42:46)
      > [GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2
      > Type "help", "copyright" , "credits" or "license" for more information.[color=green][color=darkred]
      > >>> u'%f' % (1.0,)[/color][/color]
      > u'1.000000'[color=green][color=darkred]
      > >>>[/color][/color][/color]

      Does the test also fail if you run it as "python Lib/test/regrtest.py
      test_format"? If not, does it fail if you run it as
      python Lib/test/regrtest.py <all test cases that are executed before
      test_format> test_format? If yes, please try to eliminate all prior
      test cases that don't contribute to the failure, and report the
      minimum sequence of test cases needed to make it fail.

      Regards,
      Martin

      Comment

      • Tim Peters

        #18
        Re: test_format fails (was: Re: RELEASED Python 2.4, alpha 1)

        [Irmen de Jong]
        ,,,[color=blue]
        > As Michael Hudson pointed out it's probably a test that
        > messes with the locale settings and forgets to set them back,
        > or some such.[/color]

        In case you don't already know it, regrtest.py's little-used -f
        argument lets you specify a file, containing the names of the tests
        you want to run. It ignore lines in the file starting with '#'. So
        it's a convenient way to do a binary-search kind of reduction when
        looking for a minimal *set* of failing tests: edit the file, run,
        stick '#' in front of half the remaining lines if it still fails then,
        etc.

        Comment

        • Martin v. Löwis

          #19
          Re: test_format fails

          Irmen de Jong wrote:[color=blue]
          > I'll try when I have some time for that...
          > As Michael Hudson pointed out it's probably a test that
          > messes with the locale settings and forgets to set them back,
          > or some such.[/color]

          Rather "some such". If this was a systematic error, it would
          fail for many more people.

          Regards,
          Martin

          Comment

          • Irmen de Jong

            #20
            Re: test_format fails (because of test__locale)

            Tim Peters wrote:
            [color=blue]
            > [Irmen de Jong]
            > ,,,
            >[color=green]
            >>As Michael Hudson pointed out it's probably a test that
            >>messes with the locale settings and forgets to set them back,
            >>or some such.[/color]
            >
            >
            > In case you don't already know it, regrtest.py's little-used -f
            > argument lets you specify a file, containing the names of the tests
            > you want to run.[/color]

            That was great, I quickly found out that test__locale is the cause.
            Not only test_format but also test_unicode fail on my Mandrake 10 box.
            My default locale is nl_NL. Behold:

            [irmen@atlantis Python-2.4a1]$ cat testcases.in
            test__locale
            test_format
            test_unicode

            [irmen@atlantis Python-2.4a1]$ ./python Lib/test/regrtest.py -f testcases.in
            test__locale
            test_format
            test test_format produced unexpected output:
            *************** *************** *************** *************** **********
            *** line 2 of actual output doesn't appear in expected output after line 1:
            + u'%f' % (1.0,) == u'1,000000' != '1.000000'
            *************** *************** *************** *************** **********
            test_unicode
            test test_unicode failed -- Traceback (most recent call last):
            File "/home/irmen/BUILD/Python-2.4a1/Lib/test/test_unicode.py ", line 358, in
            test_formatt ing
            string_tests.Mi xinStrUnicodeUs erStringTest.te st_formatting(s elf)
            File "/home/irmen/BUILD/Python-2.4a1/Lib/test/string_tests.py ", line 615, in
            test_formatt ing
            self.checkequal ('0042.00', '%07.2f', '__mod__', 42)
            File "/home/irmen/BUILD/Python-2.4a1/Lib/test/string_tests.py ", line 56, in checkequal
            realresult
            AssertionError: u'0042.00' != u'0042,00'

            1 test OK.
            2 tests failed:
            test_format test_unicode
            [irmen@atlantis Python-2.4a1]$


            --Irmen

            Comment

            • Martin v. Löwis

              #21
              Re: test_format fails (because of test__locale)

              Irmen de Jong wrote:[color=blue]
              > That was great, I quickly found out that test__locale is the cause.
              > Not only test_format but also test_unicode fail on my Mandrake 10 box.
              > My default locale is nl_NL.[/color]

              Ok. Can you please run test__locale in verbose mode to find out what
              the last locale is that it uses? Let's call it X.

              Can you please then run interactively

              locale.setlocal e(locale.LC_NUM ERIC, X)
              print '%07.2f' % 42

              It appears from the test results that this gives '0042,00' for
              you; please confirm that it does.

              It is bad that test__locale does not restore the locale, but perhaps
              we take out that test entirely. However, the behaviour of % is not
              supposed to change, so we need to investigate why it changes on your
              machine.

              Regards,
              Martin

              Comment

              • Irmen de Jong

                #22
                Re: test_format fails (because of test__locale)

                Irmen de Jong wrote:[color=blue]
                > That was great, I quickly found out that test__locale is the cause.
                > Not only test_format but also test_unicode fail on my Mandrake 10 box.
                > My default locale is nl_NL. Behold:[/color]
                [...]

                I just saw that there are already 2 bug reports on this on
                the bug tracker, to which I have added my observations:
                bug #992078
                bug #992081


                --Irmen.

                Comment

                Working...