Skip to content

Commit 4198433

Browse files
committed
Fixed minor issues in comments
1 parent 1a5f266 commit 4198433

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

fake_filesystem_test.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3122,7 +3122,7 @@ def testCanReadFromBlockDevice(self):
31223122
class OpenFileWithEncodingTest(TestCase):
31233123
"""Tests that are similar to some open file tests above but using an explicit text encoding.
31243124
Note: these tests can also be run under Python 2 after support for Python 3.2 will be skipped
3125-
(by using the u literal in the strings which is not supported in Pzthon 3.2)
3125+
(by using the u literal in the strings which is not supported in Python 3.2)
31263126
"""
31273127

31283128
def setUp(self):
@@ -3132,8 +3132,6 @@ def setUp(self):
31323132
self.os = fake_filesystem.FakeOsModule(self.filesystem)
31333133

31343134
def testWriteStrReadBytes(self):
3135-
# note: this and the following test can be run under Python 2
3136-
# after support for Python 3.2 will be skipped (by using the u literal)
31373135
str_contents = 'علي بابا'
31383136
with self.open(self.file_path, 'w', encoding='arabic') as f:
31393137
f.write(str_contents)

pyfakefs/fake_filesystem.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
import sys
9292
import time
9393
import warnings
94-
import binascii
9594
from collections import namedtuple
9695

9796
if sys.version_info < (3, 0):
@@ -427,6 +426,7 @@ def RemoveEntry(self, pathname_name, recursive=True):
427426
428427
Raises:
429428
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
430430
"""
431431
entry = self.contents[pathname_name]
432432
if entry.st_mode & PERM_WRITE == 0:
@@ -465,6 +465,7 @@ def __init__(self, path_separator=os.path.sep, total_size=None):
465465
466466
Args:
467467
path_separator: optional substitute for os.path.sep
468+
total_size: if not None, the total size in bytes of the root filesystem
468469
469470
Example usage to emulate real file systems:
470471
filesystem = FakeFilesystem(alt_path_separator='/' if _is_windows else None)
@@ -2779,8 +2780,8 @@ def Call(self, file_, mode='r', buffering=-1, encoding=None,
27792780
IOError: if the target object is a directory, the path is invalid or
27802781
permission is denied.
27812782
"""
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
27842785
binary = sys.version_info < (3, 0) or 'b' in mode
27852786
# Normalize modes. Ignore 't' and 'U'.
27862787
mode = mode.replace('t', '').replace('b', '')

0 commit comments

Comments
 (0)