[issue35453] pathlib.Path: glob and rglob should accept PathLike patterns

2019-11-15 Thread Batuhan


Batuhan  added the comment:

> From what I see, there is no consensus yet.

@serhiy.storchaka said this isn't an issue. I can add tests about this behavior 
(as you mentioned) or this issue can be directly resolved as not a bug. What 
are you thinking @nanjekyejoannah and @serhiy.storchaka?

--

___
Python tracker 

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



[issue35453] pathlib.Path: glob and rglob should accept PathLike patterns

2019-11-15 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

@BTaskaya From what I see, there is no consensus yet.If you are interested in 
exploring, go on.

--

___
Python tracker 

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



[issue35453] pathlib.Path: glob and rglob should accept PathLike patterns

2019-11-15 Thread Batuhan


Batuhan  added the comment:

@nanjekyejoannah, are you still interested in adding tests or can i add tests?

--
nosy: +BTaskaya

___
Python tracker 

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



[issue35453] pathlib.Path: glob and rglob should accept PathLike patterns

2019-05-28 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

Since this is not considered an issue, I will just add tests to confirm this 
behavior and close this.

--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue35453] pathlib.Path: glob and rglob should accept PathLike patterns

2018-12-14 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
stage:  -> test needed
type:  -> enhancement
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue35453] pathlib.Path: glob and rglob should accept PathLike patterns

2018-12-10 Thread Cristian Ciupitu


Cristian Ciupitu  added the comment:

Err, I meant os.path.join instead of os.path.combine.

--

___
Python tracker 

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



[issue35453] pathlib.Path: glob and rglob should accept PathLike patterns

2018-12-10 Thread Cristian Ciupitu


Cristian Ciupitu  added the comment:

What if the pattern has some directories in it, e.g. "SourceArt/**/*.png", how 
do you compose it? The traditional way is to either hardcode the separator 
(e.g. / or \) or use os.path.combine. I don't see why PurePath can't be used 
for this, e.g. PurePath('SourceArt')/"**'/'*.png'.

--

___
Python tracker 

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



[issue35453] pathlib.Path: glob and rglob should accept PathLike patterns

2018-12-10 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This is for purpose. Path is not a glob pattern, and glob pattern is not a 
path. '*.txt' is aт ordinary file name on Linux and is invalid file name on 
Windows. If we wanted to accept Path in any place that accepts a string, we 
would make Path a subclass of str.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue35453] pathlib.Path: glob and rglob should accept PathLike patterns

2018-12-10 Thread Cristian Ciupitu


New submission from Cristian Ciupitu :

pathlib.Path.glob and pathlib.Path.rglob don't work with os.PathLike patterns.

Short example:

from pathlib import Path, PurePath
# fails
tuple(Path('/etc').glob(PurePath('passwd')))# TypeError
tuple(Path('/etc').rglob(PurePath('passwd')))   # TypeError
tuple(Path('C:\\').glob(PurePath('Windows')))   # AttributeError
tuple(Path('C:\\').rglob(PurePath('Windows')))  # AttributeError
# works
from os import fspath
tuple(Path('/etc').glob(fspath(PurePath('passwd'
tuple(Path('/etc').rglob(fspath(PurePath('passwd'
tuple(Path('C:\\').glob(fspath(PurePath('Windows'
tuple(Path('C:\\').rglob(fspath(PurePath('Windows'

--
components: Library (Lib)
messages: 331491
nosy: ciupicri
priority: normal
severity: normal
status: open
title: pathlib.Path: glob and rglob should accept PathLike patterns
versions: Python 3.7

___
Python tracker 

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