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
1c1b19de
Commit
1c1b19de
authored
Nov 28, 2012
by
willmcgugan@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for invalid chars in path on win32
parent
28900b32
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
fs/osfs/__init__.py
+3
-3
No files found.
fs/osfs/__init__.py
View file @
1c1b19de
...
...
@@ -88,7 +88,7 @@ class OSFS(OSFSXAttrMixin, OSFSWatchMixin, FS):
}
if
sys
.
platform
==
'win32'
:
_invalid_path_chars
=
'
\\
:*?"<>|'
_invalid_path_chars
=
'
'
.
join
(
char
(
n
)
for
n
in
xrange
(
31
))
+
'
\\
:*?"<>|'
else
:
_invalid_path_chars
=
'
\0
'
_re_invalid_path_chars
=
re
.
compile
(
'|'
.
join
(
re
.
escape
(
c
)
for
c
in
_invalid_path_chars
),
re
.
UNICODE
)
...
...
@@ -159,12 +159,12 @@ class OSFS(OSFSXAttrMixin, OSFSWatchMixin, FS):
raise
InvalidCharsInPathError
(
path
)
def
getsyspath
(
self
,
path
,
allow_none
=
False
):
path
=
relpath
(
normpath
(
path
))
.
replace
(
"/"
,
os
.
sep
)
self
.
_validate_path
(
path
)
path
=
relpath
(
normpath
(
path
))
.
replace
(
u"/"
,
os
.
sep
)
path
=
os
.
path
.
join
(
self
.
root_path
,
path
)
if
not
path
.
startswith
(
self
.
root_path
):
raise
PathError
(
path
,
msg
=
"OSFS given path outside root:
%(path)
s"
)
path
=
self
.
_decode_path
(
path
)
self
.
_validate_path
(
path
)
return
path
def
unsyspath
(
self
,
path
):
...
...
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