[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-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


--
nosy: +lukasz.langa

___
Python tracker 

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



[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.

--

___
Python tracker 

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



[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.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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'), PosixPath('install-sh'), ...]

Are you proposing a feature that the Path instance should be implicitly 
iterable for the directory contents?

--
nosy: +arp11

___
Python tracker 

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



[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/fileinput.py",
 line 198, in __init__
files = tuple(files)
TypeError: 'PosixPath' object is not iterable

--
components: IO
messages: 294169
nosy: Roy Williams
priority: normal
severity: normal
status: open
title: FileInput doesn't accept PathLike objects for file names
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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