Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
f001445d
Commit
f001445d
authored
Mar 30, 2011
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make LimitSizeFS more robust
parent
92e3024b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
139 additions
and
75 deletions
+139
-75
fs/base.py
+3
-0
fs/tests/__init__.py
+1
-1
fs/wrapfs/limitsizefs.py
+135
-74
No files found.
fs/base.py
View file @
f001445d
...
@@ -971,6 +971,9 @@ class FS(object):
...
@@ -971,6 +971,9 @@ class FS(object):
try
:
try
:
src_file
=
self
.
open
(
src
,
"rb"
)
src_file
=
self
.
open
(
src
,
"rb"
)
self
.
setcontents
(
dst
,
src_file
,
chunk_size
=
chunk_size
)
self
.
setcontents
(
dst
,
src_file
,
chunk_size
=
chunk_size
)
except
ResourceNotFoundError
:
if
self
.
exists
(
src
)
and
not
self
.
exists
(
dirname
(
dst
)):
raise
ParentDirectoryMissingError
(
dst
)
finally
:
finally
:
if
src_file
is
not
None
:
if
src_file
is
not
None
:
src_file
.
close
()
src_file
.
close
()
...
...
fs/tests/__init__.py
View file @
f001445d
...
@@ -788,7 +788,7 @@ class FSTestCases(object):
...
@@ -788,7 +788,7 @@ class FSTestCases(object):
def
test_big_file
(
self
):
def
test_big_file
(
self
):
"""Test
big files
(1MB)"""
"""Test
handling of a big file
(1MB)"""
chunk_size
=
1024
*
256
chunk_size
=
1024
*
256
num_chunks
=
4
num_chunks
=
4
def
chunk_stream
():
def
chunk_stream
():
...
...
fs/wrapfs/limitsizefs.py
View file @
f001445d
This diff is collapsed.
Click to expand it.
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