Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions editorconfig/ini.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

import posixpath
import re
from codecs import open, StreamReaderWriter
from collections import OrderedDict
from io import TextIOBase
from os import sep
from os.path import dirname, normpath

Expand Down Expand Up @@ -96,13 +96,12 @@ def matches_filename(self, config_filename: str, glob: str) -> bool:
def read(self, filename: str) -> None:
"""Read and parse single EditorConfig file"""
try:
fp = open(filename, encoding='utf-8')
except IOError:
with open(filename, encoding='utf-8', mode='r') as fp:
self._read(fp, filename)
except OSError:
return
self._read(fp, filename)
fp.close()

def _read(self, fp: StreamReaderWriter, fpname: str) -> None:
def _read(self, fp: TextIOBase, fpname: str) -> None:
"""Parse a sectioned setup file.

The sections in setup file contains a title line at the top,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [{name = "EditorConfig Team"}]
license = {text = "PSF-2.0"}
description = "EditorConfig File Locator and Interpreter for Python"
readme = "README.rst"
requires-python = ">=3.13.7"
requires-python = ">=3.10"
classifiers = [
"License :: OSI Approved :: Python Software Foundation License",
"Operating System :: OS Independent",
Expand Down