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

infra/helper.py broken in Python 2 #4792

Closed
cmeister2 opened this issue Dec 7, 2020 · 1 comment · Fixed by #4793
Closed

infra/helper.py broken in Python 2 #4792

cmeister2 opened this issue Dec 7, 2020 · 1 comment · Fixed by #4793
Assignees

Comments

@cmeister2
Copy link
Contributor

Hi,

Commit f533434 introduced a number of os.makedirs(directory, exist_ok=True) calls. As per https://docs.python.org/2.7/library/os.html and https://docs.python.org/3.5/library/os.html, exist_ok was added in 3.2.

This broke the CI checking here: libsndfile/libsndfile#663 with the error:

TypeError: makedirs() got an unexpected keyword argument 'exist_ok'

Not sure if this was the intention or not - and I don't mind fixing up our code to use python 3 to execute the script instead of python 2. If the intention is that python 3 is the default now, perhaps the shebang of infra/helper.py should be updated from

#!/usr/bin/env python

to

#!/usr/bin/env python3
```?
@jonathanmetzman
Copy link
Contributor

Thanks for letting know about this. I'm going to change this code to work with python2 again.
@oliverchang Do you think we should just switch to python3?
I wonder if there's something like caniuse.com for python versions that we can use to find out which distros/OSes have python3.

@jonathanmetzman jonathanmetzman self-assigned this Dec 7, 2020
jonathanmetzman added a commit that referenced this issue Dec 7, 2020
Recently some python3-only code was added. Make code compatible with
Python2. Fixes #4792
jonathanmetzman added a commit that referenced this issue Dec 7, 2020
Recently some python3-only code was added. Make code compatible with
Python2. Fixes #4792
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants