[issue33254] importlib.resources.contents() incorrectly yields an empty list

2018-04-13 Thread Brett Cannon
Change by Brett Cannon : -- keywords: +patch pull_requests: +6162 stage: test needed -> patch review ___ Python tracker ___

[issue33254] importlib.resources.contents() incorrectly yields an empty list

2018-04-10 Thread Brett Cannon
Brett Cannon added the comment: I had to stare at it for a while since I knew it was for namespace packages and I'm so used to them returning a magical value to signal that fact, but then realize we don't even support namespace packages so it wasn't magical at all. ;) And

[issue33254] importlib.resources.contents() incorrectly yields an empty list

2018-04-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Note that this is in the case where a user is asking for the contents of a namespace package (which by definition, can't have resources). +1 on fixing this API wart. Will you @brett.cannon will submit a PR? I'll do a quick review and

[issue33254] importlib.resources.contents() incorrectly yields an empty list

2018-04-09 Thread Brett Cannon
New submission from Brett Cannon : If you look at https://github.com/python/cpython/blob/0f914b5b5f6ba186afd7112fc851c97247076f70/Lib/importlib/resources.py#L247 you will notice that the generator for importlib.resources.contents() return an empty list. While the intent was