Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xml.etree.ElementTree.Element.getchildren is abolished in python 3.9 #238

Merged
merged 1 commit into from
Dec 21, 2021

Conversation

belltailjp
Copy link
Member

When accessing HDFS using pfio==2.0.0 with Python 3.9 environment, it immediately raises the following error.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/contextlib.py", line 119, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.9/site-packages/pfio/v2/fs.py", line 293, in open_url
    with from_url(dirname, **kwargs) as fs:
  File "/usr/local/lib/python3.9/site-packages/pfio/v2/fs.py", line 350, in from_url
    fs = _from_scheme(scheme, dirname, kwargs, bucket=parsed.netloc)
  File "/usr/local/lib/python3.9/site-packages/pfio/v2/fs.py", line 365, in _from_scheme
    fs = Hdfs(dirname, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/pfio/v2/hdfs.py", line 185, in __init__
    self._fs = _create_fs()
  File "/usr/local/lib/python3.9/site-packages/pfio/v2/hdfs.py", line 153, in _create_fs
    for c in e.getchildren():
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren'

This is because configuration parse process calls an abolished function.
https://docs.python.org/3.8/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.getchildren
https://github.com/pfnet/pfio/blob/2.0.0/pfio/v2/hdfs.py#L153

This PR fixes this issue.
I confirmed the it also works with Python 3.8 environment as well as 3.9.

@kuenishi
Copy link
Member

/test

@pfn-ci-bot
Copy link

Successfully created a job for commit 7fa26e7:

1 similar comment
@pfn-ci-bot
Copy link

Successfully created a job for commit 7fa26e7:

@kuenishi kuenishi added this to the 2.0.1 milestone Dec 21, 2021
@kuenishi kuenishi merged commit 74127f6 into pfnet:master Dec 21, 2021
@kuenishi kuenishi added the cat:bug Bug report or fix. label Dec 21, 2021
@kuenishi kuenishi mentioned this pull request Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:bug Bug report or fix.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants