Commits

Matthew Marshall  committed f622223

Fixed Htpasswd writing blank lines.

  • Participants
  • Parent commits 172feb8

Comments (0)

Files changed (1)

File 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()