Skip to content

Result.from_xml data argument has a wrong type doc #57

@wiktorn

Description

@wiktorn

Passing Element as a data argument to Result.from_xml() as docstring suggests raises Exception.

>>> overpy.Result.from_xml(xml.etree.ElementTree.fromstring("<osm />"))
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/w/osm-borders/lib/python3.5/site-packages/overpy/__init__.py", line 310, in from_xml
    source = StringIO(data)
TypeError: initial_value must be str or None, not xml.etree.ElementTree.Element

It looks like it expects string right now:

>>> overpy.Result.from_xml("<osm />")
<overpy.Result object at 0x7faf632b2eb8>

My python version is:
$ python --version
Python 3.5.2

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.10
DISTRIB_CODENAME=yakkety
DISTRIB_DESCRIPTION="Ubuntu 16.10"

(My guess that Ubuntu's Python 3.5.2 is far more similar to Python 3.6 than to 3.5)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions