Source

freehg / htpasswdutils.py

Diff from to

htpasswdutils.py

         if mode != 'c' or os.path.exists(filename):
             file = open(filename, "r")
             for line in file:
-                k, v = line.split(':',1)
+                try:
+                    k, v = line.strip().split(':',1)
+                except ValueError:
+                    continue
                 self.records[k] = v
             file.close()