[issue30432] FileInput doesn't accept PathLike objects for file names

2017-05-22 Thread Łukasz Langa
Changes by Łukasz Langa : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-l

[issue30432] FileInput doesn't accept PathLike objects for file names

2017-05-22 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 002665a9da3a2924c4a08511ede62ff4d1dabc48 by Łukasz Langa (Roy Williams) in branch 'master': bpo-30432: FileInput doesn't accept PathLike objects for file names (#1732) https://github.com/python/cpython/commit/002665a9da3a2924c4a08511ede62ff4d1dabc48

[issue30432] FileInput doesn't accept PathLike objects for file names

2017-05-22 Thread Roy Williams
Roy Williams added the comment: @arp11 sorry for the too-minimal repro :D - the issue is with FileInput attempting to cast `files` to a tuple. Instead, if passed a PathLike object FileInput should set `files` to a tuple just as it does with a str. -- _

[issue30432] FileInput doesn't accept PathLike objects for file names

2017-05-22 Thread Roy Williams
Changes by Roy Williams : -- pull_requests: +1822 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue30432] FileInput doesn't accept PathLike objects for file names

2017-05-22 Thread Alex Perry
Alex Perry added the comment: You seem to be skipping a step, this is nothing to do with FileInput: >>> [n for n in Path('.')] Traceback (most recent call last): File "", line 1, in TypeError: 'PosixPath' object is not iterable >>> [n for n in Path('.').iterdir()] [PosixPath('build'), PosixP

[issue30432] FileInput doesn't accept PathLike objects for file names

2017-05-22 Thread Roy Williams
New submission from Roy Williams: ``` from fileinput import FileInput from pathlib import Path p = Path('.') FileInput(p) ``` Results in: Traceback (most recent call last): File "", line 1, in File "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/fi