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
9f1c1dcd
Commit
9f1c1dcd
authored
Nov 20, 2010
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#10465: fix broken delegation in __getattr__ of _PaddedFile.
parent
4ccc137a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
Lib/gzip.py
Lib/gzip.py
+1
-1
Lib/test/test_gzip.py
Lib/test/test_gzip.py
+6
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/gzip.py
View file @
9f1c1dcd
...
...
@@ -98,7 +98,7 @@ class _PaddedFile:
return
self
.
file
.
seek
(
offset
,
whence
)
def
__getattr__
(
self
,
name
):
return
getattr
(
name
,
self
.
fil
e
)
return
getattr
(
self
.
file
,
nam
e
)
class
GzipFile
(
io
.
BufferedIOBase
):
...
...
Lib/test/test_gzip.py
View file @
9f1c1dcd
...
...
@@ -197,6 +197,12 @@ class TestGzip(unittest.TestCase):
self
.
assertTrue
(
hasattr
(
f
,
"name"
))
self
.
assertEqual
(
f
.
name
,
self
.
filename
)
def
test_paddedfile_getattr
(
self
):
self
.
test_write
()
with
gzip
.
GzipFile
(
self
.
filename
,
'rb'
)
as
f
:
self
.
assertTrue
(
hasattr
(
f
.
fileobj
,
"name"
))
self
.
assertEqual
(
f
.
fileobj
.
name
,
self
.
filename
)
def
test_mtime
(
self
):
mtime
=
123456789
with
gzip
.
GzipFile
(
self
.
filename
,
'w'
,
mtime
=
mtime
)
as
fWrite
:
...
...
Misc/NEWS
View file @
9f1c1dcd
...
...
@@ -117,6 +117,8 @@ Core and Builtins
Library
-------
- Issue #10465: fix broken delegating of attributes by gzip._PaddedFile.
- Issue #10356: hash(Decimal("sNaN")) now raises ValueError instead of
TypeError.
...
...
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