Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #4066 (closed)

Opened 13 years ago

Closed 12 years ago

Bug: py2.6 complains about ServerException.message

Reported by: jamoore Owned by:
Priority: minor Milestone: OMERO-4.4
Component: OmeroPy Version: n.a.
Keywords: n.a. Cc: cneves, cxallan
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: n.a.
Sprint: 2012-01-17 (6)

Description

$ bin/omero user add x y z ome
/homes/jmoore/git/dist/lib/python/omero_ServerErrors_ice.py:35: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  self.message = message
/homes/jmoore/git/dist/lib/python/omero_api_IAdmin_ice.py:255: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  return _M_omero.api.IAdmin._op_createExperimenter.invoke(self, ((user, defaultGroup, groups), _ctx))
<string>:122: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6

Change History (1)

comment:1 Changed 12 years ago by jmoore

  • Cc cxallan added
  • Milestone changed from Unscheduled to OMERO-Beta4.4
  • Resolution set to fixed
  • Sprint set to 2012-01-17 (6)
  • Status changed from new to closed

Forgot that there was a ticket for this, so didn't add a ticket number to my commit:

commit ccbee978e2072fdfcf62d6d8bf9eb9a81c36fdec
Author: jmoore <josh@glencoesoftware.com>
Date:   Tue Jan 3 11:44:42 2012 +0100

    Prevent BaseException.message warning under Py26

diff --git a/components/tools/OmeroPy/src/omero/__init__.py b/components/tools/OmeroPy/src/omero/__init__.py
index 79ca4a5..f6e9e46 100644
--- a/components/tools/OmeroPy/src/omero/__init__.py
+++ b/components/tools/OmeroPy/src/omero/__init__.py
@@ -38,3 +38,15 @@ class UnloadedEntityException(ClientError):
 
 class UnloadedCollectionException(ClientError):
     pass
+
+#
+# Workaround for warning messages produced in
+# code-generated Ice files.
+#
+_sys = __import__("sys")
+if _sys.version_info[:2] == (2, 6):
+    import warnings
+    warnings.filterwarnings(
+        action='ignore',
+        message='BaseException.message has been deprecated as of Python 2.6',
+        category=DeprecationWarning)

This has been pushed to my sprint5-server-backlog branch.

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.70116 sec.)

We're Hiring!