-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Skip test_copyfile_nonexistent_dir in AIX #92670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
erlend-aasland
pushed a commit
that referenced
this issue
May 19, 2022
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
May 19, 2022
…ir on AIX (pythonGH-92718) (cherry picked from commit 654032a) Co-authored-by: Ayappan Perumal <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
May 19, 2022
…ir on AIX (pythonGH-92718) (cherry picked from commit 654032a) Co-authored-by: Ayappan Perumal <[email protected]>
Test skipped on:
Thanks for the report and the fix |
miss-islington
added a commit
that referenced
this issue
May 19, 2022
…AIX (GH-92718) (cherry picked from commit 654032a) Co-authored-by: Ayappan Perumal <[email protected]>
miss-islington
added a commit
that referenced
this issue
May 19, 2022
…AIX (GH-92718) (cherry picked from commit 654032a) Co-authored-by: Ayappan Perumal <[email protected]>
Thanks @erlend-aasland for the review and merge. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
test_copyfile_nonexistent_dir fails in AIX.
======================================================================
FAIL: test_copyfile_nonexistent_dir (test.test_shutil.TestCopy)
Traceback (most recent call last):
File "/python3_work/Python-3.9.12/Lib/test/test_shutil.py", line 1276, in test_copyfile_nonexistent_dir
self.assertRaises(FileNotFoundError, shutil.copyfile, src_file, dst)
AssertionError: FileNotFoundError not raised by copyfile
From the testcase.,
def test_copyfile_nonexistent_dir(self):
# Issue 43219
src_dir = self.mkdtemp()
src_file = os.path.join(src_dir, 'foo')
dst = os.path.join(src_dir, 'does_not_exist/')
write_file(src_file, 'foo')
self.assertRaises(FileNotFoundError, shutil.copyfile, src_file, dst)
It assumes that having a trailing slash ( 'does_not_exist/' ) makes the OS to consider it as directory. It is discussed more in this issue https://bugs.python.org/issue43219 . But in AIX, it is not the case. The trailing slash has no effect. It is considered as a file and get created. That is atleast how the AIX open call behaviour is.
import os
src_dir = 'temp_dir'
src_file = os.path.join(src_dir, 'foo')
dst = os.path.join(src_dir, 'does_not_exist/')
assert not os.path.exists(dst)
with open(dst, 'wb') as fp:
fp.write(b'foo')
Running the above in AIX, it creates the file does_not_exist.
The testcase is skipped for other distros like MacOS, Solaris because of different errors thrown. For AIX also, this testcase needs to be skipped , though for a different reason.
The text was updated successfully, but these errors were encountered: