---
source: crates/ruff_linter/src/rules/pyupgrade/mod.rs
---
UP025.py:1:1: UP025 [*] Remove unicode literals from strings
  |
1 | u"Hello"
  | ^^^^^^^^ UP025
2 | 
3 | x = u"Hello"  # UP025
  |
  = help: Remove unicode prefix

ℹ Safe fix
1   |-u"Hello"
  1 |+"Hello"
2 2 | 
3 3 | x = u"Hello"  # UP025
4 4 | 

UP025.py:3:5: UP025 [*] Remove unicode literals from strings
  |
1 | u"Hello"
2 | 
3 | x = u"Hello"  # UP025
  |     ^^^^^^^^ UP025
4 | 
5 | u'world'  # UP025
  |
  = help: Remove unicode prefix

ℹ Safe fix
1 1 | u"Hello"
2 2 | 
3   |-x = u"Hello"  # UP025
  3 |+x = "Hello"  # UP025
4 4 | 
5 5 | u'world'  # UP025
6 6 | 

UP025.py:5:1: UP025 [*] Remove unicode literals from strings
  |
3 | x = u"Hello"  # UP025
4 | 
5 | u'world'  # UP025
  | ^^^^^^^^ UP025
6 | 
7 | print(u"Hello")  # UP025
  |
  = help: Remove unicode prefix

ℹ Safe fix
2 2 | 
3 3 | x = u"Hello"  # UP025
4 4 | 
5   |-u'world'  # UP025
  5 |+'world'  # UP025
6 6 | 
7 7 | print(u"Hello")  # UP025
8 8 | 

UP025.py:7:7: UP025 [*] Remove unicode literals from strings
  |
5 | u'world'  # UP025
6 | 
7 | print(u"Hello")  # UP025
  |       ^^^^^^^^ UP025
8 | 
9 | print(u'world')  # UP025
  |
  = help: Remove unicode prefix

ℹ Safe fix
4 4 | 
5 5 | u'world'  # UP025
6 6 | 
7   |-print(u"Hello")  # UP025
  7 |+print("Hello")  # UP025
8 8 | 
9 9 | print(u'world')  # UP025
10 10 | 

UP025.py:9:7: UP025 [*] Remove unicode literals from strings
   |
 7 | print(u"Hello")  # UP025
 8 | 
 9 | print(u'world')  # UP025
   |       ^^^^^^^^ UP025
10 | 
11 | import foo
   |
   = help: Remove unicode prefix

ℹ Safe fix
6  6  | 
7  7  | print(u"Hello")  # UP025
8  8  | 
9     |-print(u'world')  # UP025
   9  |+print('world')  # UP025
10 10 | 
11 11 | import foo
12 12 | 

UP025.py:13:5: UP025 [*] Remove unicode literals from strings
   |
11 | import foo
12 | 
13 | foo(u"Hello", U"world", a=u"Hello", b=u"world")  # UP025
   |     ^^^^^^^^ UP025
14 | 
15 | # Retain quotes when fixing.
   |
   = help: Remove unicode prefix

ℹ Safe fix
10 10 | 
11 11 | import foo
12 12 | 
13    |-foo(u"Hello", U"world", a=u"Hello", b=u"world")  # UP025
   13 |+foo("Hello", U"world", a=u"Hello", b=u"world")  # UP025
14 14 | 
15 15 | # Retain quotes when fixing.
16 16 | x = u'hello'  # UP025

UP025.py:13:15: UP025 [*] Remove unicode literals from strings
   |
11 | import foo
12 | 
13 | foo(u"Hello", U"world", a=u"Hello", b=u"world")  # UP025
   |               ^^^^^^^^ UP025
14 | 
15 | # Retain quotes when fixing.
   |
   = help: Remove unicode prefix

ℹ Safe fix
10 10 | 
11 11 | import foo
12 12 | 
13    |-foo(u"Hello", U"world", a=u"Hello", b=u"world")  # UP025
   13 |+foo(u"Hello", "world", a=u"Hello", b=u"world")  # UP025
14 14 | 
15 15 | # Retain quotes when fixing.
16 16 | x = u'hello'  # UP025

UP025.py:13:27: UP025 [*] Remove unicode literals from strings
   |
11 | import foo
12 | 
13 | foo(u"Hello", U"world", a=u"Hello", b=u"world")  # UP025
   |                           ^^^^^^^^ UP025
14 | 
15 | # Retain quotes when fixing.
   |
   = help: Remove unicode prefix

ℹ Safe fix
10 10 | 
11 11 | import foo
12 12 | 
13    |-foo(u"Hello", U"world", a=u"Hello", b=u"world")  # UP025
   13 |+foo(u"Hello", U"world", a="Hello", b=u"world")  # UP025
14 14 | 
15 15 | # Retain quotes when fixing.
16 16 | x = u'hello'  # UP025

UP025.py:13:39: UP025 [*] Remove unicode literals from strings
   |
11 | import foo
12 | 
13 | foo(u"Hello", U"world", a=u"Hello", b=u"world")  # UP025
   |                                       ^^^^^^^^ UP025
14 | 
15 | # Retain quotes when fixing.
   |
   = help: Remove unicode prefix

ℹ Safe fix
10 10 | 
11 11 | import foo
12 12 | 
13    |-foo(u"Hello", U"world", a=u"Hello", b=u"world")  # UP025
   13 |+foo(u"Hello", U"world", a=u"Hello", b="world")  # UP025
14 14 | 
15 15 | # Retain quotes when fixing.
16 16 | x = u'hello'  # UP025

UP025.py:16:5: UP025 [*] Remove unicode literals from strings
   |
15 | # Retain quotes when fixing.
16 | x = u'hello'  # UP025
   |     ^^^^^^^^ UP025
17 | x = u"""hello"""  # UP025
18 | x = u'''hello'''  # UP025
   |
   = help: Remove unicode prefix

ℹ Safe fix
13 13 | foo(u"Hello", U"world", a=u"Hello", b=u"world")  # UP025
14 14 | 
15 15 | # Retain quotes when fixing.
16    |-x = u'hello'  # UP025
   16 |+x = 'hello'  # UP025
17 17 | x = u"""hello"""  # UP025
18 18 | x = u'''hello'''  # UP025
19 19 | x = u'Hello "World"'  # UP025

UP025.py:17:5: UP025 [*] Remove unicode literals from strings
   |
15 | # Retain quotes when fixing.
16 | x = u'hello'  # UP025
17 | x = u"""hello"""  # UP025
   |     ^^^^^^^^^^^^ UP025
18 | x = u'''hello'''  # UP025
19 | x = u'Hello "World"'  # UP025
   |
   = help: Remove unicode prefix

ℹ Safe fix
14 14 | 
15 15 | # Retain quotes when fixing.
16 16 | x = u'hello'  # UP025
17    |-x = u"""hello"""  # UP025
   17 |+x = """hello"""  # UP025
18 18 | x = u'''hello'''  # UP025
19 19 | x = u'Hello "World"'  # UP025
20 20 | 

UP025.py:18:5: UP025 [*] Remove unicode literals from strings
   |
16 | x = u'hello'  # UP025
17 | x = u"""hello"""  # UP025
18 | x = u'''hello'''  # UP025
   |     ^^^^^^^^^^^^ UP025
19 | x = u'Hello "World"'  # UP025
   |
   = help: Remove unicode prefix

ℹ Safe fix
15 15 | # Retain quotes when fixing.
16 16 | x = u'hello'  # UP025
17 17 | x = u"""hello"""  # UP025
18    |-x = u'''hello'''  # UP025
   18 |+x = '''hello'''  # UP025
19 19 | x = u'Hello "World"'  # UP025
20 20 | 
21 21 | u = "Hello"  # OK

UP025.py:19:5: UP025 [*] Remove unicode literals from strings
   |
17 | x = u"""hello"""  # UP025
18 | x = u'''hello'''  # UP025
19 | x = u'Hello "World"'  # UP025
   |     ^^^^^^^^^^^^^^^^ UP025
20 | 
21 | u = "Hello"  # OK
   |
   = help: Remove unicode prefix

ℹ Safe fix
16 16 | x = u'hello'  # UP025
17 17 | x = u"""hello"""  # UP025
18 18 | x = u'''hello'''  # UP025
19    |-x = u'Hello "World"'  # UP025
   19 |+x = 'Hello "World"'  # UP025
20 20 | 
21 21 | u = "Hello"  # OK
22 22 | u = u  # OK

UP025.py:27:7: UP025 [*] Remove unicode literals from strings
   |
25 |     return"Hello"  # OK
26 | 
27 | f"foo"u"bar"  # OK
   |       ^^^^^^ UP025
28 | f"foo" u"bar"  # OK
   |
   = help: Remove unicode prefix

ℹ Safe fix
24 24 | def hello():
25 25 |     return"Hello"  # OK
26 26 | 
27    |-f"foo"u"bar"  # OK
   27 |+f"foo""bar"  # OK
28 28 | f"foo" u"bar"  # OK

UP025.py:28:8: UP025 [*] Remove unicode literals from strings
   |
27 | f"foo"u"bar"  # OK
28 | f"foo" u"bar"  # OK
   |        ^^^^^^ UP025
   |
   = help: Remove unicode prefix

ℹ Safe fix
25 25 |     return"Hello"  # OK
26 26 | 
27 27 | f"foo"u"bar"  # OK
28    |-f"foo" u"bar"  # OK
   28 |+f"foo" "bar"  # OK


