---
source: crates/ruff_linter/src/rules/pyupgrade/mod.rs
---
UP015.py:1:1: UP015 [*] Unnecessary open mode parameters
  |
1 | open("foo", "U")
  | ^^^^^^^^^^^^^^^^ UP015
2 | open("foo", "Ur")
3 | open("foo", "Ub")
  |
  = help: Remove open mode parameters

ℹ Safe fix
1   |-open("foo", "U")
  1 |+open("foo")
2 2 | open("foo", "Ur")
3 3 | open("foo", "Ub")
4 4 | open("foo", "rUb")

UP015.py:2:1: UP015 [*] Unnecessary open mode parameters
  |
1 | open("foo", "U")
2 | open("foo", "Ur")
  | ^^^^^^^^^^^^^^^^^ UP015
3 | open("foo", "Ub")
4 | open("foo", "rUb")
  |
  = help: Remove open mode parameters

ℹ Safe fix
1 1 | open("foo", "U")
2   |-open("foo", "Ur")
  2 |+open("foo")
3 3 | open("foo", "Ub")
4 4 | open("foo", "rUb")
5 5 | open("foo", "r")

UP015.py:3:1: UP015 [*] Unnecessary open mode parameters, use ""rb""
  |
1 | open("foo", "U")
2 | open("foo", "Ur")
3 | open("foo", "Ub")
  | ^^^^^^^^^^^^^^^^^ UP015
4 | open("foo", "rUb")
5 | open("foo", "r")
  |
  = help: Replace with ""rb""

ℹ Safe fix
1 1 | open("foo", "U")
2 2 | open("foo", "Ur")
3   |-open("foo", "Ub")
  3 |+open("foo", "rb")
4 4 | open("foo", "rUb")
5 5 | open("foo", "r")
6 6 | open("foo", "rt")

UP015.py:4:1: UP015 [*] Unnecessary open mode parameters, use ""rb""
  |
2 | open("foo", "Ur")
3 | open("foo", "Ub")
4 | open("foo", "rUb")
  | ^^^^^^^^^^^^^^^^^^ UP015
5 | open("foo", "r")
6 | open("foo", "rt")
  |
  = help: Replace with ""rb""

ℹ Safe fix
1 1 | open("foo", "U")
2 2 | open("foo", "Ur")
3 3 | open("foo", "Ub")
4   |-open("foo", "rUb")
  4 |+open("foo", "rb")
5 5 | open("foo", "r")
6 6 | open("foo", "rt")
7 7 | open("f", "r", encoding="UTF-8")

UP015.py:5:1: UP015 [*] Unnecessary open mode parameters
  |
3 | open("foo", "Ub")
4 | open("foo", "rUb")
5 | open("foo", "r")
  | ^^^^^^^^^^^^^^^^ UP015
6 | open("foo", "rt")
7 | open("f", "r", encoding="UTF-8")
  |
  = help: Remove open mode parameters

ℹ Safe fix
2 2 | open("foo", "Ur")
3 3 | open("foo", "Ub")
4 4 | open("foo", "rUb")
5   |-open("foo", "r")
  5 |+open("foo")
6 6 | open("foo", "rt")
7 7 | open("f", "r", encoding="UTF-8")
8 8 | open("f", "wt")

UP015.py:6:1: UP015 [*] Unnecessary open mode parameters
  |
4 | open("foo", "rUb")
5 | open("foo", "r")
6 | open("foo", "rt")
  | ^^^^^^^^^^^^^^^^^ UP015
7 | open("f", "r", encoding="UTF-8")
8 | open("f", "wt")
  |
  = help: Remove open mode parameters

ℹ Safe fix
3 3 | open("foo", "Ub")
4 4 | open("foo", "rUb")
5 5 | open("foo", "r")
6   |-open("foo", "rt")
  6 |+open("foo")
7 7 | open("f", "r", encoding="UTF-8")
8 8 | open("f", "wt")
9 9 | 

UP015.py:7:1: UP015 [*] Unnecessary open mode parameters
  |
5 | open("foo", "r")
6 | open("foo", "rt")
7 | open("f", "r", encoding="UTF-8")
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
8 | open("f", "wt")
  |
  = help: Remove open mode parameters

ℹ Safe fix
4 4 | open("foo", "rUb")
5 5 | open("foo", "r")
6 6 | open("foo", "rt")
7   |-open("f", "r", encoding="UTF-8")
  7 |+open("f", encoding="UTF-8")
8 8 | open("f", "wt")
9 9 | 
10 10 | with open("foo", "U") as f:

UP015.py:8:1: UP015 [*] Unnecessary open mode parameters, use ""w""
   |
 6 | open("foo", "rt")
 7 | open("f", "r", encoding="UTF-8")
 8 | open("f", "wt")
   | ^^^^^^^^^^^^^^^ UP015
 9 | 
10 | with open("foo", "U") as f:
   |
   = help: Replace with ""w""

ℹ Safe fix
5 5 | open("foo", "r")
6 6 | open("foo", "rt")
7 7 | open("f", "r", encoding="UTF-8")
8   |-open("f", "wt")
  8 |+open("f", "w")
9 9 | 
10 10 | with open("foo", "U") as f:
11 11 |     pass

UP015.py:10:6: UP015 [*] Unnecessary open mode parameters
   |
 8 | open("f", "wt")
 9 | 
10 | with open("foo", "U") as f:
   |      ^^^^^^^^^^^^^^^^ UP015
11 |     pass
12 | with open("foo", "Ur") as f:
   |
   = help: Remove open mode parameters

ℹ Safe fix
7  7  | open("f", "r", encoding="UTF-8")
8  8  | open("f", "wt")
9  9  | 
10    |-with open("foo", "U") as f:
   10 |+with open("foo") as f:
11 11 |     pass
12 12 | with open("foo", "Ur") as f:
13 13 |     pass

UP015.py:12:6: UP015 [*] Unnecessary open mode parameters
   |
10 | with open("foo", "U") as f:
11 |     pass
12 | with open("foo", "Ur") as f:
   |      ^^^^^^^^^^^^^^^^^ UP015
13 |     pass
14 | with open("foo", "Ub") as f:
   |
   = help: Remove open mode parameters

ℹ Safe fix
9  9  | 
10 10 | with open("foo", "U") as f:
11 11 |     pass
12    |-with open("foo", "Ur") as f:
   12 |+with open("foo") as f:
13 13 |     pass
14 14 | with open("foo", "Ub") as f:
15 15 |     pass

UP015.py:14:6: UP015 [*] Unnecessary open mode parameters, use ""rb""
   |
12 | with open("foo", "Ur") as f:
13 |     pass
14 | with open("foo", "Ub") as f:
   |      ^^^^^^^^^^^^^^^^^ UP015
15 |     pass
16 | with open("foo", "rUb") as f:
   |
   = help: Replace with ""rb""

ℹ Safe fix
11 11 |     pass
12 12 | with open("foo", "Ur") as f:
13 13 |     pass
14    |-with open("foo", "Ub") as f:
   14 |+with open("foo", "rb") as f:
15 15 |     pass
16 16 | with open("foo", "rUb") as f:
17 17 |     pass

UP015.py:16:6: UP015 [*] Unnecessary open mode parameters, use ""rb""
   |
14 | with open("foo", "Ub") as f:
15 |     pass
16 | with open("foo", "rUb") as f:
   |      ^^^^^^^^^^^^^^^^^^ UP015
17 |     pass
18 | with open("foo", "r") as f:
   |
   = help: Replace with ""rb""

ℹ Safe fix
13 13 |     pass
14 14 | with open("foo", "Ub") as f:
15 15 |     pass
16    |-with open("foo", "rUb") as f:
   16 |+with open("foo", "rb") as f:
17 17 |     pass
18 18 | with open("foo", "r") as f:
19 19 |     pass

UP015.py:18:6: UP015 [*] Unnecessary open mode parameters
   |
16 | with open("foo", "rUb") as f:
17 |     pass
18 | with open("foo", "r") as f:
   |      ^^^^^^^^^^^^^^^^ UP015
19 |     pass
20 | with open("foo", "rt") as f:
   |
   = help: Remove open mode parameters

ℹ Safe fix
15 15 |     pass
16 16 | with open("foo", "rUb") as f:
17 17 |     pass
18    |-with open("foo", "r") as f:
   18 |+with open("foo") as f:
19 19 |     pass
20 20 | with open("foo", "rt") as f:
21 21 |     pass

UP015.py:20:6: UP015 [*] Unnecessary open mode parameters
   |
18 | with open("foo", "r") as f:
19 |     pass
20 | with open("foo", "rt") as f:
   |      ^^^^^^^^^^^^^^^^^ UP015
21 |     pass
22 | with open("foo", "r", encoding="UTF-8") as f:
   |
   = help: Remove open mode parameters

ℹ Safe fix
17 17 |     pass
18 18 | with open("foo", "r") as f:
19 19 |     pass
20    |-with open("foo", "rt") as f:
   20 |+with open("foo") as f:
21 21 |     pass
22 22 | with open("foo", "r", encoding="UTF-8") as f:
23 23 |     pass

UP015.py:22:6: UP015 [*] Unnecessary open mode parameters
   |
20 | with open("foo", "rt") as f:
21 |     pass
22 | with open("foo", "r", encoding="UTF-8") as f:
   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
23 |     pass
24 | with open("foo", "wt") as f:
   |
   = help: Remove open mode parameters

ℹ Safe fix
19 19 |     pass
20 20 | with open("foo", "rt") as f:
21 21 |     pass
22    |-with open("foo", "r", encoding="UTF-8") as f:
   22 |+with open("foo", encoding="UTF-8") as f:
23 23 |     pass
24 24 | with open("foo", "wt") as f:
25 25 |     pass

UP015.py:24:6: UP015 [*] Unnecessary open mode parameters, use ""w""
   |
22 | with open("foo", "r", encoding="UTF-8") as f:
23 |     pass
24 | with open("foo", "wt") as f:
   |      ^^^^^^^^^^^^^^^^^ UP015
25 |     pass
   |
   = help: Replace with ""w""

ℹ Safe fix
21 21 |     pass
22 22 | with open("foo", "r", encoding="UTF-8") as f:
23 23 |     pass
24    |-with open("foo", "wt") as f:
   24 |+with open("foo", "w") as f:
25 25 |     pass
26 26 | 
27 27 | open(f("a", "b", "c"), "U")

UP015.py:27:1: UP015 [*] Unnecessary open mode parameters
   |
25 |     pass
26 | 
27 | open(f("a", "b", "c"), "U")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
28 | open(f("a", "b", "c"), "Ub")
   |
   = help: Remove open mode parameters

ℹ Safe fix
24 24 | with open("foo", "wt") as f:
25 25 |     pass
26 26 | 
27    |-open(f("a", "b", "c"), "U")
   27 |+open(f("a", "b", "c"))
28 28 | open(f("a", "b", "c"), "Ub")
29 29 | 
30 30 | with open(f("a", "b", "c"), "U") as f:

UP015.py:28:1: UP015 [*] Unnecessary open mode parameters, use ""rb""
   |
27 | open(f("a", "b", "c"), "U")
28 | open(f("a", "b", "c"), "Ub")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
29 | 
30 | with open(f("a", "b", "c"), "U") as f:
   |
   = help: Replace with ""rb""

ℹ Safe fix
25 25 |     pass
26 26 | 
27 27 | open(f("a", "b", "c"), "U")
28    |-open(f("a", "b", "c"), "Ub")
   28 |+open(f("a", "b", "c"), "rb")
29 29 | 
30 30 | with open(f("a", "b", "c"), "U") as f:
31 31 |     pass

UP015.py:30:6: UP015 [*] Unnecessary open mode parameters
   |
28 | open(f("a", "b", "c"), "Ub")
29 | 
30 | with open(f("a", "b", "c"), "U") as f:
   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
31 |     pass
32 | with open(f("a", "b", "c"), "Ub") as f:
   |
   = help: Remove open mode parameters

ℹ Safe fix
27 27 | open(f("a", "b", "c"), "U")
28 28 | open(f("a", "b", "c"), "Ub")
29 29 | 
30    |-with open(f("a", "b", "c"), "U") as f:
   30 |+with open(f("a", "b", "c")) as f:
31 31 |     pass
32 32 | with open(f("a", "b", "c"), "Ub") as f:
33 33 |     pass

UP015.py:32:6: UP015 [*] Unnecessary open mode parameters, use ""rb""
   |
30 | with open(f("a", "b", "c"), "U") as f:
31 |     pass
32 | with open(f("a", "b", "c"), "Ub") as f:
   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
33 |     pass
   |
   = help: Replace with ""rb""

ℹ Safe fix
29 29 | 
30 30 | with open(f("a", "b", "c"), "U") as f:
31 31 |     pass
32    |-with open(f("a", "b", "c"), "Ub") as f:
   32 |+with open(f("a", "b", "c"), "rb") as f:
33 33 |     pass
34 34 | 
35 35 | with open("foo", "U") as fa, open("bar", "U") as fb:

UP015.py:35:6: UP015 [*] Unnecessary open mode parameters
   |
33 |     pass
34 | 
35 | with open("foo", "U") as fa, open("bar", "U") as fb:
   |      ^^^^^^^^^^^^^^^^ UP015
36 |     pass
37 | with open("foo", "Ub") as fa, open("bar", "Ub") as fb:
   |
   = help: Remove open mode parameters

ℹ Safe fix
32 32 | with open(f("a", "b", "c"), "Ub") as f:
33 33 |     pass
34 34 | 
35    |-with open("foo", "U") as fa, open("bar", "U") as fb:
   35 |+with open("foo") as fa, open("bar", "U") as fb:
36 36 |     pass
37 37 | with open("foo", "Ub") as fa, open("bar", "Ub") as fb:
38 38 |     pass

UP015.py:35:30: UP015 [*] Unnecessary open mode parameters
   |
33 |     pass
34 | 
35 | with open("foo", "U") as fa, open("bar", "U") as fb:
   |                              ^^^^^^^^^^^^^^^^ UP015
36 |     pass
37 | with open("foo", "Ub") as fa, open("bar", "Ub") as fb:
   |
   = help: Remove open mode parameters

ℹ Safe fix
32 32 | with open(f("a", "b", "c"), "Ub") as f:
33 33 |     pass
34 34 | 
35    |-with open("foo", "U") as fa, open("bar", "U") as fb:
   35 |+with open("foo", "U") as fa, open("bar") as fb:
36 36 |     pass
37 37 | with open("foo", "Ub") as fa, open("bar", "Ub") as fb:
38 38 |     pass

UP015.py:37:6: UP015 [*] Unnecessary open mode parameters, use ""rb""
   |
35 | with open("foo", "U") as fa, open("bar", "U") as fb:
36 |     pass
37 | with open("foo", "Ub") as fa, open("bar", "Ub") as fb:
   |      ^^^^^^^^^^^^^^^^^ UP015
38 |     pass
   |
   = help: Replace with ""rb""

ℹ Safe fix
34 34 | 
35 35 | with open("foo", "U") as fa, open("bar", "U") as fb:
36 36 |     pass
37    |-with open("foo", "Ub") as fa, open("bar", "Ub") as fb:
   37 |+with open("foo", "rb") as fa, open("bar", "Ub") as fb:
38 38 |     pass
39 39 | 
40 40 | open("foo", mode="U")

UP015.py:37:31: UP015 [*] Unnecessary open mode parameters, use ""rb""
   |
35 | with open("foo", "U") as fa, open("bar", "U") as fb:
36 |     pass
37 | with open("foo", "Ub") as fa, open("bar", "Ub") as fb:
   |                               ^^^^^^^^^^^^^^^^^ UP015
38 |     pass
   |
   = help: Replace with ""rb""

ℹ Safe fix
34 34 | 
35 35 | with open("foo", "U") as fa, open("bar", "U") as fb:
36 36 |     pass
37    |-with open("foo", "Ub") as fa, open("bar", "Ub") as fb:
   37 |+with open("foo", "Ub") as fa, open("bar", "rb") as fb:
38 38 |     pass
39 39 | 
40 40 | open("foo", mode="U")

UP015.py:40:1: UP015 [*] Unnecessary open mode parameters
   |
38 |     pass
39 | 
40 | open("foo", mode="U")
   | ^^^^^^^^^^^^^^^^^^^^^ UP015
41 | open(name="foo", mode="U")
42 | open(mode="U", name="foo")
   |
   = help: Remove open mode parameters

ℹ Safe fix
37 37 | with open("foo", "Ub") as fa, open("bar", "Ub") as fb:
38 38 |     pass
39 39 | 
40    |-open("foo", mode="U")
   40 |+open("foo")
41 41 | open(name="foo", mode="U")
42 42 | open(mode="U", name="foo")
43 43 | 

UP015.py:41:1: UP015 [*] Unnecessary open mode parameters
   |
40 | open("foo", mode="U")
41 | open(name="foo", mode="U")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
42 | open(mode="U", name="foo")
   |
   = help: Remove open mode parameters

ℹ Safe fix
38 38 |     pass
39 39 | 
40 40 | open("foo", mode="U")
41    |-open(name="foo", mode="U")
   41 |+open(name="foo")
42 42 | open(mode="U", name="foo")
43 43 | 
44 44 | with open("foo", mode="U") as f:

UP015.py:42:1: UP015 [*] Unnecessary open mode parameters
   |
40 | open("foo", mode="U")
41 | open(name="foo", mode="U")
42 | open(mode="U", name="foo")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
43 | 
44 | with open("foo", mode="U") as f:
   |
   = help: Remove open mode parameters

ℹ Safe fix
39 39 | 
40 40 | open("foo", mode="U")
41 41 | open(name="foo", mode="U")
42    |-open(mode="U", name="foo")
   42 |+open(name="foo")
43 43 | 
44 44 | with open("foo", mode="U") as f:
45 45 |     pass

UP015.py:44:6: UP015 [*] Unnecessary open mode parameters
   |
42 | open(mode="U", name="foo")
43 | 
44 | with open("foo", mode="U") as f:
   |      ^^^^^^^^^^^^^^^^^^^^^ UP015
45 |     pass
46 | with open(name="foo", mode="U") as f:
   |
   = help: Remove open mode parameters

ℹ Safe fix
41 41 | open(name="foo", mode="U")
42 42 | open(mode="U", name="foo")
43 43 | 
44    |-with open("foo", mode="U") as f:
   44 |+with open("foo") as f:
45 45 |     pass
46 46 | with open(name="foo", mode="U") as f:
47 47 |     pass

UP015.py:46:6: UP015 [*] Unnecessary open mode parameters
   |
44 | with open("foo", mode="U") as f:
45 |     pass
46 | with open(name="foo", mode="U") as f:
   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
47 |     pass
48 | with open(mode="U", name="foo") as f:
   |
   = help: Remove open mode parameters

ℹ Safe fix
43 43 | 
44 44 | with open("foo", mode="U") as f:
45 45 |     pass
46    |-with open(name="foo", mode="U") as f:
   46 |+with open(name="foo") as f:
47 47 |     pass
48 48 | with open(mode="U", name="foo") as f:
49 49 |     pass

UP015.py:48:6: UP015 [*] Unnecessary open mode parameters
   |
46 | with open(name="foo", mode="U") as f:
47 |     pass
48 | with open(mode="U", name="foo") as f:
   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
49 |     pass
   |
   = help: Remove open mode parameters

ℹ Safe fix
45 45 |     pass
46 46 | with open(name="foo", mode="U") as f:
47 47 |     pass
48    |-with open(mode="U", name="foo") as f:
   48 |+with open(name="foo") as f:
49 49 |     pass
50 50 | 
51 51 | open("foo", mode="Ub")

UP015.py:51:1: UP015 [*] Unnecessary open mode parameters, use ""rb""
   |
49 |     pass
50 | 
51 | open("foo", mode="Ub")
   | ^^^^^^^^^^^^^^^^^^^^^^ UP015
52 | open(name="foo", mode="Ub")
53 | open(mode="Ub", name="foo")
   |
   = help: Replace with ""rb""

ℹ Safe fix
48 48 | with open(mode="U", name="foo") as f:
49 49 |     pass
50 50 | 
51    |-open("foo", mode="Ub")
   51 |+open("foo", mode="rb")
52 52 | open(name="foo", mode="Ub")
53 53 | open(mode="Ub", name="foo")
54 54 | 

UP015.py:52:1: UP015 [*] Unnecessary open mode parameters, use ""rb""
   |
51 | open("foo", mode="Ub")
52 | open(name="foo", mode="Ub")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
53 | open(mode="Ub", name="foo")
   |
   = help: Replace with ""rb""

ℹ Safe fix
49 49 |     pass
50 50 | 
51 51 | open("foo", mode="Ub")
52    |-open(name="foo", mode="Ub")
   52 |+open(name="foo", mode="rb")
53 53 | open(mode="Ub", name="foo")
54 54 | 
55 55 | with open("foo", mode="Ub") as f:

UP015.py:53:1: UP015 [*] Unnecessary open mode parameters, use ""rb""
   |
51 | open("foo", mode="Ub")
52 | open(name="foo", mode="Ub")
53 | open(mode="Ub", name="foo")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
54 | 
55 | with open("foo", mode="Ub") as f:
   |
   = help: Replace with ""rb""

ℹ Safe fix
50 50 | 
51 51 | open("foo", mode="Ub")
52 52 | open(name="foo", mode="Ub")
53    |-open(mode="Ub", name="foo")
   53 |+open(mode="rb", name="foo")
54 54 | 
55 55 | with open("foo", mode="Ub") as f:
56 56 |     pass

UP015.py:55:6: UP015 [*] Unnecessary open mode parameters, use ""rb""
   |
53 | open(mode="Ub", name="foo")
54 | 
55 | with open("foo", mode="Ub") as f:
   |      ^^^^^^^^^^^^^^^^^^^^^^ UP015
56 |     pass
57 | with open(name="foo", mode="Ub") as f:
   |
   = help: Replace with ""rb""

ℹ Safe fix
52 52 | open(name="foo", mode="Ub")
53 53 | open(mode="Ub", name="foo")
54 54 | 
55    |-with open("foo", mode="Ub") as f:
   55 |+with open("foo", mode="rb") as f:
56 56 |     pass
57 57 | with open(name="foo", mode="Ub") as f:
58 58 |     pass

UP015.py:57:6: UP015 [*] Unnecessary open mode parameters, use ""rb""
   |
55 | with open("foo", mode="Ub") as f:
56 |     pass
57 | with open(name="foo", mode="Ub") as f:
   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
58 |     pass
59 | with open(mode="Ub", name="foo") as f:
   |
   = help: Replace with ""rb""

ℹ Safe fix
54 54 | 
55 55 | with open("foo", mode="Ub") as f:
56 56 |     pass
57    |-with open(name="foo", mode="Ub") as f:
   57 |+with open(name="foo", mode="rb") as f:
58 58 |     pass
59 59 | with open(mode="Ub", name="foo") as f:
60 60 |     pass

UP015.py:59:6: UP015 [*] Unnecessary open mode parameters, use ""rb""
   |
57 | with open(name="foo", mode="Ub") as f:
58 |     pass
59 | with open(mode="Ub", name="foo") as f:
   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
60 |     pass
   |
   = help: Replace with ""rb""

ℹ Safe fix
56 56 |     pass
57 57 | with open(name="foo", mode="Ub") as f:
58 58 |     pass
59    |-with open(mode="Ub", name="foo") as f:
   59 |+with open(mode="rb", name="foo") as f:
60 60 |     pass
61 61 | 
62 62 | open(file="foo", mode='U', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)

UP015.py:62:1: UP015 [*] Unnecessary open mode parameters
   |
60 |     pass
61 | 
62 | open(file="foo", mode='U', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
63 | open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='U')
64 | open(file="foo", buffering=-1, encoding=None, errors=None, mode='U', newline=None, closefd=True, opener=None)
   |
   = help: Remove open mode parameters

ℹ Safe fix
59 59 | with open(mode="Ub", name="foo") as f:
60 60 |     pass
61 61 | 
62    |-open(file="foo", mode='U', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
   62 |+open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
63 63 | open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='U')
64 64 | open(file="foo", buffering=-1, encoding=None, errors=None, mode='U', newline=None, closefd=True, opener=None)
65 65 | open(mode='U', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)

UP015.py:63:1: UP015 [*] Unnecessary open mode parameters
   |
62 | open(file="foo", mode='U', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
63 | open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='U')
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
64 | open(file="foo", buffering=-1, encoding=None, errors=None, mode='U', newline=None, closefd=True, opener=None)
65 | open(mode='U', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
   |
   = help: Remove open mode parameters

ℹ Safe fix
60 60 |     pass
61 61 | 
62 62 | open(file="foo", mode='U', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
63    |-open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='U')
   63 |+open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
64 64 | open(file="foo", buffering=-1, encoding=None, errors=None, mode='U', newline=None, closefd=True, opener=None)
65 65 | open(mode='U', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
66 66 | 

UP015.py:64:1: UP015 [*] Unnecessary open mode parameters
   |
62 | open(file="foo", mode='U', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
63 | open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='U')
64 | open(file="foo", buffering=-1, encoding=None, errors=None, mode='U', newline=None, closefd=True, opener=None)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
65 | open(mode='U', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
   |
   = help: Remove open mode parameters

ℹ Safe fix
61 61 | 
62 62 | open(file="foo", mode='U', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
63 63 | open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='U')
64    |-open(file="foo", buffering=-1, encoding=None, errors=None, mode='U', newline=None, closefd=True, opener=None)
   64 |+open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
65 65 | open(mode='U', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
66 66 | 
67 67 | open(file="foo", mode='Ub', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)

UP015.py:65:1: UP015 [*] Unnecessary open mode parameters
   |
63 | open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='U')
64 | open(file="foo", buffering=-1, encoding=None, errors=None, mode='U', newline=None, closefd=True, opener=None)
65 | open(mode='U', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
66 | 
67 | open(file="foo", mode='Ub', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
   |
   = help: Remove open mode parameters

ℹ Safe fix
62 62 | open(file="foo", mode='U', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
63 63 | open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='U')
64 64 | open(file="foo", buffering=-1, encoding=None, errors=None, mode='U', newline=None, closefd=True, opener=None)
65    |-open(mode='U', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
   65 |+open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
66 66 | 
67 67 | open(file="foo", mode='Ub', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
68 68 | open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='Ub')

UP015.py:67:1: UP015 [*] Unnecessary open mode parameters, use ""rb""
   |
65 | open(mode='U', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
66 | 
67 | open(file="foo", mode='Ub', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
68 | open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='Ub')
69 | open(file="foo", buffering=-1, encoding=None, errors=None, mode='Ub', newline=None, closefd=True, opener=None)
   |
   = help: Replace with ""rb""

ℹ Safe fix
64 64 | open(file="foo", buffering=-1, encoding=None, errors=None, mode='U', newline=None, closefd=True, opener=None)
65 65 | open(mode='U', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
66 66 | 
67    |-open(file="foo", mode='Ub', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
   67 |+open(file="foo", mode="rb", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
68 68 | open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='Ub')
69 69 | open(file="foo", buffering=-1, encoding=None, errors=None, mode='Ub', newline=None, closefd=True, opener=None)
70 70 | open(mode='Ub', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)

UP015.py:68:1: UP015 [*] Unnecessary open mode parameters, use ""rb""
   |
67 | open(file="foo", mode='Ub', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
68 | open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='Ub')
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
69 | open(file="foo", buffering=-1, encoding=None, errors=None, mode='Ub', newline=None, closefd=True, opener=None)
70 | open(mode='Ub', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
   |
   = help: Replace with ""rb""

ℹ Safe fix
65 65 | open(mode='U', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
66 66 | 
67 67 | open(file="foo", mode='Ub', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
68    |-open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='Ub')
   68 |+open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode="rb")
69 69 | open(file="foo", buffering=-1, encoding=None, errors=None, mode='Ub', newline=None, closefd=True, opener=None)
70 70 | open(mode='Ub', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
71 71 | 

UP015.py:69:1: UP015 [*] Unnecessary open mode parameters, use ""rb""
   |
67 | open(file="foo", mode='Ub', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
68 | open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='Ub')
69 | open(file="foo", buffering=-1, encoding=None, errors=None, mode='Ub', newline=None, closefd=True, opener=None)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
70 | open(mode='Ub', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
   |
   = help: Replace with ""rb""

ℹ Safe fix
66 66 | 
67 67 | open(file="foo", mode='Ub', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
68 68 | open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='Ub')
69    |-open(file="foo", buffering=-1, encoding=None, errors=None, mode='Ub', newline=None, closefd=True, opener=None)
   69 |+open(file="foo", buffering=-1, encoding=None, errors=None, mode="rb", newline=None, closefd=True, opener=None)
70 70 | open(mode='Ub', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
71 71 | 
72 72 | open = 1

UP015.py:70:1: UP015 [*] Unnecessary open mode parameters, use ""rb""
   |
68 | open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='Ub')
69 | open(file="foo", buffering=-1, encoding=None, errors=None, mode='Ub', newline=None, closefd=True, opener=None)
70 | open(mode='Ub', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP015
71 | 
72 | open = 1
   |
   = help: Replace with ""rb""

ℹ Safe fix
67 67 | open(file="foo", mode='Ub', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
68 68 | open(file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='Ub')
69 69 | open(file="foo", buffering=-1, encoding=None, errors=None, mode='Ub', newline=None, closefd=True, opener=None)
70    |-open(mode='Ub', file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
   70 |+open(mode="rb", file="foo", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
71 71 | 
72 72 | open = 1
73 73 | open("foo", "U")


