In it's previous form it had ignored the binary option if
self._use_vcs() returned False.
Also added a few more details to the docstring, explaining the
arguments.
"""
Get the file as it was in a given revision.
Revision==None specifies the current revision.
+
+ allow_no_vcs==True allows direct access to files through
+ codecs.open() or open() if the vcs decides it can't handle the
+ given path.
"""
if not os.path.exists(path):
raise NoSuchFile(path)
relpath = self._u_rel_path(path)
contents = self._vcs_get_file_contents(relpath,revision,binary=binary)
else:
- f = codecs.open(path, "r", self.encoding)
+ if binary == True:
+ f = codecs.open(path, "r", self.encoding)
+ else:
+ f = open(path, "rb")
contents = f.read()
f.close()
return contents