Trim periods in addition to whitespace. Closes #271.
authorSteven Black <redacted>
Thu, 30 Mar 2017 16:08:50 +0000 (12:08 -0400)
committerSteven Black <redacted>
Thu, 30 Mar 2017 16:08:50 +0000 (12:08 -0400)
updateHostsFile.py

index 0c8a59e755158ca6eb39429810c2e53448f300f8..952673b6cae5f950f15e7e50081265ae74bdcd40 100644 (file)
@@ -333,8 +333,8 @@ def removeDupsAndExcl(mergeFile):
         line = line.decode("UTF-8")
         # replace tabs with space
         line = line.replace("\t+", " ")
-        # Trim trailing whitespace
-        line = line.rstrip() + "\n"
+        # Trim trailing whitespace, periods -- (Issue #271 - https://github.com/StevenBlack/hosts/issues/271)
+        line = line.rstrip(' .') + "\n"
         # Testing the first character doesn't require startswith
         if line[0] == "#" or re.match(r'^\s*$', line[0]):
             # Cross-python write
git clone https://git.99rst.org/PROJECT