regardscitoyens / LobbyTrack

Bunch of scripts useful to detect lobby's fingerprints
GNU Affero General Public License v3.0
12 stars 2 forks source link

python3 ou python2 ? #8

Open nathanncohen opened 8 years ago

nathanncohen commented 8 years ago

Dans le README on lit qu'il faut lancer highlightTrack avec 'python3', mais chez moi ca donne ca:

Traceback (most recent call last):
  File "highlightTrack.py", line 38, in <module>
    mots1 = file2array(f)
  File "highlightTrack.py", line 9, in file2array
    txt = re.sub(u"[\?\+‑\.!,;–()'’-]", " ", file.read().decode('UTF-8'))
AttributeError: 'str' object has no attribute 'decode'

En revanche avec python2, pas de probleme. C'est un problème de code ou un problème de README?

RouxRC commented 8 years ago

je crois que ça a été commencé avec python3, puis @teymour a eu des soucis d'encodage en utilisant python2, qu'on a rêglés en utilisant la syntaxe u"unicode_string" mais que celle ci est incompatible avec python3... du coup je dirais pb de README en l'état, mais de code en général ;)