Incorrect usage of str.split()
palant opened this issue · comments
Wladimir Palant commented
The codebase contains statements like the following:
lname, chunklist = line.split(";", 2)
This particular example can be found here. Whoever wrote this seems to think that the second parameter to str.split()
indicates the number of resulting string parts, like in JavaScript. However, in Python it's the maximum number of splits, so it should be line.split(";", 1)
.
Ryan Tilder commented
Lots of instances. Fixed.