Jeremy Hylton | f649195 | 2001-09-10 01:57:12 +0000 | [diff] [blame] | 1 | """Test the internal getargs.c implementation |
| 2 | |
| 3 | PyArg_ParseTuple() is defined here. |
| 4 | |
| 5 | The test here is not intended to test all of the module, just the |
| 6 | single case that failed between 2.1 and 2.2a2. |
| 7 | """ |
| 8 | |
| 9 | # marshal.loads() uses PyArg_ParseTuple(args, "s#:loads") |
| 10 | # The s code will cause a Unicode conversion to occur. This test |
| 11 | # verify that the error is propagated properly from the C code back to |
| 12 | # Python. |
| 13 | |
| 14 | # XXX If the encoding succeeds using the current default encoding, |
| 15 | # this test will fail because it does not test the right part of the |
| 16 | # PyArg_ParseTuple() implementation. |
Barry Warsaw | 408b6d3 | 2002-07-30 23:27:12 +0000 | [diff] [blame] | 17 | from test.test_support import have_unicode |
Jeremy Hylton | f649195 | 2001-09-10 01:57:12 +0000 | [diff] [blame] | 18 | import marshal |
Michael W. Hudson | 7b7ba54 | 2002-05-20 14:54:17 +0000 | [diff] [blame] | 19 | |
| 20 | if have_unicode: |
| 21 | try: |
| 22 | marshal.loads(unicode(r"\222", 'unicode-escape')) |
| 23 | except UnicodeError: |
| 24 | pass |