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

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

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

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

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

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

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

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

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

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

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

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

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

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

UP025 [*] Remove unicode literals from strings
  --> UP025.py:28:8
   |
27 | f"foo"u"bar"  # OK
28 | f"foo" u"bar"  # OK
   |        ^^^^^^
29 |
30 | # https://github.com/astral-sh/ruff/issues/18895
   |
help: Remove unicode prefix
   |
27 | f"foo"u"bar"  # OK
   - f"foo" u"bar"  # OK
28 + f"foo" "bar"  # OK
29 |
   |

UP025 [*] Remove unicode literals from strings
  --> UP025.py:31:3
   |
30 | # https://github.com/astral-sh/ruff/issues/18895
31 | ""u""
   |   ^^^
32 | ""u"hi"
33 | """"""""""""""""""""u"hi"
   |
help: Remove unicode prefix
   |
30 | # https://github.com/astral-sh/ruff/issues/18895
   - ""u""
31 + "" ""
32 | ""u"hi"
   |

UP025 [*] Remove unicode literals from strings
  --> UP025.py:32:3
   |
30 | # https://github.com/astral-sh/ruff/issues/18895
31 | ""u""
32 | ""u"hi"
   |   ^^^^^
33 | """"""""""""""""""""u"hi"
34 | ""U"helloooo"
   |
help: Remove unicode prefix
   |
31 | ""u""
   - ""u"hi"
32 + "" "hi"
33 | """"""""""""""""""""u"hi"
   |

UP025 [*] Remove unicode literals from strings
  --> UP025.py:33:21
   |
31 | ""u""
32 | ""u"hi"
33 | """"""""""""""""""""u"hi"
   |                     ^^^^^
34 | ""U"helloooo"
   |
help: Remove unicode prefix
   |
32 | ""u"hi"
   - """"""""""""""""""""u"hi"
33 + """""""""""""""""""" "hi"
34 | ""U"helloooo"
   |

UP025 [*] Remove unicode literals from strings
  --> UP025.py:34:3
   |
32 | ""u"hi"
33 | """"""""""""""""""""u"hi"
34 | ""U"helloooo"
   |   ^^^^^^^^^^^
   |
help: Remove unicode prefix
   |
33 | """"""""""""""""""""u"hi"
   - ""U"helloooo"
34 + "" "helloooo"
   |
