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

click-odoo-backupdb: subprocess DeprecationWarning #129

Open
psugne opened this issue Mar 27, 2023 · 4 comments
Open

click-odoo-backupdb: subprocess DeprecationWarning #129

psugne opened this issue Mar 27, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@psugne
Copy link

psugne commented Mar 27, 2023

Used:
python3.10
Odoo 16.0

Tested and noticed only on Odoo version 16.0

Traceback:

py.warnings: /opt/odoo/venv/lib/python3.10/site-packages/click_odoo_contrib/backupdb.py:28: DeprecationWarning: Since 16.0, just use `subprocess`.
  File "/opt/odoo/venv/bin/click-odoo-backupdb", line 8, in <module>
    sys.exit(main())
  File "/opt/odoo/venv/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/odoo/venv/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/odoo/venv/lib/python3.10/site-packages/click_odoo/env_options.py", line 199, in _invoke
    return self.org_invoke(ctx)
  File "/opt/odoo/venv/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/odoo/venv/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/odoo/venv/lib/python3.10/site-packages/click_odoo_contrib/backupdb.py", line 121, in main
    _dump_db(dbname, _backup)
  File "/opt/odoo/venv/lib/python3.10/site-packages/click_odoo_contrib/backupdb.py", line 28, in _dump_db
    _stdin, stdout = odoo.tools.exec_pg_command_pipe(*cmd)

A Warning comes on doing a backup from here where Odoo warns about deprecation here. Related with Odoo commit.

@psugne psugne changed the title click-odoo-backupdb: `subprocess' DeprecationWarning click-odoo-backupdb: subprocess DeprecationWarning Mar 27, 2023
@JakubSs
Copy link

JakubSs commented Oct 27, 2023

is there any update?

@psugne
Copy link
Author

psugne commented Oct 27, 2023

is there any update?

Still no feedback

@sbidoul sbidoul added the enhancement New feature or request label Oct 29, 2023
@sbidoul
Copy link
Member

sbidoul commented Oct 29, 2023

This still works in 17. No time to handle this today. A PR is welcome.

@peterromao
Copy link

peterromao commented Mar 22, 2024

I am having this too on Odoo 16.0 20240216 build. Python 3.9.

Is this just a question of substituting
_stdin, stdout = odoo.tools.exec_pg_command_pipe(*cmd)
to
_stdin, stdout = subprocess.run(cmd, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT, check=True)

?

I don't even know where to change this to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants