wbond / package_control

The Sublime Text package manager
https://packagecontrol.io
4.8k stars 815 forks source link

Remove 'open_compat' module #1531

Closed deathaxe closed 3 years ago

deathaxe commented 3 years ago

This PR...

  1. removes open_compat and file_not_found_error module which were required for compatibility with python 2 only.
  2. use fobj as file object variable instead of f or arbitrary other characters.
  3. pass encoding to open(..., encoding='utf-8') instead of manually handling that
  4. Prefer json.load(fobj) over json.loads(fobj.read())
  5. Create empty files in binary mode. No need to allocate an encoder for writing nothing.
wbond commented 3 years ago

Looks good to me, thanks for cleaning this up!