summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2023-03-10 23:16:10 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2023-03-10 23:16:26 +0100
commit7e3c50f4d7a12652d7d3373c1ff5a7e1cedb7820 (patch)
tree6961316d5909c1d8558185d1e5e50ece52b7359c
parent74e6efcec09dff861254289465a3f06c803dbc4f (diff)
downloadpylint-git-issue-8419.tar.gz
Work in progress add testsissue-8419
Refs #8419
-rw-r--r--tests/functional/u/unspecified_encoding_py38.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/functional/u/unspecified_encoding_py38.py b/tests/functional/u/unspecified_encoding_py38.py
index 66b8523f4..6b9acaffa 100644
--- a/tests/functional/u/unspecified_encoding_py38.py
+++ b/tests/functional/u/unspecified_encoding_py38.py
@@ -15,6 +15,7 @@ open(FILENAME, "wt") # [unspecified-encoding]
open(FILENAME, "w+") # [unspecified-encoding]
open(FILENAME, "w", encoding=None) # [unspecified-encoding]
open(FILENAME, "r") # [unspecified-encoding]
+open(FILENAME / "b.txt", "r") # [unspecified-encoding]
with open(FILENAME, encoding="utf8", errors="surrogateescape") as f:
pass
@@ -39,6 +40,7 @@ io.open(FILENAME) # [unspecified-encoding]
io.open(FILENAME, "wt") # [unspecified-encoding]
io.open(FILENAME, "w+") # [unspecified-encoding]
io.open(FILENAME, "w", encoding=None) # [unspecified-encoding]
+io.open(FILENAME / 'b.txt', "w", encoding=None) # [unspecified-encoding]
with io.open(FILENAME, encoding="utf8", errors="surrogateescape") as f:
pass
@@ -57,19 +59,25 @@ LOCALE_ENCODING = None
with io.open(FILENAME, encoding=LOCALE_ENCODING) as f: # [unspecified-encoding]
pass
+with io.open(FILENAME / 'b.txt', encoding=LOCALE_ENCODING) as f: # [unspecified-encoding]
+ pass
+
LOCALE_ENCODING = locale.getlocale()[1]
Path(FILENAME).read_text(encoding=LOCALE_ENCODING)
Path(FILENAME).read_text(encoding="utf8")
Path(FILENAME).read_text("utf8")
+(FILENAME / 'b.txt').read_text("utf8")
LOCALE_ENCODING = None
Path(FILENAME).read_text() # [unspecified-encoding]
Path(FILENAME).read_text(encoding=None) # [unspecified-encoding]
Path(FILENAME).read_text(encoding=LOCALE_ENCODING) # [unspecified-encoding]
+(FILENAME / 'b.txt').read_text() # [unspecified-encoding]
LOCALE_ENCODING = locale.getlocale()[1]
Path(FILENAME).write_text("string", encoding=LOCALE_ENCODING)
Path(FILENAME).write_text("string", encoding="utf8")
+(FILENAME / 'b.txt').write_text("string", encoding="utf8")
LOCALE_ENCODING = None
Path(FILENAME).write_text("string") # [unspecified-encoding]
@@ -82,6 +90,7 @@ Path(FILENAME).open() # [unspecified-encoding]
Path(FILENAME).open("wt") # [unspecified-encoding]
Path(FILENAME).open("w+") # [unspecified-encoding]
Path(FILENAME).open("w", encoding=None) # [unspecified-encoding]
+Path(FILENAME / 'b.txt').open("w", encoding=None) # [unspecified-encoding]
Path(FILENAME).open("w", encoding=LOCALE_ENCODING)