I am using
rootPath = (rootPath.rsplit('/', 1)).rsplit('/', 1)
expected type, got
rootPath is a bytes object and PyCharm is warning you that the
sep parameter on
rsplit has to either be
bytes. That's specified in the beginning of the Documentation on Bytes and ByteArray Operations:
The methods on bytes and bytearray objects don’t accept strings as their arguments, just as the methods on strings don’t accept bytes as their arguments.
Optional[type] is either
type which in your case is
In a simple Python REPL the message is slightly different but the gist is the same:
b'hello/world'.rsplit('/') # error bytes-like object required
Instead you need to supply a
None in order to get it to work.