Skip to content

string.split() string.join() causes AttributeError in Python 3.x #233

@rooa

Description

@rooa

Some of function calls that involves string.split() or string.join() (e.g. _addindent) is incompatible with Python 3 (see below).

Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul  2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import string
>>> string.split("test1 test2")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'string' has no attribute 'split'

Would it be better to use s.split("\n") or "\n".join(s) instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions