kozec / syncthing-gtk

GTK3 & python based GUI for Syncthing
GNU General Public License v2.0
1.29k stars 140 forks source link

[Work In Progress] Python 3 conversion #475

Closed dralley closed 5 years ago

dralley commented 6 years ago

This series of commits will break backwards compatibility with Python 2.

It is currently broken due to issues w/ how bytes are processed in daemon.py (using bytestrings). python3 syncthing-gtk.py --verbose --debug shows a few errors.

I'm probably a little out of my depth working in that code, but I'll give it a shot.

If you still aren't ready to take the leap, I can discontinue it for now and hopefully it will still make things easier later on.

Minor suggestion: bytestrings probably is not the best way to do async network IO, it might be better (both in style and performance) to use something like io.BytesIO (https://docs.python.org/3/library/io.html). Strings are immutable so every time you append to one, it's really allocating a new larger string and copying the whole thing over.

kozec commented 6 years ago

I have to admit, I don't follow how we come from me expressing that I can't support code that doesn't work with Py2 to "taking the leap" :D

About bytestrings, this was only way how to communicate with GLib and Gio back when I originally coded that module. It is possible it's not needed anymore, assuming there is no poor soul running something like xUbuntu 14.04 left.

dralley commented 6 years ago

@kozec OK, but that will not be tenable long-term.

https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal

Within the next year or two distros are going to start dropping the packages, and at that point there's not going to be any choice but to migrate.

I understand your point of view, but mine is that it's probably past the point where going out of the way to keep it backwards compatible is worthwhile. It would add more complication for not much benefit.

st-review commented 5 years ago

:robot: beep boop

I'm going to close this pull request as it has been idle for more than 90 days.

This is not a rejection, merely a removal from the list of active pull requests that is periodically reviewed by humans. The pull request can be reopened when there is new activity, and merged once any remaining issues are resolved.

dralley commented 5 years ago

@kozec You've got about one year before distros start dropping Python 2 packages entirely

https://fedoraproject.org/wiki/Changes/RetirePython2