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
b0300ad4
Commit
b0300ad4
authored
Jul 10, 2009
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more comprehensive pickleability unit test
parent
aa118ef1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
+8
-4
fs/base.py
+2
-2
fs/expose/fuse/__init__.py
+1
-1
fs/osfs.py
+2
-1
fs/tests/__init__.py
+3
-0
No files found.
fs/base.py
View file @
b0300ad4
...
@@ -584,9 +584,9 @@ class FS(object):
...
@@ -584,9 +584,9 @@ class FS(object):
except
OSError
:
except
OSError
:
pass
pass
def
movefile_noerrors
(
src
,
dst
,
overwrite
):
def
movefile_noerrors
(
src
,
dst
,
overwrite
,
chunk_size
):
try
:
try
:
return
self
.
move
(
src
,
dst
,
overwrite
)
return
self
.
move
(
src
,
dst
,
overwrite
,
chunk_size
)
except
FSError
:
except
FSError
:
return
return
if
ignore_errors
:
if
ignore_errors
:
...
...
fs/expose/fuse/__init__.py
View file @
b0300ad4
...
@@ -410,7 +410,6 @@ class MountProcess(subprocess.Popen):
...
@@ -410,7 +410,6 @@ class MountProcess(subprocess.Popen):
if
nowait
or
kwds
.
get
(
"close_fds"
,
False
):
if
nowait
or
kwds
.
get
(
"close_fds"
,
False
):
cmd
=
'from fs.expose.fuse import MountProcess; '
cmd
=
'from fs.expose.fuse import MountProcess; '
cmd
=
cmd
+
'MountProcess._do_mount_nowait(
%
s)'
cmd
=
cmd
+
'MountProcess._do_mount_nowait(
%
s)'
cmd
=
cmd
%
(
pickle
.
dumps
((
fs
,
path
,
fuse_opts
)),)
cmd
=
cmd
%
(
repr
(
pickle
.
dumps
((
fs
,
path
,
fuse_opts
),
-
1
)),)
cmd
=
cmd
%
(
repr
(
pickle
.
dumps
((
fs
,
path
,
fuse_opts
),
-
1
)),)
cmd
=
[
sys
.
executable
,
"-c"
,
cmd
]
cmd
=
[
sys
.
executable
,
"-c"
,
cmd
]
super
(
MountProcess
,
self
)
.
__init__
(
cmd
,
**
kwds
)
super
(
MountProcess
,
self
)
.
__init__
(
cmd
,
**
kwds
)
...
@@ -430,6 +429,7 @@ class MountProcess(subprocess.Popen):
...
@@ -430,6 +429,7 @@ class MountProcess(subprocess.Popen):
self
.
terminate
()
self
.
terminate
()
def
killme
():
def
killme
():
self
.
kill
()
self
.
kill
()
time
.
sleep
(
0.1
)
try
:
try
:
unmount
(
self
.
path
)
unmount
(
self
.
path
)
except
OSError
:
except
OSError
:
...
...
fs/osfs.py
View file @
b0300ad4
...
@@ -33,7 +33,8 @@ class OSFS(FS):
...
@@ -33,7 +33,8 @@ class OSFS(FS):
return
"<OSFS:
%
s>"
%
self
.
root_path
return
"<OSFS:
%
s>"
%
self
.
root_path
def
getsyspath
(
self
,
path
,
allow_none
=
False
):
def
getsyspath
(
self
,
path
,
allow_none
=
False
):
sys_path
=
os
.
path
.
join
(
self
.
root_path
,
relpath
(
path
))
.
replace
(
'/'
,
os
.
sep
)
path
=
relpath
(
path
)
.
replace
(
'/'
,
os
.
sep
)
sys_path
=
os
.
path
.
join
(
self
.
root_path
,
path
)
return
sys_path
return
sys_path
@convert_os_errors
@convert_os_errors
...
...
fs/tests/__init__.py
View file @
b0300ad4
...
@@ -258,6 +258,7 @@ class FSTestCases:
...
@@ -258,6 +258,7 @@ class FSTestCases:
self
.
fs
.
movedir
(
"a"
,
"copy of a"
)
self
.
fs
.
movedir
(
"a"
,
"copy of a"
)
self
.
assert_
(
self
.
fs
.
isdir
(
"copy of a"
))
self
.
assert_
(
check
(
"copy of a/1.txt"
))
self
.
assert_
(
check
(
"copy of a/1.txt"
))
self
.
assert_
(
check
(
"copy of a/2.txt"
))
self
.
assert_
(
check
(
"copy of a/2.txt"
))
self
.
assert_
(
check
(
"copy of a/3.txt"
))
self
.
assert_
(
check
(
"copy of a/3.txt"
))
...
@@ -456,6 +457,8 @@ class FSTestCases:
...
@@ -456,6 +457,8 @@ class FSTestCases:
self
.
fs
.
createfile
(
"test1"
,
"hello world"
)
self
.
fs
.
createfile
(
"test1"
,
"hello world"
)
fs2
=
pickle
.
loads
(
pickle
.
dumps
(
self
.
fs
))
fs2
=
pickle
.
loads
(
pickle
.
dumps
(
self
.
fs
))
self
.
assert_
(
fs2
.
isfile
(
"test1"
))
self
.
assert_
(
fs2
.
isfile
(
"test1"
))
fs3
=
pickle
.
loads
(
pickle
.
dumps
(
self
.
fs
,
-
1
))
self
.
assert_
(
fs3
.
isfile
(
"test1"
))
...
...
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