[developers] RESTful ERG parsing

Stephan Oepen oe at ifi.uio.no
Wed Apr 6 21:15:22 CEST 2016


hi again, mike,

> Ok. Last night I put together a MRS-JSON serializer-deserializer, based on
> our discussions. So that part is ready.

as an afterthought, one final candidate revision: given our reasoning
about lower- vs. upper-case ‘namespaces’, one could apply the same
condensing as i suggested for ‘properties’ at the EP level and drop
the extra ‘arguments’ embedding.  that way, the EP structure would
become an object that is a little more parallel again to the TFS-like
rendering in the ‘simple’ serialization.  would you support making
this change, before we finalize this part of the protocol for now?

> Regarding unicode: I don't think I have experienced the problem you're
> describing, but in transport the requests should be encoded byte sequences,
> whether it's Python 2 or 3. Python 2 often confuses byte strings and unicode
> (codepoint) strings and operations using both will implicitly up-cast bytes
> (assuming some default encoding) to unicode.

i had been looking at this bug report:

  https://bugs.python.org/issue1712522

my understanding is that urllib.quote() in 2.7 does not support
unicode strings, whereas the revised version in 3.x does.  i have not
tried the work-around of encoding to an UTF-8 byte sequence first;
strictly speaking, i would think percent escaping should happen at the
string level (and arguably should support arbitrary unicode strings,
effectively making urllib an irilib), and the conversion to a byte
sequence for HTTP transport should be effected by urllib.urlopen().

—once you have had a chance to look at RESTful client implementation
yourself, i will be curious to see which solution you adopt!

cheers, oe



More information about the developers mailing list