---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
PLE1310 String `strip` call contains duplicate characters
 --> bad_str_strip_call.py:2:21
  |
1 | # PLE1310
2 | "Hello World".strip("Hello")
  |                     ^^^^^^^
3 |
4 | # PLE1310
  |

PLE1310 String `strip` call contains duplicate characters
 --> bad_str_strip_call.py:5:21
  |
4 | # PLE1310
5 | "Hello World".strip("Hello")
  |                     ^^^^^^^
6 |
7 | # PLE1310
  |

PLE1310 String `strip` call contains duplicate characters
  --> bad_str_strip_call.py:8:21
   |
 7 | # PLE1310
 8 | "Hello World".strip(u"Hello")
   |                     ^^^^^^^^
 9 |
10 | # PLE1310
   |

PLE1310 String `strip` call contains duplicate characters
  --> bad_str_strip_call.py:11:21
   |
10 | # PLE1310
11 | "Hello World".strip(r"Hello")
   |                     ^^^^^^^^
12 |
13 | # PLE1310
   |

PLE1310 String `strip` call contains duplicate characters
  --> bad_str_strip_call.py:14:21
   |
13 | # PLE1310
14 | "Hello World".strip("Hello\t")
   |                     ^^^^^^^^^
15 |
16 | # PLE1310
   |

PLE1310 String `strip` call contains duplicate characters
  --> bad_str_strip_call.py:17:21
   |
16 | # PLE1310
17 | "Hello World".strip(r"Hello\t")
   |                     ^^^^^^^^^^
18 |
19 | # PLE1310
   |

PLE1310 String `strip` call contains duplicate characters
  --> bad_str_strip_call.py:20:21
   |
19 | # PLE1310
20 | "Hello World".strip("Hello\\")
   |                     ^^^^^^^^^
21 |
22 | # PLE1310
   |

PLE1310 String `strip` call contains duplicate characters
  --> bad_str_strip_call.py:23:21
   |
22 | # PLE1310
23 | "Hello World".strip(r"Hello\\")
   |                     ^^^^^^^^^^
24 |
25 | # PLE1310
   |

PLE1310 String `strip` call contains duplicate characters
  --> bad_str_strip_call.py:26:21
   |
25 | # PLE1310
26 | "Hello World".strip("🤣🤣🤣🤣🙃👀😀")
   |                     ^^^^^^^^^^^^^^^^
27 |
28 | # PLE1310
   |

PLE1310 String `strip` call contains duplicate characters
  --> bad_str_strip_call.py:30:5
   |
28 |   # PLE1310
29 |   "Hello World".strip(
30 | /     """
31 | | there are a lot of characters to strip
32 | | """
   | |___^
33 |   )
   |

PLE1310 String `strip` call contains duplicate characters
  --> bad_str_strip_call.py:36:21
   |
35 |   # PLE1310
36 |   "Hello World".strip("can we get a long " \
   |  _____________________^
37 | |                     "string of characters to strip " \
38 | |                     "please?")
   | |_____________________________^
39 |
40 |   # PLE1310
   |

PLE1310 String `strip` call contains duplicate characters
  --> bad_str_strip_call.py:42:5
   |
40 |   # PLE1310
41 |   "Hello World".strip(
42 | /     "can we get a long "
43 | |     "string of characters to strip "
44 | |     "please?"
   | |_____________^
45 |   )
   |

PLE1310 String `strip` call contains duplicate characters
  --> bad_str_strip_call.py:49:5
   |
47 |   # PLE1310
48 |   "Hello World".strip(
49 | /     "can \t we get a long"
50 | |     "string \t of characters to strip"
51 | |     "please?"
   | |_____________^
52 |   )
   |

PLE1310 String `strip` call contains duplicate characters
  --> bad_str_strip_call.py:61:11
   |
60 | # PLE1310
61 | u''.strip('http://')
   |           ^^^^^^^^^
62 |
63 | # PLE1310
   |

PLE1310 String `lstrip` call contains duplicate characters (did you mean `removeprefix`?)
  --> bad_str_strip_call.py:64:12
   |
63 | # PLE1310
64 | u''.lstrip('http://')
   |            ^^^^^^^^^
65 |
66 | # PLE1310
   |

PLE1310 String `rstrip` call contains duplicate characters (did you mean `removesuffix`?)
  --> bad_str_strip_call.py:67:12
   |
66 | # PLE1310
67 | b''.rstrip(b'http://')
   |            ^^^^^^^^^^
68 |
69 | # OK
   |

PLE1310 String `strip` call contains duplicate characters
  --> bad_str_strip_call.py:79:10
   |
78 | # Errors: Multiple backslashes
79 | ''.strip('\\b\\x09')
   |          ^^^^^^^^^^
80 | ''.strip(r'\b\x09')
81 | ''.strip('\\\x5C')
   |

PLE1310 String `strip` call contains duplicate characters
  --> bad_str_strip_call.py:80:10
   |
78 | # Errors: Multiple backslashes
79 | ''.strip('\\b\\x09')
80 | ''.strip(r'\b\x09')
   |          ^^^^^^^^^
81 | ''.strip('\\\x5C')
   |

PLE1310 String `strip` call contains duplicate characters
  --> bad_str_strip_call.py:81:10
   |
79 | ''.strip('\\b\\x09')
80 | ''.strip(r'\b\x09')
81 | ''.strip('\\\x5C')
   |          ^^^^^^^^
82 |
83 | # Errors: Type inference
   |

PLE1310 String `strip` call contains duplicate characters
  --> bad_str_strip_call.py:85:9
   |
83 | # Errors: Type inference
84 | b = b''
85 | b.strip(b'//')
   |         ^^^^^
86 |
87 | # Errors: Type inference (preview)
   |

PLE1310 String `rstrip` call contains duplicate characters (did you mean `removesuffix`?)
  --> bad_str_strip_call.py:89:12
   |
87 | # Errors: Type inference (preview)
88 | foo: str = ""; bar: bytes = b""
89 | foo.rstrip("//")
   |            ^^^^
90 | bar.lstrip(b"//")
   |

PLE1310 String `lstrip` call contains duplicate characters (did you mean `removeprefix`?)
  --> bad_str_strip_call.py:90:12
   |
88 | foo: str = ""; bar: bytes = b""
89 | foo.rstrip("//")
90 | bar.lstrip(b"//")
   |            ^^^^^
   |
