xpra icon
Bug tracker and wiki

Opened 7 weeks ago

Closed 4 weeks ago

Last modified 4 days ago

#2969 closed defect (fixed)

xdg-open bytes vs str?

Reported by: stdedos Owned by: stdedos
Priority: major Milestone: 4.1
Component: server Version: 3.0.x
Keywords: Cc:


Cannot send over this file:

u@h:~$ xdg-open ~/Απ\:_Your_Incident_INC0000000_has_comments_added.mbox 
server returned error code 127
  file '~/Απ:_Your_Incident_INC0000000_has_comments_added.mbox' does not exist
F: Can't get document portal: GDBus.Error:org.freedesktop.portal.Error.Failed: Can't mount fuse fs on /run/user/1000/doc: Operation not permitted
F: Can't get document portal mount path

(process:56): Gtk-WARNING **: 11:55:50.238: Locale not supported by C library.
	Using the fallback 'C' locale.
Failed to initialize gtk+: Invalid byte sequence in conversion input
u@h:~$ xdg-open ~/Απ\:_Your_Incident_INC0000000_has_comments_added.mbox ^C
u@h:~$ command -V xdg-open 
xdg-open is hashed (/usr/lib/xpra/xdg-open)
u@h:~$ env | grep -i xpra
u@h:~$ xdg-open '~/Απ\:_Your_Incident_INC0000000_has_comments_added.mbox '
xdg-open: unrecognized argument form '~/Απ\:_Your_Incident_INC0000000_has_comments_added.mbox '
xdg-open: file '~/Απ\:_Your_Incident_INC0000000_has_comments_added.mbox ' does not exist
u@h:~$ xdg-open '~/Απ\:_Your_Incident_INC0000000_has_comments_added.mbox'
xdg-open: unrecognized argument form '~/Απ\:_Your_Incident_INC0000000_has_comments_added.mbox'
xdg-open: file '~/Απ\:_Your_Incident_INC0000000_has_comments_added.mbox' does not exist

2020-12-08 11:15:21,674 Xpra GTK3 client version 4.1-r28059 64-bit
2020-12-08 11:15:21,680  running on Microsoft Windows 10
2020-12-08 11:15:22,900 GStreamer version 1.18.1 for Python 3.8.6 64-bit
2020-12-08 11:15:23,237 created named pipe 'Xpra\17580'
2020-12-08 11:15:23,534 keyboard layout code 0x409
2020-12-08 11:15:23,535 identified as 'United States - English' : us
2020-12-08 11:15:23,903  keyboard settings: layout=us
2020-12-08 11:15:23,909  desktop size is 4160x1440 with 1 screen:
2020-12-08 11:15:23,909   Default (1100x381 mm - DPI: 96x96) workarea: 4160x1400
2020-12-08 11:15:23,910     Generic PnP Monitor 1600x900 at 0x534 (309x174 mm - DPI: 132x131) workarea: 1600x860 at 0x534
2020-12-08 11:15:23,910     C32JG5x 2560x1440 at 1600x0 (697x392 mm - DPI: 93x93) workarea: 2560x1400 at 1600x0
2020-12-08 11:15:38,410 enabled remote logging
2020-12-08 11:15:38,413 Xpra GTK3 X11 server version 3.0.12-r27620 64-bit
2020-12-08 11:15:38,414  running on Linux Ubuntu 16.04 xenial

Change History (4)

comment:1 Changed 7 weeks ago by Antoine Martin

Owner: changed from Antoine Martin to stdedos
$ echo "test" > ~/Απ\:_Your_Incident_INC0000000_has_comments_added.mbox
$ xdg-open ~/Απ\:_Your_Incident_INC0000000_has_comments_added.mbox
Popen(['xpra', 'control', 'socket:///run/user/1000/xpra/localhost.localdomain-2', 'send-file', '/home/antoine/Απ:_Your_Incident_INC0000000_has_comments_added.mbox', 'open', '*'])=<subprocess.Popen object at 0x7f00a1f77790>
xdg-open: failed to forward to xpra server using socket '/run/user/1000/xpra/localhost.localdomain-2': write() argument must be str, not bytes

Running it by hand:

xpra control 'socket:///run/user/1000/xpra/localhost.localdomain-2 'send-file' /home/antoine/Απ:_Your_Incident_INC0000000_has_comments_added.mbox open "*"
server returned error code 127
  file '/home/antoine/ÃÂÃÂ:_Your_Incident_INC0000000_has_comments_added.mbox' does not exist

Gives a different error!

So there are actually a few different bugs here:

  • r28096 we can't write bytes to sys.stdout or sys.stderr to report the underlying error.. (with python3 builds)
  • r28097 + r28099: use utf8 for sending filenames, even when the network packet gives us a string value which actually contains utf8 bytes..
  • r28098 + r28100 cosmetic

Both the client and server must have the fixes for this to work.

comment:2 Changed 7 weeks ago by stdedos

Ouch 😕

If it is easy for you, would you consider adding non-ascii test cases?

comment:3 Changed 4 weeks ago by Antoine Martin

Resolution: fixed
Status: newclosed

Feel free to re-open if I've missed something.

If it is easy for you, would you consider adding non-ascii test cases?

It's not easy: #2990

comment:4 Changed 4 days ago by migration script

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2969

Note: See TracTickets for help on using tickets.