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

[FIX] auto_backup: TypeError: makedirs() got an unexpected keyword argument 'exist_ok' #2902

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

eLBati
Copy link
Member

@eLBati eLBati commented Apr 10, 2024

No description provided.

@valentincastravete
Copy link

valentincastravete commented Apr 10, 2024

Hi @eLBati

That error is related to having a lower Python version that the required by the Odoo 12.0 version:
Required Python version for Odoo 12.0

As you can see, in the Python2, there is no "exist_ok" in the "make_dirs" function:
Python2
But in the Python3 version, you can see that it's there:
Python3

"New in version 3.2: The exist_ok parameter."

I suggest you manually remove that parameter in the server-tools repo in your project or update the Python version to the required one by the Odoo version 12.0.

I've put the parameter there to not to get an Error when trying to create a directory if it already exists, it just ignores that error:
If exist_ok is False (the default), an OSError is raised if the target directory already exists.

Regards

@eLBati
Copy link
Member Author

eLBati commented Apr 12, 2024

Hi @valentincastravete
my odoo server is running on Python 3.6.9

The change does not involve os.makedirs but pysftp.Connection.makedirs() which does not accept exist_ok AFAICS

@valentincastravete
Copy link

valentincastravete commented Apr 12, 2024

Hi @eLBati

You are right, I checked on the wrong package, sorry.
Okay, then I suggest you also remove the ", exist_ok=True" from the line 163 on the test_db_backup.py so it can pass the tests.

Could you merge this FIX, please? @thomaspaulb
Thanks!

@eLBati eLBati force-pushed the 12.0-fix-makedirs branch from 1acd143 to b73860c Compare April 12, 2024 12:29
@eLBati
Copy link
Member Author

eLBati commented Apr 12, 2024

@valentincastravete thanks, done

@thomaspaulb
Copy link
Contributor

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 12.0-ocabot-merge-pr-2902-by-thomaspaulb-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 3b57255 into OCA:12.0 Apr 12, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at d189d4b. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants