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
3f144c2a
Commit
3f144c2a
authored
Jan 06, 2014
by
Larry Hastings
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #20142: Py_buffer variables generated by Argument Clinic are now
initialized with a default value.
parent
b7f5dcad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
Misc/NEWS
Misc/NEWS
+5
-0
Modules/zlibmodule.c
Modules/zlibmodule.c
+4
-4
Tools/clinic/clinic.py
Tools/clinic/clinic.py
+9
-1
No files found.
Misc/NEWS
View file @
3f144c2a
...
...
@@ -13,6 +13,11 @@ Core and Builtins
Library
-------
Tools/Demos
-----------
- Issue #20142: Py_buffer variables generated by Argument Clinic are now
initialized with a default value.
What'
s
New
in
Python
3.4.0
Beta
2
?
==================================
...
...
Modules/zlibmodule.c
View file @
3f144c2a
...
...
@@ -198,7 +198,7 @@ static PyObject *
zlib_compress
(
PyModuleDef
*
module
,
PyObject
*
args
)
{
PyObject
*
return_value
=
NULL
;
Py_buffer
bytes
;
Py_buffer
bytes
=
{
NULL
,
NULL
,
0
,
0
,
0
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
}
;
int
group_right_1
=
0
;
int
level
=
0
;
...
...
@@ -227,7 +227,7 @@ zlib_compress(PyModuleDef *module, PyObject *args)
static
PyObject
*
zlib_compress_impl
(
PyModuleDef
*
module
,
Py_buffer
*
bytes
,
int
group_right_1
,
int
level
)
/*[clinic checksum:
f490708eff84be652b5ebe7fe622ab73ac12c888
]*/
/*[clinic checksum:
9f055a396620bc1a8a13d74c3496249528b32b0d
]*/
{
PyObject
*
ReturnVal
=
NULL
;
Byte
*
input
,
*
output
=
NULL
;
...
...
@@ -789,7 +789,7 @@ static PyObject *
zlib_Decompress_decompress
(
PyObject
*
self
,
PyObject
*
args
)
{
PyObject
*
return_value
=
NULL
;
Py_buffer
data
;
Py_buffer
data
=
{
NULL
,
NULL
,
0
,
0
,
0
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
}
;
unsigned
int
max_length
=
0
;
if
(
!
PyArg_ParseTuple
(
args
,
...
...
@@ -808,7 +808,7 @@ exit:
static
PyObject
*
zlib_Decompress_decompress_impl
(
compobject
*
self
,
Py_buffer
*
data
,
unsigned
int
max_length
)
/*[clinic checksum:
3599698948f5a712f5a8309491671cc2ce969d2c
]*/
/*[clinic checksum:
5b1e4f9f1ef8eca55fff78356f9df0c81232ed3b
]*/
{
int
err
;
unsigned
int
old_length
,
length
=
DEFAULTALLOC
;
...
...
Tools/clinic/clinic.py
View file @
3f144c2a
...
...
@@ -1488,7 +1488,12 @@ class CConverter(metaclass=CConverterAutoRegister):
declaration
.
append
(
'
\
n
Py_ssize_clean_t '
)
declaration
.
append
(
self
.
length_name
())
declaration
.
append
(
';'
)
return
""
.
join
(
declaration
)
s
=
""
.
join
(
declaration
)
# double up curly-braces, this string will be used
# as part of a format_map() template later
s
=
s
.
replace
(
"{"
,
"{{"
)
s
=
s
.
replace
(
"}"
,
"}}"
)
return
s
def
initialize
(
self
):
"""
...
...
@@ -1742,6 +1747,9 @@ class Py_buffer_converter(CConverter):
c_ignored_default
=
"{NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL}"
def
converter_init
(
self
,
*
,
types
=
'bytes bytearray buffer'
,
nullable
=
False
):
if
self
.
default
!=
unspecified
:
fail
(
"There is no legal default value for Py_buffer "
)
self
.
c_default
=
self
.
c_ignored_default
types
=
set
(
types
.
strip
().
split
())
bytes_type
=
set
((
'bytes'
,))
bytearray_type
=
set
((
'bytearray'
,))
...
...
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