Since Python 3.10 there's a new EncodeWarning that gets flagged when a file is opened without specifying an encoding. PR #10328 in pytest proposes adding this capability. For this to work, a bunch of calls need to be updated to explicitly specify encoding="utf-8" (or something similar – though UTF-8 seems like a sensible default).
Some of the tests, like test_ini_markers_whitespace, initialise an IniConfig object, whose constructor opens a file without specifying an encoding (see here). This leads to the test failing.
Can we modify the constructor to use an explicit encoding when opening the file? If iniconfig doesn't support UTF-8 we can just use ASCII – so long as something is specified.
Hi!
Since Python 3.10 there's a new
EncodeWarning
that gets flagged when a file is opened without specifying an encoding. PR #10328 in pytest proposes adding this capability. For this to work, a bunch of calls need to be updated to explicitly specifyencoding="utf-8"
(or something similar – though UTF-8 seems like a sensible default).Some of the tests, like
test_ini_markers_whitespace
, initialise anIniConfig
object, whose constructor opens a file without specifying an encoding (see here). This leads to the test failing.Can we modify the constructor to use an explicit encoding when opening the file? If
iniconfig
doesn't support UTF-8 we can just use ASCII – so long as something is specified.Thanks!