[issue35002] Potential bug in ConfigParser.read() in python3.6, before os.Pathlike was introduced

2018-10-16 Thread Berker Peksag


Berker Peksag  added the comment:

Unfortunately, we can't accept this change for 3.5 either because it's now in 
security-fix-only mode. See 
https://devguide.python.org/#status-of-python-branches for more details about 
the status of branches in the CPython repository.

Thank you for spending time to contribute back to Python!

--
components: +Library (Lib)

___
Python tracker 

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



[issue35002] Potential bug in ConfigParser.read() in python3.6, before os.Pathlike was introduced

2018-10-16 Thread Luna Chen


Change by Luna Chen :


--
resolution:  -> out of date
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



[issue35002] Potential bug in ConfigParser.read() in python3.6, before os.Pathlike was introduced

2018-10-16 Thread Luna Chen


Luna Chen  added the comment:

Hi Berker, Yes this workaround is mostly for python3.6.0.
I have noticed my PR won't let me get to that version it seems. :(

This bug seems to be present for python 3.5 as well. Would you recommend adding 
the fix to 3.5 instead or just simply close it?

Thanks very much!

--

___
Python tracker 

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



[issue35002] Potential bug in ConfigParser.read() in python3.6, before os.Pathlike was introduced

2018-10-16 Thread Berker Peksag


Berker Peksag  added the comment:

Unless I'm missing something, you want the following snippet work in 3.6.0, 
right?

import configparser as c
import pathlib as p
cp = c.ConfigParser()
cp.read(p.Path('t.cfg'))

t.cfg:

$ cat t.cfg 
[Spam]
foo = bar

Support for PathLike objects was added in 3.6.1 (see 
https://github.com/python/cpython/blob/3.6/Lib/configparser.py#L691 for the 
latest version of the code in the 3.6 branch) and we only support the latest 
bugfix release of a feature release. So, in other words, we can't add a 
workaround for 3.6.0 in the next bugfix release of 3.6 (which will be 3.6.7)

I suggest to close this as 'outdated'.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue35002] Potential bug in ConfigParser.read() in python3.6, before os.Pathlike was introduced

2018-10-16 Thread Luna Chen


Change by Luna Chen :


--
keywords: +patch
pull_requests: +9274
stage:  -> patch review

___
Python tracker 

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



[issue35002] Potential bug in ConfigParser.read() in python3.6, before os.Pathlike was introduced

2018-10-16 Thread Luna Chen


New submission from Luna Chen :

In `configparser.ConfigParser.read()`, it allows us to pass in either a single 
filepath or a list of filepath.

As python3 supports pathlib Path. We can potentially pass in a `PosixPath` to 
`configparser.ConfigParser.read()`, especially when passing in a list of 
`PosixPath` is allowed.
However, passing in a single `PosixPath` causes it to raise an exception:
  File "/Users/bnmetrics/workspace/cpython/Lib/configparser.py", line 694, in 
read
for filename in filenames:
TypeError: 'PosixPath' object is not iterable

This issue had been addressed with later version of python by checking if the 
filepath passed in is an instance of `os.Pathlike`.

I thought it would be nice if we can pass in a single PosixPath object to 
`configparser.ConfigParser.read()`.

--
messages: 327842
nosy: BNMetrics, gvanrossum, vinay.sajip
priority: normal
severity: normal
status: open
title: Potential bug in ConfigParser.read() in python3.6, before os.Pathlike 
was introduced
type: behavior
versions: Python 3.6

___
Python tracker 

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