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
a125c6cf
Commit
a125c6cf
authored
Aug 04, 2010
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OSFS.unsyspath(): handle case where self.root_path ends with a backslash
parent
d33a4a74
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
fs/osfs/__init__.py
+6
-3
No files found.
fs/osfs/__init__.py
View file @
a125c6cf
...
@@ -92,7 +92,8 @@ class OSFS(OSFSXAttrMixin, OSFSWatchMixin, FS):
...
@@ -92,7 +92,8 @@ class OSFS(OSFSXAttrMixin, OSFSWatchMixin, FS):
if
sys
.
platform
==
"win32"
:
if
sys
.
platform
==
"win32"
:
if
not
root_path
.
startswith
(
"
\\\\
?
\\
"
):
if
not
root_path
.
startswith
(
"
\\\\
?
\\
"
):
root_path
=
u"
\\\\
?
\\
"
+
root_path
root_path
=
u"
\\\\
?
\\
"
+
root_path
if
not
root_path
.
endswith
(
"
\\
"
):
# If it points at the root of a drive, it needs a trailing slash.
if
len
(
root_path
)
==
6
:
root_path
=
root_path
+
"
\\
"
root_path
=
root_path
+
"
\\
"
if
create
:
if
create
:
...
@@ -137,9 +138,11 @@ class OSFS(OSFSXAttrMixin, OSFSWatchMixin, FS):
...
@@ -137,9 +138,11 @@ class OSFS(OSFSXAttrMixin, OSFSWatchMixin, FS):
"""
"""
path
=
os
.
path
.
normpath
(
os
.
path
.
abspath
(
path
))
path
=
os
.
path
.
normpath
(
os
.
path
.
abspath
(
path
))
prefix
=
os
.
path
.
normcase
(
self
.
root_path
)
+
os
.
path
.
sep
prefix
=
os
.
path
.
normcase
(
self
.
root_path
)
if
not
prefix
.
endswith
(
os
.
path
.
sep
):
prefix
+=
os
.
path
.
sep
if
not
os
.
path
.
normcase
(
path
)
.
startswith
(
prefix
):
if
not
os
.
path
.
normcase
(
path
)
.
startswith
(
prefix
):
raise
ValueError
(
"path not within this FS:
%
s
"
%
(
path
,
))
raise
ValueError
(
"path not within this FS:
%
s
(
%
s)"
%
(
os
.
path
.
normcase
(
path
),
prefix
))
return
path
[
len
(
self
.
root_path
):]
return
path
[
len
(
self
.
root_path
):]
@convert_os_errors
@convert_os_errors
...
...
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