#133 Return of the failed UNICODE test error

closed-fixed
nobody
None
5
2010-03-30
2010-03-18
No

This problem has been reported in issues 2896512 and 1453551 previously and although revision 6201 was supposed to fix this issue, it's still rearing its head.

The specific test is part of the test/test_parser/test_rst/test_directives/test_include.py suite and generally manifests a mismatch between two different error conditions, i.e.:

- ValueError: unichr() arg not in range(0x110000) (wide Python build)
+ ValueError: code too large (long int too large to convert to int)

Now, the comment in 2896512 says that the unichr message is valid in Python 2.6.4 but the thing is, I don't think we have a 'Requires Python 2.6.4 or greater' to run docutils rule. So, IMHO, whatever our minimum version is despite this error, it should remain as such. Now, the expected result string for this error is actually templated, and there is a 'unichr_exception' keyword being passed to the template but it is *not* currently being used (as of 6267) in the template string. Even if it was, the output from

>>> DocutilsTestSupport.exception_data(unichr, int("0xFFFFFFFFF", 16))[2]

Is not a match for either of the formally produced errors: neither the expected nor the actual value. The result for me is typically close to that for the actual error, but not exactly right in a fully templatable way.

Anyway, all that being said, I'd like to take a crack at fixing this myself, but I only at the moment have access to 3 python versions:

Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
- ValueError: unichr() arg not in range(0x110000) (wide Python build)
+ ValueError: code too large (long int too large to convert to int)

Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
- ValueError: unichr() arg not in range(0x110000) (wide Python build)
+ ValueError: code too large (long int too large to convert to int)

Python 2.5.2 (r252:60911, Dec 2 2008, 09:26:14)
[GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin
- ValueError: unichr() arg not in range(0x110000) (wide Python build)
+ ValueError: code too large (long int too large to convert to int)

All three produce the given error. My guess is that it should be 'unichr' from 2.6.4 onward, but remain "code too large" for versions of Python less than that. However, it would be helpful and save me the time of installing multiple versions of Python for a variety of different platforms if some of you could post your Python version info and whether you're failing the test_include.py suite and if you are, what are your expected / actual lines?

Thanks!

Discussion

  • Jeffrey C. Jacobs

    Patch for test/test_parser/test_rst/test_directives/test_include.py to allow the test to run on version of Python prior to 2.6.4

     
  • Jeffrey C. Jacobs

    Working now thanks to a patch by Günter! Thanks!

     
  • Jeffrey C. Jacobs

    • status: open --> closed-fixed
     

Log in to post a comment.