BaseException.message has been deprecated as of Python 2.6

Bug #506427 reported by Casufi
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Low
OpenERP's Framework R&D

Bug Description

I am trying to backup my OpenERP database using "Databases" - "Backup" buttons on OpenERP web client.
I got the following error message on a server linux console

casufi@forth-server:~/projects/openobject-server$ python ./bin/openerp-server.py
[2010-01-12 15:59:03,556] INFO:server:version - 5.0.7
[2010-01-12 15:59:03,560] INFO:server:addons_path - /home/casufi/projects/openobject-server/bin/addons
[2010-01-12 15:59:03,561] INFO:server:database hostname - 127.0.0.1
[2010-01-12 15:59:03,562] INFO:server:database port - 5432
[2010-01-12 15:59:03,563] INFO:server:database user - openerp
[2010-01-12 15:59:03,574] INFO:objects:initialising distributed objects services
[2010-01-12 15:59:03,780] INFO:web-services:starting XML-RPC services, port 8069
[2010-01-12 15:59:03,782] INFO:web-services:starting NET-RPC service, port 8070
[2010-01-12 15:59:03,782] INFO:web-services:the server is running, waiting for connections...
DeprecationWarning: BaseException.message has been deprecated as of Python 2.6/home/casufi/projects/openobject-server/bin/tools/misc.py:145: DeprecationWarning: os.popen2 is deprecated. Use the subprocess module.
  return os.popen2(cmd, 'b')
Password:
[2010-01-12 16:02:08,006] INFO:web-services:DUMP DB: demo

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

Hi,

It's not an error message but simply a warning.

Thanks

Changed in openobject-server:
status: New → Confirmed
milestone: none → 5.2
importance: Undecided → Low
Revision history for this message
Casufi (vladimirkotulskiy) wrote :

This is not warning because database backup was not created

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

Attention, there is two problems.

1. You have a DeprecationWarning from python2.6
2. You can't create a database

In this bug report, it's the first case and not the second.

Please, Create a bug report for the second case.

Thanks

Revision history for this message
Islam Abou El Ata (kindyroot) wrote :

I have the exact same problem when I try to restore a database, is there any solution? I am stuck with that many days now!

Revision history for this message
Islam Abou El Ata (kindyroot) wrote :

I found a solution to the password that is being asked for! you create a .pgpass file in your home directory with 0600 permissions and you put your password in it, for more information on how to do that, search the term ".pgpass" I hope this helps.

Revision history for this message
Michael Telahun Makonnen (mmakonnen) wrote :

One of the things this bug report shows is that people are being misled by this warning. They think that this warning is the cause of the error, when it is not. The fix seems to be an easy one: reverse the order of the the hasattr() calls in tools/misc.py. This way python >= 2.6 will never hit the deprecated check for the 'message' attribute. Patch attached.

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
milestone: 6.0 → none
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

The specific warning message in the title of this bug has been removed in v6.0. Thanks Michael for taking the time to provide a patch for the warning.

As for v5.0, we only apply bugfixes in stable versions, and this is not a bugfix but an improvement, so we can't do it.

Concerning the issue with the save/restore asking for a password, this is because you have configured your Postgres database to use password protection for the user that OpenERP is using, and the dump/restore operations are performed by OpenERP by directly calling the postgres command-line tools (pg_dump/pg_restore), which thus require a password.

In that case you can add it in the $HOME/.pgpass of that user (for Unix), or in %APPDATA%\postgresql\pgpass.conf (for Windows). Alternatively you can use ident-based authentication for postgres and avoid that issue.
You will find more information about this in the postgres documentation, for example: http://www.postgresql.org/docs/8.3/static/libpq-pgpass.html

Changed in openobject-server:
milestone: none → 6.0-rc2
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.