Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 6f3e109f2cad953efb467f0afbb7b61b89914f64 authored by cvs2svn on 22 May 2003, 19:13:35 UTC
This commit was manufactured by cvs2svn to create tag 'r223c1'.
Tip revision: 6f3e109
test_getargs.py
"""Test the internal getargs.c implementation

 PyArg_ParseTuple() is defined here.

The test here is not intended to test all of the module, just the
single case that failed between 2.1 and 2.2a2.
"""

# marshal.loads() uses PyArg_ParseTuple(args, "s#:loads")
# The s code will cause a Unicode conversion to occur.  This test
# verify that the error is propagated properly from the C code back to
# Python.

# XXX If the encoding succeeds using the current default encoding,
# this test will fail because it does not test the right part of the
# PyArg_ParseTuple() implementation.
import marshal
try:
    marshal.loads(u"\222")
except UnicodeError:
    pass
back to top