summaryrefslogtreecommitdiff
path: root/passlib/apache.py
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2016-06-11 12:51:34 -0400
committerEli Collins <elic@assurancetechnologies.com>2016-06-11 12:51:34 -0400
commit59cc61cbad4c83dd8fea4ef1da42a9f127a1626a (patch)
treee18a513372d47817c6a445c78216e76ed1276ebc /passlib/apache.py
parent8e067c7bd4397f8e93b43a47766b729a3c487765 (diff)
downloadpasslib-59cc61cbad4c83dd8fea4ef1da42a9f127a1626a.tar.gz
bugfix: passlib.apache: py3 compat fix
Diffstat (limited to 'passlib/apache.py')
-rw-r--r--passlib/apache.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/passlib/apache.py b/passlib/apache.py
index 60f5cb5..bd89c7b 100644
--- a/passlib/apache.py
+++ b/passlib/apache.py
@@ -14,7 +14,7 @@ from passlib.context import CryptContext
from passlib.exc import ExpectedStringError
from passlib.hash import htdigest
from passlib.utils import render_bytes, to_bytes, deprecated_method, is_ascii_codec
-from passlib.utils.compat import join_bytes, unicode, BytesIO, PY3, OrderedDict
+from passlib.utils.compat import join_bytes, unicode, BytesIO, PY3
# local
__all__ = [
'HtpasswdFile',
@@ -27,6 +27,7 @@ __all__ = [
_UNSET = object()
_BCOLON = b":"
+_BHASH = b"#"
# byte values that aren't allowed in fields.
_INVALID_FIELD_CHARS = b":\n\r\t\x00"
@@ -231,7 +232,7 @@ class _CommonFile(object):
# lines with only whitespace, or with "#" as first non-whitespace char,
# are left alone / ignored.
tmp = line.lstrip()
- if not tmp or tmp.startswith("#"):
+ if not tmp or tmp.startswith(_BHASH):
skipped += line
continue