[issue24744] Lack of type checks in pkgutil.walk_packages and friends

2017-06-13 Thread R. David Murray

R. David Murray added the comment:

Thanks, Sanyam.

--
resolution:  -> fixed
stage: needs patch -> 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



[issue24744] Lack of type checks in pkgutil.walk_packages and friends

2017-06-13 Thread R. David Murray

R. David Murray added the comment:


New changeset b9c3da5c89c66dcccf382e8f196746da2a06d4cc by R. David Murray 
(Sanyam Khurana) in branch 'master':
bpo-24744: Raises error in pkgutil.walk_packages if path is str (#1926)
https://github.com/python/cpython/commit/b9c3da5c89c66dcccf382e8f196746da2a06d4cc


--

___
Python tracker 

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



[issue24744] Lack of type checks in pkgutil.walk_packages and friends

2017-06-06 Thread R. David Murray

R. David Murray added the comment:

In thinking about merging this, I realize something I should have thought about 
earlier: we are proposing to raise an error where none was previously raised.  
Now, any code that would hit this would be broken, but nonetheless, by our 
backward compatibility policy we should do this only in 3.7, and we should add 
a note to the porting section of What's New.  And the PR needs a news entry.

--
components: +Library (Lib) -Interpreter Core
type:  -> behavior
versions: +Python 3.7 -Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue24744] Lack of type checks in pkgutil.walk_packages and friends

2017-06-04 Thread Sanyam Khurana

Sanyam Khurana added the comment:

I've updated the PR with required changes along with the test. Please have a 
look and let me know if any changes are needed.

--

___
Python tracker 

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



[issue24744] Lack of type checks in pkgutil.walk_packages and friends

2017-06-03 Thread R. David Murray

R. David Murray added the comment:

As I mentioned on the PR I think it should be a ValueError, and that the PR 
also needs tests.

--

___
Python tracker 

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



[issue24744] Lack of type checks in pkgutil.walk_packages and friends

2017-06-03 Thread Sanyam Khurana

Changes by Sanyam Khurana :


--
pull_requests: +2006

___
Python tracker 

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



[issue24744] Lack of type checks in pkgutil.walk_packages and friends

2017-06-03 Thread Sanyam Khurana

Sanyam Khurana added the comment:

Hi r.david.murray,

What error do you think should be raised in this case, when path is an instance 
of str?

I'll issue a PR once I know what end results are expected.

--
nosy: +CuriousLearner

___
Python tracker 

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



[issue24744] Lack of type checks in pkgutil.walk_packages and friends

2015-07-28 Thread Cal Leeming

New submission from Cal Leeming:

The documentation states that pkgutil.walk_packages() path must be None or a 
list of paths [1]. After passing in a string, the result was a blank list 
rather than a type error or automatic conversion to a list.

If this method is documented that it must only accept a list or None, then 
there should surely be type checks to this effect? This was a bit of a gotcha 
that left me head scratching for 30 minutes (after not realising it only took a 
list, not an str, which in itself seems a bit odd)

--
components: Interpreter Core
messages: 247529
nosy: sleepycal
priority: normal
severity: normal
status: open
title: Lack of type checks in pkgutil.walk_packages and friends
versions: Python 3.4

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



[issue24744] Lack of type checks in pkgutil.walk_packages and friends

2015-07-28 Thread R. David Murray

R. David Murray added the comment:

Well, normally no, we don't use type checks.  On the other hand, having it 
produce an incorrect result rather than an error of *some* sort is not so good 
(the problem is that it is ultimately calling map(func, path), and map happily 
iterates the string applying func to each character in turn), so in this case I 
think it is worth the explicit check for string.

--
nosy: +r.david.murray
stage:  - needs patch
versions: +Python 3.5, Python 3.6

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