Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d03298c8
Commit
d03298c8
authored
Jun 24, 2010
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #8949: "z" format of PyArg_Parse*() functions doesn't accept bytes
objects, as described in the documentation.
parent
ab00b665
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
6 deletions
+4
-6
Lib/test/test_getargs2.py
Lib/test/test_getargs2.py
+1
-1
Misc/NEWS
Misc/NEWS
+3
-0
Python/getargs.c
Python/getargs.c
+0
-5
No files found.
Lib/test/test_getargs2.py
View file @
d03298c8
...
@@ -325,7 +325,7 @@ class Bytes_TestCase(unittest.TestCase):
...
@@ -325,7 +325,7 @@ class Bytes_TestCase(unittest.TestCase):
from
_testcapi
import
getargs_z
from
_testcapi
import
getargs_z
self
.
assertEqual
(
getargs_z
(
'abc
\
xe9
'
),
b'abc
\
xc3
\
xa9
'
)
self
.
assertEqual
(
getargs_z
(
'abc
\
xe9
'
),
b'abc
\
xc3
\
xa9
'
)
self
.
assertRaises
(
TypeError
,
getargs_z
,
'nul:
\
0
'
)
self
.
assertRaises
(
TypeError
,
getargs_z
,
'nul:
\
0
'
)
self
.
assert
Equal
(
getargs_z
(
b'bytes'
)
,
b'bytes'
)
self
.
assert
Raises
(
TypeError
,
getargs_z
,
b'bytes'
)
self
.
assertRaises
(
TypeError
,
getargs_z
,
bytearray
(
b'bytearray'
))
self
.
assertRaises
(
TypeError
,
getargs_z
,
bytearray
(
b'bytearray'
))
self
.
assertRaises
(
TypeError
,
getargs_z
,
memoryview
(
b'memoryview'
))
self
.
assertRaises
(
TypeError
,
getargs_z
,
memoryview
(
b'memoryview'
))
self
.
assertIsNone
(
getargs_z
(
None
))
self
.
assertIsNone
(
getargs_z
(
None
))
...
...
Misc/NEWS
View file @
d03298c8
...
@@ -12,6 +12,9 @@ What's New in Python 3.2 Alpha 1?
...
@@ -12,6 +12,9 @@ What's New in Python 3.2 Alpha 1?
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #8949: "z" format of PyArg_Parse*() functions doesn't accept bytes
objects, as described in the documentation.
- Issue #6543: Write the traceback in the terminal encoding instead of utf-8.
- Issue #6543: Write the traceback in the terminal encoding instead of utf-8.
Fix the encoding of the modules filename. Patch written by Amaury Forgeot
Fix the encoding of the modules filename. Patch written by Amaury Forgeot
d'Arc.
d'Arc.
...
...
Python/getargs.c
View file @
d03298c8
...
@@ -1005,11 +1005,6 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
...
@@ -1005,11 +1005,6 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
if
(
arg
==
Py_None
)
if
(
arg
==
Py_None
)
*
p
=
0
;
*
p
=
0
;
else
if
(
PyBytes_Check
(
arg
))
{
/* Enable null byte check below */
uarg
=
arg
;
*
p
=
PyBytes_AS_STRING
(
arg
);
}
else
if
(
PyUnicode_Check
(
arg
))
{
else
if
(
PyUnicode_Check
(
arg
))
{
uarg
=
UNICODE_DEFAULT_ENCODING
(
arg
);
uarg
=
UNICODE_DEFAULT_ENCODING
(
arg
);
if
(
uarg
==
NULL
)
if
(
uarg
==
NULL
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment