Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Lib/test/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -1736,7 +1736,10 @@ def tearDown(self):
def _test_link(self, file1, file2):
create_file(file1)

os.link(file1, file2)
try:
os.link(file1, file2)
except PermissionError as e:
self.skipTest('os.link(): %s' % e)
with open(file1, "r") as f1, open(file2, "r") as f2:
self.assertTrue(os.path.sameopenfile(f1.fileno(), f2.fileno()))

Expand Down Expand Up @@ -2888,7 +2891,8 @@ def test_stty_match(self):
"""
try:
size = subprocess.check_output(['stty', 'size']).decode().split()
except (FileNotFoundError, subprocess.CalledProcessError):
except (FileNotFoundError, subprocess.CalledProcessError,
PermissionError):
self.skipTest("stty invocation failed")
expected = (int(size[1]), int(size[0])) # reversed order

Expand Down Expand Up @@ -3242,7 +3246,10 @@ def test_attributes(self):
os.mkdir(dirname)
filename = self.create_file("file.txt")
if link:
os.link(filename, os.path.join(self.path, "link_file.txt"))
try:
os.link(filename, os.path.join(self.path, "link_file.txt"))
except PermissionError as e:
self.skipTest('os.link(): %s' % e)
if symlink:
os.symlink(dirname, os.path.join(self.path, "symlink_dir"),
target_is_directory=True)
Expand Down