Bandwidth / python-bandwidth-iris

Python client library for Bandwidth's Phone Number Dashboard
https://bandwidth.com
MIT License
2 stars 8 forks source link

[BUG] Replace deprecated getchildren method with list() #29

Open pkimp1 opened 3 months ago

pkimp1 commented 3 months ago

Description

For Python 3.9 and up, the getchildren() method is removed. See https://docs.python.org/3.8/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.getchildren

This will cause an error with message 'xml.etree.ElementTree.Element' object has no attribute 'getchildren'.

Environment Information

Stack Trace

'xml.etree.ElementTree.Element' object has no attribute 'getchildren'

Sample Code Snippet

if element.tag == search_name:
    element_children = element.getchildren()
# instead use
if element.tag == search_name:
    element_children = list(element)

Suggested Fix

Replace all occurrences of this method (getchildren()) with list() as stated in the documentation linked above.

ajrice6713 commented 3 months ago

Hey @pkimp1 - this is on our backlog to fix, I just cant give you a timeline right now.

As you're aware, to install this SDK you must pull directly from github, which means we are unable to introduce any breaking changes in the SDK - and fixing this issue would break anyone using this SDK with python <= 3.8

That most likely means we will be deprecating this repo and migrating the source to a new repo, and releasing to PyPi from there so we can properly version this package

More to come here, and I hope to get this work pulled in within the next week or so - will keep this issue open to track and hopefully have some more info for ya soon!

pkimp1 commented 3 months ago

@ajrice6713 Thanks for the update! We'll keep an eye out for the new package.

ajrice6713 commented 1 month ago

Hi @pkimp1

The new package is available, we moved to a new repository called python-numbers-sdk and deployed to pip using pip install bandwidth-numbers-sdk

There was a breaking change in that we changed the name of the package, so instead of import iris_sdk you will need to use import bandwidth_numbers