warner / foolscap

remote object-messaging for Python+Twisted
http://foolscap.lothar.com/trac
MIT License
51 stars 40 forks source link

callRemote() requires a native string, making Python 3 porting harder #72

Open itamarst opened 3 years ago

itamarst commented 3 years ago

Tahoe-LAFS is being ported to run on both Python 2 and 3 at same time; eventually the former will be dropped, but for now it's both.

We're adding from __future__ import unicode, but that breaks things like remoteref.callRemote("mymethod", arg1) because on Python 2, "mymethod" is now Unicode, but on Python 2 Foolscap expects it to be a native string, i.e. bytes.

It would be good to accept unicode strings on Python 2 as well; I will submit PR that does that.

itamarst commented 3 years ago

Specifically, the issue is https://github.com/warner/foolscap/blob/845bea550447991b194ef884713a7b3be4b4a6c2/src/foolscap/referenceable.py#L561