Bonjour,
J'ai une erreur lors du calcul du teste, enfin le calcul est bon mais sur le teste d'unn nom du fichier j'ai cette erreur:
mais l'execution va jusqu'au bout, et se termine correctement... Ce code d'erreur s'affiche dans l'IDLE
Warning (from warnings module):
File "D:\Developpement\prog.py", line 3679
if filename == 'winlogon.exe':
UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
merci
code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 for path, dirs, files in os.walk(windows): for filename in (files): # Si Fichier trouvé dans repertoire windows winlogon fichier = os.path.join(path, filename) rep = os.path.join(path) cle = hashlib.md5() try: if unicode(''.format(filename).encode("utf-8")) == 'winlogon.exe': with open(fichier, "rb") as f: cle.update(f.read()) res = cle.hexdigest() text2.insert(END,'Winlogon : '+rep+'\n\r') text2.insert(END,'MD5 : '+str(res)+'\n\n\r') text2.update() if filename == 'explorer.exe': with open(fichier, "rb") as f: cle.update(f.read()) res = cle.hexdigest() text2.insert(END,'Explorer : '+rep+'\n\r') text2.insert(END,'MD5 : '+str(res)+'\n\n\r') text2.update() if filename == 'wininit.exe': with open(fichier, "rb") as f: cle.update(f.read()) res = cle.hexdigest() text2.insert(END,'Wininit : '+rep+'\n\r') text2.insert(END,'MD5 : '+str(res)+'\n\n\r') text2.update() except IOError: pass
Partager