devopshq / devopshq/youtrack

bundle.to_xml() works wrong

Open
#10 1 comment 0 reactions 0 assignees View on GitHub
Error good first issue help wanted
Dominant language
Python
Stars
27
Forks
13
PR merge metrics
No merged PRs in 30d

Description

1 - problems with encoding
```python
# python 3.4
bundle = connection.get_enum_bundle('70-756-1479473044676')
bundle.to_xml() # raise

File "E:/GITHUB/dohq_youtrack\youtrack\youtrack.py", line 635, in to_xml
result += ">%s" % (escape(self.name.encode('utf-8')), self.element_name)
File "C:\Python34\lib\xml\sax\saxutils.py", line 27, in escape
data = data.replace("&", "&")
TypeError: 'str' does not support the buffer interface
```

and from https://github.com/devopshq/youtrack/issues/9
```
# python 3.6.3
ipdb> str(bundle_value)
''
ipdb> bundle_value.to_xml()
*** TypeError: a bytes-like object is required, not 'str'
```

2 - problem with attribute
When I `GET /rest/admin/customfield/bundle/70-756-1479473044676` xml is:
```xml

Non-default Container
Default Container
11

```

After, i try `bundle.to_xml()` and get this, without **colorIndex**
```xml

Non-default Container
Default Container
11

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.