[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-27 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
assignee: docs@python -> giampaolo.rodola
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-27 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:


New changeset cf9d00554715febf21cf94950da4f42723b80498 by Giampaolo Rodola 
(mbarkhau) in branch '3.8':
[3.8] bpo-39390 shutil: fix argument types for ignore callback (GH-18122)
https://github.com/python/cpython/commit/cf9d00554715febf21cf94950da4f42723b80498


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-24 Thread Manuel Barkhau


Manuel Barkhau  added the comment:

> If you pass a string, you will get a string, so existing code will continue 
> to work as before.

Somebody might have code that is running against a flat directory and have 
written their ignore function expecting to get a pathlib.Path, because that's 
the only case they encountered. This change would break their code and so would 
an upgrade to 3.9 with the patch that was just merged.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-24 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

I don't think we need to change anything on < 3.8, but 3.8 and 3.9 will always 
convert *src* to str via os.fspath(), which IMO is more consistent (e.g. 
os.path.* functions and others do the same).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> For completeness, a similar problem is present also on python < 3.8 if 
> passing a pathlib.Path type as *src*

I do not think this is a problem. If you pass a string, you will get a string, 
so existing code will continue to work as before. The only problem if you pass 
a string, but get an unexpected type.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-24 Thread Manuel Barkhau


Manuel Barkhau  added the comment:

> For completeness, a similar problem is present also on python < 3.8

Fair point. I'll have a look.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-24 Thread Manuel Barkhau


Change by Manuel Barkhau :


--
pull_requests: +17554
pull_request: https://github.com/python/cpython/pull/18168

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-24 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

For completeness, a similar problem is present also on python < 3.8 if passing 
a pathlib.Path type as *src*: the callback function will receive a pathlib.Path 
type once, and then string types.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-24 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:


New changeset 88704334e5262c6cd395a0809d4ef810f33f3ca5 by Giampaolo Rodola 
(mbarkhau) in branch 'master':
bpo-39390 shutil: fix argument types for ignore callback (GH-18122)
https://github.com/python/cpython/commit/88704334e5262c6cd395a0809d4ef810f33f3ca5


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-22 Thread Manuel Barkhau


Change by Manuel Barkhau :


--
pull_requests: +17509
pull_request: https://github.com/python/cpython/pull/18122

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-21 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-21 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

Yes, thanks. Whoever got bit by this is either getting an exception or not the 
intended behavior (due to failed string comparison). I doubt anybody is relying 
on the new type checking since it's not documented. If they are, they are 
probably just doing:

def callback(name, names):
if not isinstance(name, str):  # bugfix 3.8
name = name.name
...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-21 Thread Manuel Barkhau


Manuel Barkhau  added the comment:

Unless somebody else wants to, I could have a go at an PR to update shutil.py

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-21 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

> Should not copytree convert arguments of the ignore callback to str and list 
> correspondingly?

It should. I think it makes sense to just do this for Python 3.8.2 instead of 
updating the doc.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +giampaolo.rodola

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-21 Thread Manuel Barkhau


Manuel Barkhau  added the comment:

Is there anything I can do to help move this forward?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-20 Thread Ned Deily


Change by Ned Deily :


--
keywords: +patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-20 Thread Ned Deily


Change by Ned Deily :


--
keywords: +3.8regression -patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-20 Thread Manuel Barkhau


Manuel Barkhau  added the comment:

> This looks like a backward incompatible change in 3.8.

Indeed. 

> Should not copytree convert arguments of the ignore callback to str and list 
> correspondingly?

Well, since any existing code probably expects that behavior (or at least 
probably works if that is the case), I would be for such a change. I'm not sure 
what your policy is though. If there is recently written code that assumes the 
new types, are you OK with that breaking if it is changed back?

I guess since it's an undocumented breaking change, it shouldn't be too much of 
an issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This looks like a backward incompatible change in 3.8. Should not copytree 
convert arguments of the ignore callback to str and list correspondingly?

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-19 Thread Manuel Barkhau


Change by Manuel Barkhau :


--
keywords: +patch
pull_requests: +17462
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18069

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-19 Thread Manuel Barkhau


Change by Manuel Barkhau :


--
title: shutil.copytree - ignore callback behaviour change -> shutil.copytree - 
3.8 changed argument types of the ignore callback

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com