diff options
author | Aldo Cortesi <aldo@corte.si> | 2013-06-15 15:35:57 -0700 |
---|---|---|
committer | Aldo Cortesi <aldo@corte.si> | 2013-06-15 15:35:57 -0700 |
commit | 27092454bf6004c8b9cd79de5e38daa3ff37fc64 (patch) | |
tree | 3468c07b2e7b5a99bc26ed98d276afa2a968c342 /libpathod/language.py | |
parent | 9e7f08acea55e2da53f5f2c93d6948c447cf1861 (diff) | |
parent | 0382b809ea7dcaf91a81cc3ab506f83a341a20b6 (diff) | |
download | mitmproxy-27092454bf6004c8b9cd79de5e38daa3ff37fc64.tar.gz mitmproxy-27092454bf6004c8b9cd79de5e38daa3ff37fc64.tar.bz2 mitmproxy-27092454bf6004c8b9cd79de5e38daa3ff37fc64.zip |
Merge pull request #10 from mhils/master
always read files in binary mode
Diffstat (limited to 'libpathod/language.py')
-rw-r--r-- | libpathod/language.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libpathod/language.py b/libpathod/language.py index f3fe4daa..5cce6fde 100644 --- a/libpathod/language.py +++ b/libpathod/language.py @@ -181,7 +181,7 @@ class RandomGenerator: class FileGenerator: def __init__(self, path): self.path = path - self.fp = file(path, "r") + self.fp = file(path, "rb") self.map = mmap.mmap(self.fp.fileno(), 0, prot=mmap.PROT_READ) def __len__(self): @@ -957,7 +957,7 @@ def read_file(settings, s): raise FileAccessDenied("File access outside of configured directory") if not os.path.isfile(s): raise FileAccessDenied("File not readable") - return file(s, "r").read() + return file(s, "rb").read() def parse_response(settings, s): |