diff options
author | Maximilian Hils <git@maximilianhils.com> | 2013-06-16 00:30:13 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2013-06-16 00:30:13 +0200 |
commit | 0382b809ea7dcaf91a81cc3ab506f83a341a20b6 (patch) | |
tree | 3468c07b2e7b5a99bc26ed98d276afa2a968c342 /libpathod/language.py | |
parent | 9e7f08acea55e2da53f5f2c93d6948c447cf1861 (diff) | |
download | mitmproxy-0382b809ea7dcaf91a81cc3ab506f83a341a20b6.tar.gz mitmproxy-0382b809ea7dcaf91a81cc3ab506f83a341a20b6.tar.bz2 mitmproxy-0382b809ea7dcaf91a81cc3ab506f83a341a20b6.zip |
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): |