|
91 | 91 | import sys |
92 | 92 | import time |
93 | 93 | import warnings |
94 | | -import binascii |
95 | 94 | from collections import namedtuple |
96 | 95 |
|
97 | 96 | if sys.version_info < (3, 0): |
@@ -427,6 +426,7 @@ def RemoveEntry(self, pathname_name, recursive=True): |
427 | 426 |
|
428 | 427 | Raises: |
429 | 428 | KeyError: if no child exists by the specified name |
| 429 | + OSError: if user lacks permission to delete the file, or (Windows only) the file is open |
430 | 430 | """ |
431 | 431 | entry = self.contents[pathname_name] |
432 | 432 | if entry.st_mode & PERM_WRITE == 0: |
@@ -465,6 +465,7 @@ def __init__(self, path_separator=os.path.sep, total_size=None): |
465 | 465 |
|
466 | 466 | Args: |
467 | 467 | path_separator: optional substitute for os.path.sep |
| 468 | + total_size: if not None, the total size in bytes of the root filesystem |
468 | 469 |
|
469 | 470 | Example usage to emulate real file systems: |
470 | 471 | filesystem = FakeFilesystem(alt_path_separator='/' if _is_windows else None) |
@@ -2779,8 +2780,8 @@ def Call(self, file_, mode='r', buffering=-1, encoding=None, |
2779 | 2780 | IOError: if the target object is a directory, the path is invalid or |
2780 | 2781 | permission is denied. |
2781 | 2782 | """ |
2782 | | - orig_modes = mode # Save original mdoes for error messages. |
2783 | | - # Binary mode for non 3.x or set by mode; an explicit encoding forces binary mode |
| 2783 | + orig_modes = mode # Save original modes for error messages. |
| 2784 | + # Binary mode for non 3.x or set by mode |
2784 | 2785 | binary = sys.version_info < (3, 0) or 'b' in mode |
2785 | 2786 | # Normalize modes. Ignore 't' and 'U'. |
2786 | 2787 | mode = mode.replace('t', '').replace('b', '') |
|
0 commit comments