Use rstrip("\n") instead of -1 index to safely remove newline characters.
authorZac Medico <zmedico@gentoo.org>
Sun, 26 Feb 2006 21:36:41 +0000 (21:36 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 26 Feb 2006 21:36:41 +0000 (21:36 -0000)
svn path=/main/trunk/; revision=2793

pym/cache/metadata.py

index 0fd11cda8db097d051942d801a33c87535f7b98e..99a7ad6db9c059bd14693bf1422e5425418ed29f 100644 (file)
@@ -50,7 +50,7 @@ class database(flat_hash.database):
                                        if not c.isalpha():
                                                if c == "=" and idx > 0:
                                                        hashed = True
-                                                       d[line[:idx]] = line[idx + 1:-1]
+                                                       d[line[:idx]] = line[idx + 1:].rstrip("\n")
                                                elif c == "_" or c.isdigit():
                                                        continue
                                                break