[issue37615] json - make load and dump work with filenames and path-like objects

2019-07-18 Thread Varun Agrawal
Change by Varun Agrawal : -- pull_requests: +14624 pull_request: https://github.com/python/cpython/pull/14832 ___ Python tracker <https://bugs.python.org/issue37

[issue37615] json - make load and dump work with filenames and path-like objects

2019-07-17 Thread Varun Agrawal
New submission from Varun Agrawal : Currently, json.load and json.dump take file pointers, aka file-like objects which have support for `.write()` and `.read()`. This necessitates the following pattern of code on a regular basis: ``` with open(filename) as f: o = json.load(f

[issue32559] logging - public function to get level from name

2018-01-16 Thread Varun Agrawal
Varun Agrawal <varagra...@gmail.com> added the comment: @zach.ware: True, but since we already have a getLevelName method, having a symmetric method to do the opposite made sense. Plus the method can perform error checking and other things to ensure much cleane

[issue32559] logging - public function to get level from name

2018-01-16 Thread Varun Agrawal
Varun Agrawal <varagra...@gmail.com> added the comment: The request is not to set the level but to get the level given the level name aka textual representation. For example, passing in INFO should return 20 and passing in CRITICAL should ret

[issue32559] logging - public function to get level from name

2018-01-15 Thread Varun Agrawal
New submission from Varun Agrawal <varagra...@gmail.com>: Currently, the logging module has a function `getLevelName` and directly accessing the `_nameToLevel` dict is poor practice bordering on non-pythonic. It would be nice to have a simple method like `getNameLevel` in the

[issue31123] fnmatch does not follow Unix fnmatch functionality

2017-08-07 Thread Varun Agrawal
Varun Agrawal added the comment: Hi David, It seems you already took a look at the man page. There are some subtle differences such as being unable to match to a directory when the pattern ends with a forward slash. Overall, I'd like to see fnmatch be used to create a program that can perform

[issue31123] fnmatch does not follow Unix fnmatch functionality

2017-08-04 Thread Varun Agrawal
New submission from Varun Agrawal: Currently, the fnmatch module in Python does not operate like the Unix equivalent command. This is especially the case with patterns such as `dir/` which does not match directory path returned by `os` (which would be `dir`) and neither does the pattern match