Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r90256:58d7aea67974
Date: 2017-02-21 12:34 +0100
http://bitbucket.org/pypy/pypy/changeset/58d7aea67974/

Log:    Call fsdecode_w() also in link() and readlink(), otherwise we can't
        pass a unicode containing a non-ascii char

diff --git a/pypy/module/posix/interp_posix.py 
b/pypy/module/posix/interp_posix.py
--- a/pypy/module/posix/interp_posix.py
+++ b/pypy/module/posix/interp_posix.py
@@ -698,9 +698,10 @@
     import signal
     rposix.kill(os.getpid(), signal.SIGABRT)
 
-@unwrap_spec(src='str0', dst='str0')
-def link(space, src, dst):
+def link(space, w_src, w_dst):
     "Create a hard link to a file."
+    src = fsencode_w(space, w_src)
+    dst = fsencode_w(space, w_dst)
     try:
         os.link(src, dst)
     except OSError as e:
@@ -713,9 +714,9 @@
     except OSError as e:
         raise wrap_oserror(space, e)
 
-@unwrap_spec(path='str0')
-def readlink(space, path):
+def readlink(space, w_path):
     "Return a string representing the path to which the symbolic link points."
+    path = fsencode_w(space, w_path)
     try:
         result = os.readlink(path)
     except OSError as e:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to