• 
      

    Fix PureError if file cannot be detected

    Review Request #14296 — Created Jan. 17, 2025 and submitted — Latest diff uploaded

    Information

    RBTools
    release-5.x

    Reviewers

    puremagic seems to throw an exception if the file cannot
    be detected instead of just "application/octet-stream".
    
    rbtools/utils/mimetypes.py", line 139, in guess_mimetype
        types = puremagic.magic_string(data)
    puremagic/main.py", line 341, in magic_string
        info = _identify_all(head, foot, ext)
    puremagic/main.py", line 196, in _identify_all
        return _confidence(matches, ext)
    puremagic/main.py", line 137, in _confidence
        raise PureError("Could not identify file")
    
     

    Commits

    Files