New submission from Marco Rougeth <ma...@rougeth.com>:

This is issue is to suggest an enhancement to the shutil module, I believe it's 
quiet similar to the issue32642.

I was using shutil.copytree to copy some files around and I tried to pass 
Path-like objects as input but got the exception "TypeError: argument should be 
string, bytes or integer, not PosixPath".

e.g.
build_path = BASE_DIR / 'build'
static_path = BASE_DIR / 'static'
shutil.copytree(static_path, build_path)


As said in issue32642, it "wasn't obvious because Path objects appear as 
strings in normal debug output". I had a look at the shutil source code and it 
seems that it wouldn't be to hard to implement. I'd love to do it, if it makes 
sense.

----------
components: Library (Lib)
messages: 313295
nosy: rougeth
priority: normal
severity: normal
status: open
title: Shutil module functions could accept Path-like objects
type: enhancement
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33004>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to