Skip to content

Commit

Permalink
[IMP] auto_backup: phase out deprecated osutil.tempdir()
Browse files Browse the repository at this point in the history
Before this commit  a backup would give the following warning:
odoo.tools.osutil.tempdir: Deprecated: use tempfile.TemporaryDirectory
We go to the natie TemporaryDirectory() now and follow Odoo their path (odoo/odoo#39573)
"tempdir is redundant with tempfile.TemporaryDirectory added in 3.2"
  • Loading branch information
Yenthe666 authored Apr 11, 2021
1 parent ac913e1 commit ec6b55f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion auto_backup/models/db_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def _take_dump(self, db_name, stream, model, backup_format='zip'):
cmd.append(db_name)

if backup_format == 'zip':
with odoo.tools.osutil.tempdir() as dump_dir:
with tempfile.TemporaryDirectory() as dump_dir:
filestore = odoo.tools.config.filestore(db_name)
if os.path.exists(filestore):
shutil.copytree(filestore, os.path.join(dump_dir, 'filestore'))
Expand Down

0 comments on commit ec6b55f

Please sign in to comment.