[pypy-commit] pypy py3k: Return bytes for Linux abstract namespace sockets

amauryfa noreply at buildbot.pypy.org
Tue Dec 6 23:51:32 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3k
Changeset: r50235:f65121a60b37
Date: 2011-12-05 00:21 +0100
http://bitbucket.org/pypy/pypy/changeset/f65121a60b37/

Log:	Return bytes for Linux abstract namespace sockets

diff --git a/pypy/rlib/rsocket.py b/pypy/rlib/rsocket.py
--- a/pypy/rlib/rsocket.py
+++ b/pypy/rlib/rsocket.py
@@ -504,7 +504,12 @@
                     self.get_path() == other.get_path())
 
         def as_object(self, fd, space):
-            return space.wrap(self.get_path())
+            path = self.get_path()
+            if _c.linux and len(path) > 0 and path[0] == '\x00':
+                # Linux abstract namespace
+                return space.wrapbytes(path)
+            else:
+                return space.wrap(path)
 
         def from_object(space, w_address):
             return UNIXAddress(space.str_w(w_address))


More information about the pypy-commit mailing list