Mailing List Archive

[issue45234] copy_file raises FileNotFoundError when src is a directory
New submission from Alex Grund <flamefire89@gmail.com>:

After https://bugs.python.org/issue43219 was resolved the function now shows faulty behavior when the source is a directory:

`copy_file('/path/to/dir', '/target')` throws a FileNotFoundError while previously it was a IsADirectoryError which is clearly correct.

See https://github.com/python/cpython/pull/27049#issuecomment-921647431

----------
components: Library (Lib)
messages: 402057
nosy: Alex Grund
priority: normal
severity: normal
status: open
title: copy_file raises FileNotFoundError when src is a directory
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45234>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45234] copy_file raises FileNotFoundError when src is a directory [ In reply to ]
Change by Andrei Kulakov <andrei.avk@gmail.com>:


----------
keywords: +patch
nosy: +andrei.avk
nosy_count: 1.0 -> 2.0
pull_requests: +26833
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28421

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45234>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45234] copy_file raises FileNotFoundError when src is a directory [ In reply to ]
Andrei Kulakov <andrei.avk@gmail.com> added the comment:

Alex: thanks for the report!

I've added a PR that should fix this.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45234>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45234] copy_file raises FileNotFoundError when src is a directory [ In reply to ]
Change by Eryk Sun <eryksun@gmail.com>:


----------
nosy: +gregory.p.smith

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45234>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45234] copy_file raises FileNotFoundError when src is a directory [ In reply to ]
Change by Andrei Kulakov <andrei.avk@gmail.com>:


----------
nosy: +kj

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45234>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45234] copy_file raises FileNotFoundError when src is a directory [ In reply to ]
?ukasz Langa <lukasz@langa.pl> added the comment:


New changeset b7eac52b466f697d3e89f47508e0df0196a98970 by andrei kulakov in branch 'main':
bpo-45234: Fix FileNotFound exception raised instead of IsADirectoryError in shutil.copyfile() (GH-28421)
https://github.com/python/cpython/commit/b7eac52b466f697d3e89f47508e0df0196a98970


----------
nosy: +lukasz.langa

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45234>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45234] copy_file raises FileNotFoundError when src is a directory [ In reply to ]
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>:


----------
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +26902
pull_request: https://github.com/python/cpython/pull/28507

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45234>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45234] copy_file raises FileNotFoundError when src is a directory [ In reply to ]
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>:


----------
pull_requests: +26904
pull_request: https://github.com/python/cpython/pull/28508

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45234>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45234] copy_file raises FileNotFoundError when src is a directory [ In reply to ]
?ukasz Langa <lukasz@langa.pl> added the comment:


New changeset 41d48bc038b254cc4a78a2d840097196b9545a84 by Miss Islington (bot) in branch '3.10':
bpo-45234: Fix FileNotFound exception raised instead of IsADirectoryError in shutil.copyfile() (GH-28421) (GH-28508)
https://github.com/python/cpython/commit/41d48bc038b254cc4a78a2d840097196b9545a84


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45234>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45234] copy_file raises FileNotFoundError when src is a directory [ In reply to ]
?ukasz Langa <lukasz@langa.pl> added the comment:

Pablo, this regression was fixed in GH-28508 which should go into 3.10.0.

----------
nosy: +pablogsal
priority: normal -> release blocker

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45234>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45234] copy_file raises FileNotFoundError when src is a directory [ In reply to ]
?ukasz Langa <lukasz@langa.pl> added the comment:


New changeset 09390c837a0bf73e213db2fbde34d756fa77a837 by Miss Islington (bot) in branch '3.9':
bpo-45234: Fix FileNotFound exception raised instead of IsADirectoryError in shutil.copyfile() (GH-28421) (GH-28507)
https://github.com/python/cpython/commit/09390c837a0bf73e213db2fbde34d756fa77a837


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45234>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45234] copy_file raises FileNotFoundError when src is a directory [ In reply to ]
Pablo Galindo Salgado <pablogsal@gmail.com> added the comment:

Cherry-picked!

----------
priority: release blocker ->
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45234>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45234] copy_file raises FileNotFoundError when src is a directory [ In reply to ]
Change by Terry J. Reedy <tjreedy@udel.edu>:


----------
resolution: -> fixed

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45234>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue45234] copy_file raises FileNotFoundError when src is a directory [ In reply to ]
Pablo Galindo Salgado <pablogsal@gmail.com> added the comment:


New changeset e0b61b28641bdd20cfeff6d9878f1318b711ca19 by Pablo Galindo (Miss Islington (bot)) in branch '3.10':
bpo-45234: Fix FileNotFound exception raised instead of IsADirectoryError in shutil.copyfile() (GH-28421) (GH-28508)
https://github.com/python/cpython/commit/e0b61b28641bdd20cfeff6d9878f1318b711ca19


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45234>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com