[issue36378] Add support to load from paths to json.load

2019-04-11 Thread Inada Naoki


Inada Naoki  added the comment:

I close this because PR is closed already, and same idea
was discussed on -ideas ML.

--
nosy: +inada.naoki
resolution:  -> rejected
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



[issue36378] Add support to load from paths to json.load

2019-03-20 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This expands the API where json.load now only accepts open file objects to 
support str and pathlike objects. This was discussed in 
https://mail.python.org/pipermail/python-ideas/2017-March/045303.html where 
there were alternatives proposed as below : 

with path.open() as f: obj = json.load(f)

some_path.write_text(json.dumps(obj), encoding='utf8')
json.loads(some_path.read_text(encoding='utf8'))

Also supporting str and pathlib passes responsibility to json.load to open them 
and also close them properly? I think this needs a python-ideas discussion if 
the proposal has something to add other than the previous thread where many 
alternatives were mentioned for terse code.

--

___
Python tracker 

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



[issue36378] Add support to load from paths to json.load

2019-03-20 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue36378] Add support to load from paths to json.load

2019-03-20 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue36378] Add support to load from paths to json.load

2019-03-20 Thread SilentGhost


Change by SilentGhost :


--
nosy: +ezio.melotti, rhettinger

___
Python tracker 

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



[issue36378] Add support to load from paths to json.load

2019-03-20 Thread Dani Fojo


New submission from Dani Fojo :

Add support to json.load to read from a string or Path object containing the 
path to a json file. Many libraries (like Numpy) support this behavior.

--
components: Library (Lib)
messages: 338442
nosy: Dani Fojo
priority: normal
severity: normal
status: open
title: Add support to load from paths to json.load
type: enhancement
versions: Python 3.8

___
Python tracker 

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