[obspy-users] SeedLink protocol details

Bernhard Morgenstern bmorgenstern at geophysik.uni-muenchen.de
Fri Apr 18 20:43:08 CEST 2014


Hi Anthony,

> Is not Python 3 backward compatible to v2.7 code?

Unfortunately not. Python 3  breaks backward compatibility in quite a 
few places. Probably the most important for the implementation of an 
ASCII based protocol like SeedLink is the change in native strings.

In Python 2 strings use a single byte per character. In fact, "bytes" is 
merely an alias for "str".

In Python 3 the string type was changed to natively support unicode 
strings, while "byte" has become a separate type.

This means that one cannot use strings any more to handle all the 
protocol's communication data, but has to explicitly specify (and 
convert between) usages of strings and bytes.

@mbyt has done a large part of the Py2/3 conversion in the current 
master, and I have opened a pull request on Github for the remaining bits:

https://github.com/obspy/obspy/pull/770


Best,
Bernhard



More information about the obspy-users mailing list