Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
storagedriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a73e7d2e
authored
Feb 06, 2016
by
Őry Máté
Committed by
Mate Ory
Feb 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disk: fix typo in magic decompression (bz2)
parent
7de1a3f5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
disk.py
+3
-1
No files found.
disk.py
View file @
a73e7d2e
...
...
@@ -210,6 +210,8 @@ class Disk(object):
# undocumented zlib feature http://stackoverflow.com/a/2424549
elif
ext
==
'bz2'
:
decompressor
=
BZ2Decompressor
()
else
:
decompressor
=
None
clen
=
int
(
r
.
headers
.
get
(
'content-length'
,
maximum_size
))
if
clen
>
maximum_size
:
raise
FileTooBig
()
...
...
@@ -217,7 +219,7 @@ class Disk(object):
try
:
with
open
(
disk_path
,
'wb'
)
as
f
:
for
chunk
in
r
.
iter_content
(
chunk_size
=
chunk_size
):
if
ext
in
(
'gz'
,
'bz'
)
:
if
decompressor
:
chunk
=
decompressor
.
decompress
(
chunk
)
f
.
write
(
chunk
)
actsize
=
f
.
tell
()
...
...
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