xpra icon
Bug tracker and wiki

Opened 3 years ago

Last modified 9 days ago

#853 assigned defect

py3k server support

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: minor Milestone: 3.0
Component: platforms Version:
Keywords: Cc: onlyjob@…

Description (last modified by Antoine Martin)

Python3 tracker ticket: #1568.

Eventually, we will have to convert the server code to py3k... Which is going to be a pain, probably even worse than #90.

We should probably move away from GTK at that point too, and replace all the pygobject plumbing with something a bit simpler and faster.

This ticket is here to record all the things that will need to be done to make this happen.

Apart from the usual string vs unicode nonsense, we will have to deal with the borken change they made to dict items vs iteritems in version 3: we rely on the fact that items() makes a copy, which is no longer true, we can probably switch to viewkeys() for most cases - except that this is python 2.7 only... so we'll need to drop support for 2.6 before that (ie: all centos 6).

Change History (3)

comment:1 Changed 3 years ago by onlyjob

Cc: onlyjob@… added
Version: 0.15.x

comment:2 Changed 2 months ago by Antoine Martin

Description: modified (diff)
Status: newassigned

comment:3 Changed 9 days ago by Antoine Martin

Milestone: future3.0
Version: 0.15.x

Socket fixes for running the proxy server with python3: r17410.
It still fails shortly after:

Exception in thread new-tcp-connection:
Traceback (most recent call last):
  File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib64/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib64/python3.6/site-packages/xpra/server/server_core.py", line 861, in handle_new_connection
    sock.settimeout(self._socket_timeout)
OSError: [Errno 9] Bad file descriptor

Very relevant discussion: How to create a socket.socket() object from a socket fd?.
Python3 does this:

def fromfd(fd, family, type, proto=0):
    """ fromfd(fd, family, type[, proto]) -> socket object

    Create a socket object from a duplicate of the given file
    descriptor.  The remaining arguments are the same as for socket().
    """
    nfd = dup(fd)
    return socket(family, type, proto, nfd)

But do we want this fd to be dup-ed here?

Last edited 9 days ago by Antoine Martin (previous) (diff)
Note: See TracTickets for help on using tickets.