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
7f18108a
Commit
7f18108a
authored
Nov 21, 2009
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better handling of unicode paths in errors
parent
07d00c02
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
fs/errors.py
+6
-1
fs/wrapfs.py
+1
-1
No files found.
fs/errors.py
View file @
7f18108a
...
@@ -31,7 +31,12 @@ class FSError(Exception):
...
@@ -31,7 +31,12 @@ class FSError(Exception):
self
.
details
=
details
self
.
details
=
details
def
__str__
(
self
):
def
__str__
(
self
):
return
unicode
(
self
)
.
encode
(
sys
.
getfilesystemencoding
())
keys
=
{}
for
k
,
v
in
self
.
__dict__
.
iteritems
():
if
isinstance
(
v
,
unicode
):
v
=
v
.
encode
(
sys
.
getfilesystemencoding
())
keys
[
k
]
=
v
return
str
(
self
.
msg
%
keys
)
def
__unicode__
(
self
):
def
__unicode__
(
self
):
keys
=
dict
((
k
,
v
)
for
k
,
v
in
self
.
__dict__
.
iteritems
())
keys
=
dict
((
k
,
v
)
for
k
,
v
in
self
.
__dict__
.
iteritems
())
...
...
fs/wrapfs.py
View file @
7f18108a
...
@@ -252,7 +252,7 @@ def wrap_fs_methods(decorator,cls=None,exclude=[]):
...
@@ -252,7 +252,7 @@ def wrap_fs_methods(decorator,cls=None,exclude=[]):
methods
=
(
"open"
,
"exists"
,
"isdir"
,
"isfile"
,
"listdir"
,
"makedir"
,
"remove"
,
methods
=
(
"open"
,
"exists"
,
"isdir"
,
"isfile"
,
"listdir"
,
"makedir"
,
"remove"
,
"setcontents"
,
"removedir"
,
"rename"
,
"getinfo"
,
"copy"
,
"move"
,
"setcontents"
,
"removedir"
,
"rename"
,
"getinfo"
,
"copy"
,
"move"
,
"copydir"
,
"movedir"
,
"close"
,
"getxattr"
,
"setxattr"
,
"delxattr"
,
"copydir"
,
"movedir"
,
"close"
,
"getxattr"
,
"setxattr"
,
"delxattr"
,
"listxattrs"
)
"listxattrs"
,
"getsyspath"
)
def
apply_decorator
(
cls
):
def
apply_decorator
(
cls
):
for
method_name
in
methods
:
for
method_name
in
methods
:
...
...
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