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
1119a649
Commit
1119a649
authored
Jan 17, 2010
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #7561: Fix crashes when using bytearray objects with the posix
module.
parent
4c1718c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
Lib/test/test_os.py
Lib/test/test_os.py
+9
-0
Misc/NEWS
Misc/NEWS
+3
-0
Modules/posixmodule.c
Modules/posixmodule.c
+1
-1
No files found.
Lib/test/test_os.py
View file @
1119a649
...
...
@@ -564,6 +564,14 @@ class ExecTests(unittest.TestCase):
def
test_execvpe_with_bad_arglist
(
self
):
self
.
assertRaises
(
ValueError
,
os
.
execvpe
,
'notepad'
,
[],
None
)
class
ArgTests
(
unittest
.
TestCase
):
def
test_bytearray
(
self
):
# Issue #7561: posix module didn't release bytearray exports properly.
b
=
bytearray
(
os
.
sep
.
encode
(
'ascii'
))
self
.
assertRaises
(
OSError
,
os
.
mkdir
,
b
)
# Check object is still resizable.
b
[:]
=
b''
class
Win32ErrorTests
(
unittest
.
TestCase
):
def
test_rename
(
self
):
self
.
assertRaises
(
WindowsError
,
os
.
rename
,
support
.
TESTFN
,
support
.
TESTFN
+
".bak"
)
...
...
@@ -750,6 +758,7 @@ else:
def
test_main
():
support
.
run_unittest
(
ArgTests
,
FileTests
,
StatAttributeTests
,
EnvironTests
,
...
...
Misc/NEWS
View file @
1119a649
...
...
@@ -223,6 +223,9 @@ C-API
Library
-------
- Issue #7561: Fix crashes when using bytearray objects with the posix
module.
- Issue #1670765: Prevent email.generator.Generator from re-wrapping
headers in multipart/signed MIME parts, which fixes one of the sources of
invalid modifications to such parts by Generator.
...
...
Modules/posixmodule.c
View file @
1119a649
...
...
@@ -580,7 +580,7 @@ static void
release_bytes
(
PyObject
*
o
)
{
if
(
PyByteArray_Check
(
o
))
o
->
ob_type
->
tp_as_buffer
->
bf_releasebuffer
(
NULL
,
0
);
o
->
ob_type
->
tp_as_buffer
->
bf_releasebuffer
(
o
,
0
);
Py_DECREF
(
o
);
}
...
...
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