Project

General

Profile

Development #38781

Compatibilité python3

Added by Emmanuel Cazenave 3 months ago. Updated about 2 months ago.

Status:
Solution déployée
Priority:
Normal
Target version:
-
Start date:
06 Jan 2020
Due date:
% Done:

0%

Patch proposed:
No
Planning:
No

Description

Tic tac.


Related issues

Related to Passerelle - Development #38811: tests: utiliser suds-jurko plutot que suds Solution déployée 07 Jan 2020
Related to Passerelle - Development #38843: cmislib non compatible python3 Fermé 08 Jan 2020
Related to Passerelle - Development #38923: Python 3, première fournée Solution déployée 13 Jan 2020
Related to Passerelle - Development #39263: utils/sftp.py : compat python3 Rejeté 27 Jan 2020

Associated revisions

Revision c9ccc876 (diff)
Added by Emmanuel Cazenave 2 months ago

batch: use builtin next() and catch StopIteration (#38781)

Catching StopIteration is for 3.7 compatibility:
https://www.python.org/dev/peps/pep-0479/

Revision d96495ea (diff)
Added by Emmanuel Cazenave 2 months ago

csv: use text in python 3 (#38781)

And open file in binary mode in management command.

csv.reader expects str in python 2 and string in python 3.

Revision 4138a924 (diff)
Added by Emmanuel Cazenave 2 months ago

tests: pass binary data to atomic_write (#38781)

Revision 064e8fd1 (diff)
Added by Emmanuel Cazenave 2 months ago

tests: read zip file in binary mode (#38781)

Revision e4914036 (diff)
Added by Emmanuel Cazenave 2 months ago

actesweb: force iso-8859-15 encoding (#38781)

Revision bad1765b (diff)
Added by Emmanuel Cazenave 2 months ago

jsonresponse: use self to get instance (#38781)

Revision 142312ed (diff)
Added by Emmanuel Cazenave 2 months ago

utils: pass bytes to base64.decode (#38781)

Revision 8922ebb5 (diff)
Added by Emmanuel Cazenave 2 months ago

get url functions from six (#38781)

Revision 3dce4d92 (diff)
Added by Emmanuel Cazenave 2 months ago

add python 3 support to request signature (#38781)

Revision 658265ff (diff)
Added by Emmanuel Cazenave 2 months ago

expand zip object (#38781)

Revision 049266ba (diff)
Added by Emmanuel Cazenave 2 months ago

api_entreprise: use response text when error (#38781)

Revision 4af4d371 (diff)
Added by Emmanuel Cazenave 2 months ago

api_particulier: catch ValueError or JSONDecodeError (#38781)

And adapt tests.

Revision 62d443e8 (diff)
Added by Emmanuel Cazenave 2 months ago

arpege_ecp: use six.string_types (#38781)

Revision c5d12c23 (diff)
Added by Emmanuel Cazenave 2 months ago

tests astregs: read xml files in binary mode (#38781)

Revision 443030d0 (diff)
Added by Emmanuel Cazenave 2 months ago

cityweb: pass binary data to atomic_write (#38781)

Revision 1fe83356 (diff)
Added by Emmanuel Cazenave 2 months ago

tests dpark: read JPEG file in binary mode (#38781)

Revision ea316080 (diff)
Added by Emmanuel Cazenave 2 months ago

tests atal: read xml files in binary mode (#38781)

Revision 5a920336 (diff)
Added by Emmanuel Cazenave 2 months ago

atal: catch binascii.Error (#38781)

Revision 17f2abfc (diff)
Added by Emmanuel Cazenave 2 months ago

utils: use force_text to decode (#38781)

Revision de20591d (diff)
Added by Emmanuel Cazenave 2 months ago

utils: use force_str before regexp (#38781)

Revision 18266fe1 (diff)
Added by Emmanuel Cazenave 2 months ago

tests base_adresse: read bzip files in binary mode (#38781)

Revision 0bea1b77 (diff)
Added by Emmanuel Cazenave 2 months ago

tests cartads: expand dict view (#38781)

Revision ae7ba1b4 (diff)
Added by Emmanuel Cazenave 2 months ago

tests cartads: upload binary data (#38781)

Revision 0074d84b (diff)
Added by Emmanuel Cazenave 2 months ago

cartads: use force_text on base64 data (#38781)

Revision 1f2f5a0a (diff)
Added by Emmanuel Cazenave 2 months ago

cityweb: expand map object (#38781)

Revision 33d53443 (diff)
Added by Emmanuel Cazenave 2 months ago

clicrdv: use absolute import (#38781)

Revision ba224a76 (diff)
Added by Emmanuel Cazenave 2 months ago

clicrdv: use force_text on auth header (#38781)

Revision 027d252a (diff)
Added by Emmanuel Cazenave 2 months ago

clicrdv: use key func sort (#38781)

Revision 44d5bb29 (diff)
Added by Emmanuel Cazenave 2 months ago

cmis: catch binascii.Error (#38781)

Revision b590eadc (diff)
Added by Emmanuel Cazenave 2 months ago

tests cmis: use force_text on base64 bytes (#38781)

Revision 4b7ec777 (diff)
Added by Emmanuel Cazenave 2 months ago

tests cron: use repr() instead of its result (#38781)

Revision 0f6e1db4 (diff)
Added by Emmanuel Cazenave 2 months ago

to_pdf: expects and return bytes (#38781)

Revision 478f3bb1 (diff)
Added by Emmanuel Cazenave 2 months ago

test dpark: use force_text on base64 bytes (#38781)

Revision 5bf70042 (diff)
Added by Emmanuel Cazenave 2 months ago

fake_family: expand dict view (#38781)

Revision 9238034e (diff)
Added by Emmanuel Cazenave 2 months ago

family: pass text to csv.reader in py3 (#38781)

Revision 6750e47a (diff)
Added by Emmanuel Cazenave 2 months ago

family: use builtin next() (#38781)

Revision 4201af31 (diff)
Added by Emmanuel Cazenave 2 months ago

family: use dict.values() (#38781)

Revision c28cf206 (diff)
Added by Emmanuel Cazenave 2 months ago

family: read and write files on binary mode (#38781)

Revision 3225b926 (diff)
Added by Emmanuel Cazenave 2 months ago

clicrdv: expand dict views (#38781)

Revision 49e2a3ee (diff)
Added by Emmanuel Cazenave 2 months ago

test clicrdv: get urlparse form six (#38781)

Revision 5de8b752 (diff)
Added by Emmanuel Cazenave 2 months ago

gdema: use six.string_types instead of basetring (#38781)

Revision bffe4f6d (diff)
Added by Emmanuel Cazenave 2 months ago

test gdema: remove hex representation (#38781)

Revision 831f1c5f (diff)
Added by Emmanuel Cazenave 2 months ago

views: use self to get instance (#38781)

Revision cbec518b (diff)
Added by Emmanuel Cazenave 2 months ago

tests: use repr() in error message (#38781)

Revision 2a42e35d (diff)
Added by Emmanuel Cazenave 2 months ago

gesbac: use TextIOwrapper to handle latin-1 csv files (#38781)

Revision 6af2012a (diff)
Added by Emmanuel Cazenave 2 months ago

iparapheur: use force_text before string interpolation (#38781)

Revision 1fe9040b (diff)
Added by Emmanuel Cazenave 2 months ago

test iparapheur: mock responses as binary data (#38781)

Revision 6a5aaa90 (diff)
Added by Emmanuel Cazenave 2 months ago

sftp: don't cast bytestring into string (#38781)

Revision d25dfd53 (diff)
Added by Emmanuel Cazenave 2 months ago

sftp: wraps private key with TextIOWrapper (#38781)

paramiko expects a text interface to read the private key :
https://github.com/paramiko/paramiko/pull/1343/commits

Revision 74ead60c (diff)
Added by Emmanuel Cazenave 2 months ago

sftp: store private key as text (#38781)

Revision 6a85a581 (diff)
Added by Emmanuel Cazenave 2 months ago

test sftp: use force_text() instead of decode() (#38781)

Revision 532011ff (diff)
Added by Emmanuel Cazenave 2 months ago

export_json: use force_text() on b64 bytes (#38781)

Revision b56d0f73 (diff)
Added by Emmanuel Cazenave 2 months ago

test import export: read/write files in binary mode (#38781)

Revision 8d277a42 (diff)
Added by Emmanuel Cazenave 2 months ago

test jobs: read files in binary mode (#38781)

Revision 16836c5e (diff)
Added by Emmanuel Cazenave 2 months ago

test jsonresponse: compare binary content to binary data (#38781)

Revision 1b9e0ca2 (diff)
Added by Emmanuel Cazenave 2 months ago

lille_urban_card: expand dict view (#38781)

Revision cde9a2f1 (diff)
Added by Emmanuel Cazenave 2 months ago

test manager: compare binary content to binary data (#38781)

Revision d3c9299e (diff)
Added by Emmanuel Cazenave 2 months ago

test mdel: pass binary data to base64 encode (#38781)

Revision 9cfd4990 (diff)
Added by Emmanuel Cazenave 2 months ago

test mdel: xml find with appropriate namespace (#38781)

Revision 498440c7 (diff)
Added by Emmanuel Cazenave 2 months ago

test mdel: don't rely repr() to check exception messagee (#38781)

Revision 5a64a916 (diff)
Added by Emmanuel Cazenave 2 months ago

meyzieu_newsletter: expand dict view (#38781)

Revision 9d062957 (diff)
Added by Emmanuel Cazenave 2 months ago

test meyzieu_newsletter: use values() instead of itervalues() (#38781)

Revision dc7bcfe9 (diff)
Added by Emmanuel Cazenave 2 months ago

conftest: pass binary data to BytesIO (#38781)

Revision 9f37c9d7 (diff)
Added by Emmanuel Cazenave 2 months ago

nancypoll: pass text data to csv.reader in py3 (#38781)

Revision 1f1c5232 (diff)
Added by Emmanuel Cazenave 2 months ago

nancypoll: use builtin next() (#38781)

Revision b75fa578 (diff)
Added by Emmanuel Cazenave 2 months ago

okina: use key arg in sort() (#38781)

Revision 48a71687 (diff)
Added by Emmanuel Cazenave 2 months ago

test okina: compare binary content to binary data (#38781)

Revision 438f253e (diff)
Added by Emmanuel Cazenave 2 months ago

test_soap: mock responses withs binary data (#38781)

Revision 1812670c (diff)
Added by Emmanuel Cazenave 2 months ago

test_soap: use repr() to check error message (#38781)

Revision 2874a2b9 (diff)
Added by Emmanuel Cazenave 2 months ago

solis: pass text to re.sub (#38781)

Revision 51c0a5e0 (diff)
Added by Emmanuel Cazenave 2 months ago

solis: expand filter object (#38781)

Revision 32a85de6 (diff)
Added by Emmanuel Cazenave 2 months ago

test_solis: compare binary data to binary string (#38781)

Revision ae0d8e30 (diff)
Added by Emmanuel Cazenave 2 months ago

tcl: expand dict view (#38781)

Revision a8cd8304 (diff)
Added by Emmanuel Cazenave 2 months ago

test_templatetags: use inspect.isfunction in py3 (#38781)

In py2 inspect.ismethod returns bound or unbound method
whereas is py3 it return only bound method.

Revision 39107f61 (diff)
Added by Emmanuel Cazenave 2 months ago

pbx: use string_types instead of basestring (#38781)

Revision f7fc09ac (diff)
Added by Emmanuel Cazenave 2 months ago

test_tlmcom: compare binary content to binary data (#38781)

Revision 8d90b34d (diff)
Added by Emmanuel Cazenave 2 months ago

toulouse_axel: use force_text() on ET.tostring() results (#38781)

ET.tostring produces bytes in py3.

Revision 3b6486d5 (diff)
Added by Emmanuel Cazenave 2 months ago

toulouse_axel: expand dict view (#38781)

Revision 85676130 (diff)
Added by Emmanuel Cazenave 2 months ago

test_utils_conversion: read files in binary mode (#38781)

Revision 723b1e53 (diff)
Added by Emmanuel Cazenave 2 months ago

test/wcs: read/write files in binary mode when pickling (#38781)

Revision 9ab3ee7b (diff)
Added by Emmanuel Cazenave 2 months ago

views: pass decoded payload to the logger (#38781)

It will utlimately be serialized in JSON, so we don't want to keep
it as bytes.

Revision 37c0c3b6 (diff)
Added by Emmanuel Cazenave 2 months ago

test_api_access: make test indifferent to bytes vs str repr() length (#38781)

In py3 'reponse_content' and 'body' are bytes, so repr() produces and extra
'b' character comparing to repr() on a bytestring in py2.

Revision 52da067c (diff)
Added by Emmanuel Cazenave 2 months ago

utils: ensure bytes interface over http cached response content (#38781)

Revision 7e58546c (diff)
Added by Emmanuel Cazenave 2 months ago

test_requests: mock response content as bytes (#38781)

And make test indifferent to bytes vs str repr().

Revision b4fb17bc (diff)
Added by Emmanuel Cazenave 2 months ago

test_opengis: mock response content as bytes (#38781)

Revision b58c9930 (diff)
Added by Emmanuel Cazenave 2 months ago

sms: make error messages indifferent in py2/py3 (#38781)

Revision 5e25419a (diff)
Added by Emmanuel Cazenave 2 months ago

choosit: use string_types instead of basetring (#38781)

Revision 5fe94ee3 (diff)
Added by Emmanuel Cazenave 2 months ago

oxyd: use force_text on binary content (#38781)

Revision ae09ae97 (diff)
Added by Emmanuel Cazenave 2 months ago

use json_loads() instead of json.loads() (#38781)

json.loads expects str in python >= 3, < 3.6.

Revision 24ee622c (diff)
Added by Emmanuel Cazenave 2 months ago

setup: delete print statement (#38781)

Revision 00b46fc3 (diff)
Added by Emmanuel Cazenave 2 months ago

setup: use cmis-maykin in python install (#38781)

Revision 069c2e7d (diff)
Added by Emmanuel Cazenave 2 months ago

jenkins: run tests against python3 (#38781)

Revision a71b04b2 (diff)
Added by Emmanuel Cazenave 2 months ago

gesbac: use range() instead of xrange() (#38781)

History

#1 Updated by Emmanuel Cazenave 3 months ago

  • Subject changed from Compatiblité python3 to Compatibilité python3

#2 Updated by Emmanuel Cazenave 3 months ago

#3 Updated by Emmanuel Cazenave 3 months ago

#4 Updated by Emmanuel Cazenave 3 months ago

#5 Updated by Emmanuel Cazenave 2 months ago

  • Status changed from Nouveau to Solution proposée

Les tests qui passent en py2/py3 dans cette branche wip/38781-py3.

Ci-dessous les commits qui me paraissent les plus notables (et si ça doit donner lieu à trop de discussions/ajustements, j'aimerais autant que ça se passe dans des tickets à part, pour donner une chance à cette branche d'être poussé rapidement, sans les commits problématiques bien sûr).

commit 77ccce251a7854ba516c82d334eb19dffb5b0d89
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Thu Jan 23 11:02:23 2020 +0100

    utils: ensure bytes interface over http cached response content (#38781)

commit b59afac5a2a6ff7b265b76ed4db4fce38474a252
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Thu Jan 23 08:20:01 2020 +0100

    views: pass decoded payload to the logger (#38781)

    It will utlimately be serialized in JSON, so we don't want to keep
    it as bytes.

commit e86ea4d34566eac3b3e417a6bf250e35711d9376
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 14:10:47 2020 +0100

    sftp: store private key as text (#38781)

commit 0773170939a2efe576a996c0fc075656cee303e5
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 14:07:20 2020 +0100

    sftp: wraps private key with TextIOWrapper  (#38781)

    paramiko expects a text interface to read the private key :
    https://github.com/paramiko/paramiko/pull/1343/commits

commit 942f23b84673ee2aedb6df86dccd2398a271a83b
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Mon Jan 13 18:12:22 2020 +0100

    add python 3 support to request signature (#38781)

commit 87dfae83395925b21863c1747c63f1a8bda43dbb
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Mon Jan 13 15:35:55 2020 +0100

    csv: use text in python 3 (#38781)

    And open file in binary mode in management command.

    csv.reader expects str in python 2 and string in python 3.

#6 Updated by Benjamin Dauvergne 2 months ago

  • sftp: wraps private key with TextIOWrapper (#38781) : il me semble que private_key_content est toujours unicode alors tu peux utiliser directement io.StringIO() (ça vient soit de SFTPFormField qui fait un descode('ascii') ou du stockage en base sous forme JSON)
  • sftp: use string for paths (#38781) : je ne suis pas certain de celui-là non plus, pourquoi force_text ici ?
  • utils: ensure bytes interface over http cached response content : faut pas utiliser smart_* sauf si tu sais pourquoi, en fait il n'est pas nécessaire, cache.set() fait un pickle de {'content': response.content}, response.content est toujours un str/bytes, donc tu peux directement faire BytesIO(cache_content['content'])

#7 Updated by Emmanuel Cazenave 2 months ago

#8 Updated by Emmanuel Cazenave 2 months ago

Benjamin Dauvergne a écrit :

  • sftp: wraps private key with TextIOWrapper (#38781) : il me semble que private_key_content est toujours unicode alors tu peux utiliser directement io.StringIO() (ça vient soit de SFTPFormField qui fait un descode('ascii') ou du stockage en base sous forme JSON)

Si la proposition est de faire :

def _load_private_key(content_or_file, password=None):
     if not hasattr(content_or_file, 'read'):
-        fd = io.BytesIO(force_bytes(content_or_file))
+        fd = io.StringIO(content_or_file)
     else:
         fd = content_or_file

Ça ne passe pas les tests parce tests_utils_sftp ouvrent les fichiers en mode binaire. J'ai du mal à avoir les idées claires sur ce sujet, je retire ce commit de la branche et adapte le tox pour zaper les tests qui ne passent pas, ce sera #39263 pour gérer ça tranquillement.

  • sftp: use string for paths (#38781) : je ne suis pas certain de celui-là non plus, pourquoi force_text ici ?

Par contre absolument certain de mon coup ici, il y a des bytes string retournés en py3 et on se retrouve à faire des b'xxx'.startswith('yyyy') et bim interdit de faire ça en py3.

  • utils: ensure bytes interface over http cached response content : faut pas utiliser smart_* sauf si tu sais pourquoi, en fait il n'est pas nécessaire, cache.set() fait un pickle de {'content': response.content}, response.content est toujours un str/bytes, donc tu peux directement faire BytesIO(cache_content['content'])

Pas trouvé le pickle dont tu parles dans django mais ok j'ai viré le smart_bytes (mon idée de départ c'était une str py2 mis en cache quand ça tourne en py2 et qu'on chope depuis le cache quand on tourne en py3, et alors pour être sûr de ne pas se trimballer une str py3, bref).

#9 Updated by Benjamin Dauvergne 2 months ago

Emmanuel Cazenave a écrit :

Ça ne passe pas les tests parce tests_utils_sftp ouvrent les fichiers en mode binaire. J'ai du mal à avoir les idées claires sur ce sujet, je retire ce commit de la branche et adapte le tox pour zaper les tests qui ne passent pas, ce sera #39263 pour gérer ça tranquillement.

Vu avec manu, je me trompe.

  • sftp: use string for paths (#38781) : je ne suis pas certain de celui-là non plus, pourquoi force_text ici ?

Par contre absolument certain de mon coup ici, il y a des bytes string retournés en py3 et on se retrouve à faire des b'xxx'.startswith('yyyy') et bim interdit de faire ça en py3.

Vu avec manu, c'est sur le .startswith() qu'il vaut mieux agir pour rester cohérent avec paramiko, ajouter un commentaire sur la signature de _adjust_cwd def _adjust_cwd(x : str) -> bytes.

Pas trouvé le pickle dont tu parles dans django

django/django/core/cache/backends/filebased.py par exemple; tous les backends de cache (à part locmem) utilise pickle pour sérialiser les objets, sinon on ne pourrait pas stocker n'importe quoi. Les session utilisent json maintenant, ce qui fait qu'on ne peut plus stocker n'importe quoi par exemple.

mais ok j'ai viré le smart_bytes (mon idée de départ c'était une str py2 mis en cache quand ça tourne en py2 et qu'on chope depuis le cache quand on tourne en py3, et alors pour être sûr de ne pas se trimballer une str py3, bref).

Je crois qu'un str picklé en py2 est dépicklé en bytes en py3 sans avoir rien à faire (idem unicode -> str) ; donc si le contrat est le même en py2 et py3 ça ne pose pas de problème.

#10 Updated by Emmanuel Cazenave 2 months ago

Voilà, les remarques prises en compte.

#11 Updated by Frédéric Péters 2 months ago

  • Status changed from Solution proposée to Solution validée

hop.

#12 Updated by Emmanuel Cazenave 2 months ago

  • Status changed from Solution validée to Résolu (à déployer)
commit a71b04b247cba446661f215ccd08a9ab38a5c1b6 (HEAD -> master, origin/wip/38781-py3, origin/master, origin/HEAD, wip/38781-py3)
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 29 10:45:25 2020 +0100

    gesbac: use range() instead of xrange() (#38781)

commit 069c2e7d62f88de76a4a2897696bfbab7e0daa93
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Fri Jan 24 12:20:48 2020 +0100

    jenkins: run tests against python3 (#38781)

commit 00b46fc3609c24474341f0ec6ca3f5698a69cc9c
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Fri Jan 24 12:19:16 2020 +0100

    setup: use cmis-maykin in python install (#38781)

commit 24ee622c2ccd39c30501394f01cba0ae4843fab6
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Fri Jan 24 12:16:12 2020 +0100

    setup: delete print statement (#38781)

commit ae09ae97b60d0f2c2aba72f2a47421476611d48d
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Thu Jan 23 15:31:49 2020 +0100

    use json_loads() instead of json.loads() (#38781)

    json.loads expects str in python >= 3, < 3.6.

commit 5fe94ee3e674c953ed1d1ec436548e565cd41682
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Thu Jan 23 15:17:56 2020 +0100

    oxyd: use force_text on binary content (#38781)

commit 5e25419aedb7e4caf8c8f9d6900c3b3309db68d2
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Thu Jan 23 15:16:37 2020 +0100

    choosit: use string_types instead of basetring (#38781)

commit b58c993000778f2478a83576a6974aad3622a815
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Thu Jan 23 15:15:47 2020 +0100

    sms: make error messages indifferent in py2/py3 (#38781)

commit b4fb17bc50723e52ef608ce41d90994a030077a8
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Thu Jan 23 14:01:42 2020 +0100

    test_opengis: mock response content as bytes (#38781)

commit 498a704c3d87143b4446af8cf1c9cc1b90351bac
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Thu Jan 23 13:59:42 2020 +0100

    opengis: force coordinates precision to six digits (#39197)

commit 7e58546c3a4d648f707d0dcb1842962b8d3e01ac
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Thu Jan 23 11:03:28 2020 +0100

    test_requests: mock response content as bytes (#38781)

    And make test indifferent to bytes vs str repr().

commit 52da067cefafc7e8a63a317d1f90c199fa212c99
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Thu Jan 23 11:02:23 2020 +0100

    utils: ensure bytes interface over http cached response content (#38781)

commit 37c0c3b6a0abd28a9f09814e7ba46af8b77828c9
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Thu Jan 23 08:24:44 2020 +0100

    test_api_access: make test indifferent to bytes vs str repr() length (#38781)

    In py3 'reponse_content' and 'body' are bytes, so repr() produces and extra
    'b' character comparing to repr() on a bytestring in py2.

commit 9ab3ee7bf89e8614129829052d9e1dce32273939
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Thu Jan 23 08:20:01 2020 +0100

    views: pass decoded payload to the logger (#38781)

    It will utlimately be serialized in JSON, so we don't want to keep
    it as bytes.

commit 723b1e532a0962fb94550c8d696d0cff5470a78a
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Thu Jan 23 06:49:22 2020 +0100

    test/wcs: read/write files in binary mode when pickling (#38781)

commit 85676130c2b894d77aa229545d045b5435f0278a
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Thu Jan 23 06:39:42 2020 +0100

    test_utils_conversion: read files in binary mode (#38781)

commit 3b6486d5cd8f240f887ceb8a0baf0b2ae3261e1b
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 19:23:10 2020 +0100

    toulouse_axel: expand dict view (#38781)

commit 8d90b34d2bdff13b7f3224246940885acddde1c7
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 19:19:56 2020 +0100

    toulouse_axel: use force_text() on ET.tostring() results (#38781)

    ET.tostring produces bytes in py3.

commit f7fc09ac18d0908b39fd3621c4e8857d8ff22198
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 18:31:09 2020 +0100

    test_tlmcom: compare binary content to binary data (#38781)

commit 39107f61dcf2d57e9bbeaa89dca949cf4d3c5efe
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 18:30:08 2020 +0100

    pbx: use string_types instead of basestring (#38781)

commit a8cd8304196fc8d1c9454827012aa103b2930030
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 18:23:31 2020 +0100

    test_templatetags: use inspect.isfunction in py3 (#38781)

    In py2 inspect.ismethod returns bound or unbound method
    whereas is py3 it return only bound method.

commit ae0d8e30f4452215751845a9777901f6aa66a757
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 17:52:06 2020 +0100

    tcl: expand dict view (#38781)

commit 32a85de68f9c1fcdd259025a5cab6fdbbce39fca
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 17:45:53 2020 +0100

    test_solis: compare binary data to binary string (#38781)

commit 51c0a5e06670dd3d7e423fa1838f4a1aff3e0086
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 17:44:34 2020 +0100

    solis: expand filter object (#38781)

commit 2874a2b9bae9d4ba29c7265dd483c61c716552c4
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 17:43:23 2020 +0100

    solis: pass text to re.sub (#38781)

commit 1812670c94e189174ca08555ee1866108afc2395
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 16:59:45 2020 +0100

    test_soap: use repr() to check error message (#38781)

commit 438f253eda4516b6b100cb161ba314b4ea23d639
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 16:58:35 2020 +0100

    test_soap: mock responses withs binary data (#38781)

commit 48a71687cc5d7f4192f7fda1bc0439329b788aab
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 15:40:36 2020 +0100

    test okina: compare binary content to binary data (#38781)

commit b75fa5785d9baf4f87ae5d998cf5e54753eaa8ee
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 15:39:45 2020 +0100

    okina: use key arg in sort() (#38781)

commit 1f1c5232d85633e62960ca2f55dae5930aa283ae
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 15:35:05 2020 +0100

    nancypoll: use builtin next() (#38781)

commit 9f37c9d715f9669ed14e3adfc88a10d45f592108
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 15:34:45 2020 +0100

    nancypoll: pass text data to csv.reader in py3 (#38781)

commit dc7bcfe99e97849a47e95a760f3a8cfbf05a7800
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 15:28:37 2020 +0100

    conftest: pass binary data to BytesIO (#38781)

commit 9d0629576e8f9ea0c6a94acb60d995ce6a4e9152
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 15:26:02 2020 +0100

    test meyzieu_newsletter: use values() instead of itervalues() (#38781)

commit 5a64a916d2a3c2a0d2fe7128b46931f0e86cd363
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 15:25:18 2020 +0100

    meyzieu_newsletter: expand dict view (#38781)

commit 498440c72fe41114980dab448a24aca17a727df8
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 15:21:21 2020 +0100

    test mdel: don't rely repr() to check exception messagee (#38781)

commit 9cfd4990ee48cf0bdf946fa6818da29c9b1cee80
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 15:20:29 2020 +0100

    test mdel: xml find with appropriate namespace (#38781)

commit d3c9299e4e2081b517351e9a86b40beecd540b19
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 15:19:32 2020 +0100

    test mdel: pass binary data to base64 encode (#38781)

commit cde9a2f1edcb21436921eb2ced59b64cc510deb3
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 15:05:01 2020 +0100

    test manager: compare binary content to binary data (#38781)

commit 1b9e0ca2923cd4151d1ebce3a9bdc34e8b9fa954
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 15:03:11 2020 +0100

    lille_urban_card: expand dict view (#38781)

commit 16836c5e261c17902ec9a7a9b288b68714e576bb
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 14:53:00 2020 +0100

    test jsonresponse: compare binary content to binary data (#38781)

commit 8d277a42d7c52041d15a7f7268c5d2df8b1de7c0
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 14:47:02 2020 +0100

    test jobs: read files in binary mode (#38781)

commit b56d0f734e4cb139c7bcab3d696ff0efe068318a
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 14:40:04 2020 +0100

    test import export: read/write files in binary mode (#38781)

commit 532011fffc361bebe3e557966affc3313a813117
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 14:38:14 2020 +0100

    export_json: use force_text() on b64 bytes (#38781)

commit 6a85a58114891d33beefc2591efe24370b448f41
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 14:13:54 2020 +0100

    test sftp: use force_text() instead of decode() (#38781)

commit 74ead60c389d6299eed81eee86ec2baaaf50859c
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 14:10:47 2020 +0100

    sftp: store private key as text (#38781)

commit d25dfd53e17e6f4926851e1804e35fd09e806efb
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 14:07:20 2020 +0100

    sftp: wraps private key with TextIOWrapper  (#38781)

    paramiko expects a text interface to read the private key :
    https://github.com/paramiko/paramiko/pull/1343/commits

commit 6a5aaa907ce1d0613ff1a6dad71b7545ab78fffd
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 13:56:59 2020 +0100

    sftp: don't cast bytestring into string (#38781)

commit 1fe9040b738682ba317dc424bad054f83c006581
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 11:33:01 2020 +0100

    test iparapheur: mock responses as binary data (#38781)

commit 6af2012a6973b639772e2b164bf36c7b5b3006f7
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 11:31:49 2020 +0100

    iparapheur: use force_text before string interpolation (#38781)

commit 2a42e35d349bd8dc0e2b0057bfcf6679e5241763
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 22 11:06:58 2020 +0100

    gesbac: use TextIOwrapper to handle latin-1 csv files (#38781)

commit cbec518b41502dc0660890b2ecfe44f83eacf730
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Tue Jan 21 14:45:23 2020 +0100

    tests: use repr() in error message (#38781)

commit 831f1c5fa7923a6086fc7cf44030d4de20447076
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Tue Jan 21 14:43:55 2020 +0100

    views: use __self__ to get instance (#38781)

commit bffe4f6d2916d24a4ce4f86fb5233d47b579965f
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Tue Jan 21 14:31:43 2020 +0100

    test gdema: remove hex representation (#38781)

commit 5de8b752644759cbdacbb9cb65d141b8c3484efe
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Tue Jan 21 14:30:12 2020 +0100

    gdema: use six.string_types instead of basetring (#38781)

commit 49e2a3ee2c720aab9e4d716b3220677f2f31115a
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Tue Jan 21 12:04:30 2020 +0100

    test clicrdv: get urlparse form six (#38781)

commit 3225b92637839b5b310e50aecbfcb33864b8754f
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Tue Jan 21 12:02:37 2020 +0100

    clicrdv: expand dict views (#38781)

commit c28cf20668820d5d37a912b4e522eda80272faf4
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Tue Jan 21 11:50:28 2020 +0100

    family: read and write files on binary mode (#38781)

commit 4201af31c27a496bb5d78b2de220058a472dbbc7
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Tue Jan 21 11:49:44 2020 +0100

    family: use dict.values() (#38781)

commit 6750e47a7c9deef14cf468f32b48de2ccd78e45e
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Tue Jan 21 11:48:19 2020 +0100

    family: use builtin next() (#38781)

commit 9238034ef4e8e9c316fa39ad4c5275573948123b
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Tue Jan 21 11:46:38 2020 +0100

    family: pass text to csv.reader in py3 (#38781)

commit 5bf70042c7b65bda9ad8c3ad6c38226aa0f145cb
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Tue Jan 21 10:46:05 2020 +0100

    fake_family: expand dict view (#38781)

commit 478f3bb14486cf199a8ca2c806946354cc43840e
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Tue Jan 21 10:42:22 2020 +0100

    test dpark: use force_text on base64 bytes (#38781)

commit 0f6e1db4668d7e81f70e27656f2d8518652d3164
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Tue Jan 21 10:40:49 2020 +0100

    to_pdf: expects and return bytes (#38781)

commit 4b7ec7775e1d917ddea2fd7af2b487ede4b894b8
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 17:36:55 2020 +0100

    tests cron: use repr() instead of its result (#38781)

commit b590eadcde7134a0da98782e8b1bad53609ffd28
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 17:21:58 2020 +0100

    tests cmis: use force_text on base64 bytes (#38781)

commit 44d5bb29b6354d643fa14fa4cd42dc6718fc6492
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 17:20:26 2020 +0100

    cmis: catch binascii.Error (#38781)

commit 027d252a798e388841fc7fbe04c3c8941357cd2e
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 17:05:26 2020 +0100

    clicrdv: use key func sort (#38781)

commit ba224a7672401c918249b7144acceb4481d1320a
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 17:04:50 2020 +0100

    clicrdv: use force_text on auth header (#38781)

commit 33d53443cc8f89f6370c456afa9d1605e9b32301
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 17:03:33 2020 +0100

    clicrdv: use absolute import (#38781)

commit 1f2f5a0a543fae918cdff3db1df5f1006389a974
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 16:09:41 2020 +0100

    cityweb: expand map object (#38781)

commit 0074d84b22286d2af07830b6b6915d2f7c4854b3
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 15:28:15 2020 +0100

    cartads: use force_text on base64 data (#38781)

commit ae7ba1b4226721e9c4cab5ad578fa4217f55a5c0
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 15:27:20 2020 +0100

    tests cartads: upload binary data (#38781)

commit 0bea1b77ce394fcfaec4b82acb55cf0efee9b68d
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 15:22:49 2020 +0100

    tests cartads: expand dict view (#38781)

commit 18266fe189eb2ca7313be63b1c29291459e89811
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 15:16:18 2020 +0100

    tests base_adresse: read bzip files in binary mode (#38781)

commit de20591d2fc7130bdb9483e1744b9e9e81d5ae81
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 15:15:12 2020 +0100

    utils: use force_str before regexp (#38781)

commit 17f2abfcd91577510eb51f02bca580e4d643ffed
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 15:04:59 2020 +0100

    utils: use force_text to decode (#38781)

commit 5a920336a60962555c3d00753a0ea7ee1a612431
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 14:47:15 2020 +0100

    atal: catch binascii.Error (#38781)

commit ea31608008e0cfbfa632308a609e709b51026d22
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 14:46:34 2020 +0100

    tests atal: read xml files in binary mode (#38781)

commit 1fe8335654f5915a9de4bece61e7ee3f878aa50d
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 14:30:27 2020 +0100

    tests dpark: read JPEG file in binary mode (#38781)

commit 443030d095e0e15a100e369fec90873b8d27b9a7
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 14:29:45 2020 +0100

    cityweb: pass binary data to atomic_write (#38781)

commit c5d12c236cd76c5de6b22a598e6bf228a5dee5c5
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 14:27:42 2020 +0100

    tests astregs: read xml files in binary mode (#38781)

commit 62d443e8c9853c9aac5739d1f79bff462cec3042
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Jan 15 14:01:43 2020 +0100

    arpege_ecp: use six.string_types (#38781)

commit 4af4d37161b2c2d3a620559d7079d026a1de7ebd
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Tue Jan 14 19:18:28 2020 +0100

    api_particulier: catch ValueError or JSONDecodeError (#38781)

    And adapt tests.

commit 049266ba2d370b3bff1cd9955c5f68371cabd049
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Mon Jan 13 18:46:32 2020 +0100

    api_entreprise: use response text when error (#38781)

commit 658265ff5344d0481e78fca22863422b4a5e2926
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Mon Jan 13 18:24:45 2020 +0100

    expand zip object (#38781)

commit 3dce4d92bd4d321c0a08774421e9b8b8d78ed003
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Mon Jan 13 18:12:22 2020 +0100

    add python 3 support to request signature (#38781)

commit 8922ebb5a3b02fece8e31cb3f91363d4c939435d
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Mon Jan 13 17:52:24 2020 +0100

    get url functions from six (#38781)

commit 142312ed5e1dd40b72f943050f5edd9403c25e8a
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Mon Jan 13 17:30:37 2020 +0100

    utils: pass bytes to base64.decode (#38781)

commit bad1765bf619f1ec6f8388b202c2a6a2f5cb7c3f
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Mon Jan 13 17:02:13 2020 +0100

    jsonresponse: use __self__ to get instance (#38781)

commit e49140360548f9b2dbb4ac492590ae800ea1b388
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Mon Jan 13 16:43:38 2020 +0100

    actesweb: force iso-8859-15 encoding (#38781)

commit 064e8fd187c22846bbc7d8dafd072bfdd86f11d8
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Mon Jan 13 16:20:35 2020 +0100

    tests: read zip file in binary mode (#38781)

commit 4138a92412b995b7d48e25e7366c9672ad6b5cf9
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Mon Jan 13 16:19:55 2020 +0100

    tests: pass binary data to atomic_write (#38781)

commit d96495ea436052c4df02d743bfaeba1cb02b176a
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Mon Jan 13 15:35:55 2020 +0100

    csv: use text in python 3 (#38781)

    And open file in binary mode in management command.

    csv.reader expects str in python 2 and string in python 3.

commit c9ccc8762668ee46eeb24475c2921661137cc826
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Mon Jan 13 15:14:58 2020 +0100

    batch: use builtin next() and catch StopIteration (#38781)

    Catching StopIteration is for 3.7 compatibility:
    https://www.python.org/dev/peps/pep-0479/

#13 Updated by Frédéric Péters about 2 months ago

  • Status changed from Résolu (à déployer) to Solution déployée

Also available in: Atom PDF