hzulla / tolino-python

Access to tolino cloud with Python 3
GNU Lesser General Public License v2.1
78 stars 35 forks source link

Python 2.x backport #7

Closed janesser closed 8 years ago

janesser commented 8 years ago

First, I have no clue how python multi-version scripts look like.

Having been too lazy to install python3 (in addition to the present python 2.7.x of my 'Linux Mint 17.2 Rafaela' installation) tolinocloud.py could be adjusted.

Major problems solved during backport relate to encoding problems on multiple levels:

  1. the script itself assumed ascii but containing latin-1 chars
  2. the network response contained a two byte utf-8 (connecting thalia.de)

With python 2.x it seems difficult to manipulate the encoder applied parsing the URL response. Problem 2 occurred on the attempt in the debug logging procedure, attempting to print the response. The origin of the 'sitecustomize.py' solution is referenced.

(With python 3 all the ascii defaults are replaced by utf-8 as default.)

janesser commented 8 years ago

Found http://python3porting.com/noconv.html.

I close that PR, since it is just a temporary solution during the python 2 -> 3 transition.