e8bd84284e3ac61bff123427a80218c3e5f76583,textacy/io/utils.py,,open_sesame,#Any#Any#Any#Any#Any#Any#Any#,25

Before Change


        OSError: if ``filepath`` doesn"t exist but ``mode`` is read
    
    // check args
    if not isinstance(filepath, (str, bytes)):
        raise TypeError("filepath must be a string, not {}".format(type(filepath)))
    if encoding and "t" not in mode:
        raise ValueError("encoding only applicable for text mode")

After Change


        raise ValueError("encoding only applicable for text mode")

    // normalize filepath and make dirs, as needed
    filepath = utils.to_path(filepath).resolve()
    if make_dirs is True:
        _make_dirs(filepath, mode)
    elif mode.startswith("r") and not filepath.is_file():
        raise OSError("file "{}" does not exist".format(filepath))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: chartbeat-labs/textacy
Commit Name: e8bd84284e3ac61bff123427a80218c3e5f76583
Time: 2019-08-09
Author: burtdewilde@gmail.com
File Name: textacy/io/utils.py
Class Name:
Method Name: open_sesame


Project Name: deepmipt/DeepPavlov
Commit Name: 286a864220a00732d382a75051e11877acf13c3f
Time: 2018-01-24
Author: ol.gure@gmail.com
File Name: deeppavlov/core/models/keras_model.py
Class Name: KerasModel
Method Name: load


Project Name: pantsbuild/pants
Commit Name: 02f703665d2e6ce7282dd201bfcb33b3bb131f03
Time: 2014-01-30
Author: jsirois@twitter.com
File Name: src/python/twitter/pants/targets/artifact.py
Class Name: Artifact
Method Name: __init__