This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mkesper
Recipients mkesper
Date 2015-01-14.13:02:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1421240576.75.0.719151648499.issue23241@psf.upfronthosting.co.za>
In-reply-to
Content
source_path = Path('../data')
destination_path = Path('//file_server/work/whatever')
for file_name in source_path.glob('xyz-*'):
    shutil.copyfile(source_path / file_name, destination_path / file_name)

leads to:

Traceback (most recent call last):
  File "copy_shares_2_work.py", line 9, in <module>
    shutil.copyfile(source_path / file_name, destination_path / file_name)
  File "C:\Python34\lib\shutil.py", line 90, in copyfile
    if _samefile(src, dst):
  File "C:\Python34\lib\shutil.py", line 75, in _samefile
    return os.path.samefile(src, dst)
  File "C:\Python34\lib\genericpath.py", line 90, in samefile
    s1 = os.stat(f1)
TypeError: argument should be string, bytes or integer, not WindowsPath

Converting to str() works but is unexpected.
History
Date User Action Args
2015-01-14 13:02:56mkespersetrecipients: + mkesper
2015-01-14 13:02:56mkespersetmessageid: <1421240576.75.0.719151648499.issue23241@psf.upfronthosting.co.za>
2015-01-14 13:02:56mkesperlinkissue23241 messages
2015-01-14 13:02:56mkespercreate