13019 DeprecationWarnings seen after python 2.6 migration
authorDan Price <dp@eng.sun.com>
Thu, 17 Dec 2009 16:20:13 -0800
changeset 1603 84bd53597209
parent 1602 78e23eef26fc
child 1604 a150e634e8c2
13019 DeprecationWarnings seen after python 2.6 migration
doc/client_api_versions.txt
src/client.py
src/gui/modules/installupdate.py
src/gui/modules/misc.py
src/gui/modules/misc_non_gui.py
src/modules/client/api.py
src/modules/client/api_errors.py
src/modules/client/image.py
src/pkgdep.py
src/tests/cli/t_api.py
src/tests/cli/t_api_info.py
src/tests/cli/t_api_list.py
src/tests/cli/t_api_search.py
src/tests/cli/t_pkg_api_install.py
src/tests/cli/t_pkg_intent.py
src/tests/cli/t_pkgdep_resolve.py
--- a/doc/client_api_versions.txt	Thu Dec 17 15:56:34 2009 -0800
+++ b/doc/client_api_versions.txt	Thu Dec 17 16:20:13 2009 -0800
@@ -1,3 +1,10 @@
+Version 28:
+Incompatible with clients using versions 0-27:
+    CatalogRefreshException.message was changed to
+    CatalogRefreshException.errmessage to work around a change
+    introduced in python2.5 and removed in python2.6 (Exception.message,
+    if used, triggers a deprecation warning).
+
 Version 27:
 Compatible with clients using version 25 and 26:
     The get_manifest function has been added to the api to allow clients to
--- a/src/client.py	Thu Dec 17 15:56:34 2009 -0800
+++ b/src/client.py	Thu Dec 17 16:20:13 2009 -0800
@@ -81,7 +81,7 @@
     RESULT_FAILED_OUTOFMEMORY)
 from pkg.misc import EmptyI, msg, PipeError
 
-CLIENT_API_VERSION = 26
+CLIENT_API_VERSION = 28
 PKG_CLIENT_NAME = "pkg"
 
 JUST_UNKNOWN = 0
@@ -2026,8 +2026,8 @@
                         logger.error("   ")
                         logger.error(str(err))
 
-        if cre.message:
-                logger.error(cre.message)
+        if cre.errmessage:
+                logger.error(cre.errmessage)
 
         return succeeded
 
--- a/src/gui/modules/installupdate.py	Thu Dec 17 15:56:34 2009 -0800
+++ b/src/gui/modules/installupdate.py	Thu Dec 17 16:20:13 2009 -0800
@@ -456,8 +456,8 @@
                 except api_errors.CatalogRefreshException, e:
                         msg = _("Please check the network "
                             "connection.\nIs the repository accessible?")
-                        if e.message and len(e.message) > 0:
-                                msg = e.message
+                        if e.errmessage and len(e.errmessage) > 0:
+                                msg = e.errmessage
                         self.__g_error_stage(msg)
                         return
                 except api_errors.TransportError, ex:
--- a/src/gui/modules/misc.py	Thu Dec 17 15:56:34 2009 -0800
+++ b/src/gui/modules/misc.py	Thu Dec 17 16:20:13 2009 -0800
@@ -389,8 +389,8 @@
                 else:
                         msg += str(err)
 
-        if cre.message:
-                msg += cre.message
+        if cre.errmessage:
+                msg += cre.errmessage
 
         return msg
 
--- a/src/gui/modules/misc_non_gui.py	Thu Dec 17 15:56:34 2009 -0800
+++ b/src/gui/modules/misc_non_gui.py	Thu Dec 17 16:20:13 2009 -0800
@@ -34,7 +34,7 @@
 
 # The current version of the Client API the PM, UM and
 # WebInstall GUIs have been tested against and are known to work with.
-CLIENT_API_VERSION = 26
+CLIENT_API_VERSION = 28
 
 class _LogFilter(logging.Filter):
         def __init__(self, max_level=logging.CRITICAL):
--- a/src/modules/client/api.py	Thu Dec 17 15:56:34 2009 -0800
+++ b/src/modules/client/api.py	Thu Dec 17 16:20:13 2009 -0800
@@ -51,7 +51,7 @@
 from pkg.client.imageplan import EXECUTED_OK
 from pkg.client import global_settings
 
-CURRENT_API_VERSION = 27
+CURRENT_API_VERSION = 28
 CURRENT_P5I_VERSION = 1
 
 logger = global_settings.logger
@@ -96,7 +96,7 @@
                 canceled changes. It can raise VersionException and
                 ImageNotFoundException."""
 
-                compatible_versions = set([25, 26, CURRENT_API_VERSION])
+                compatible_versions = set([CURRENT_API_VERSION])
 
                 if version_id not in compatible_versions:
                         raise api_errors.VersionException(CURRENT_API_VERSION,
--- a/src/modules/client/api_errors.py	Thu Dec 17 15:56:34 2009 -0800
+++ b/src/modules/client/api_errors.py	Thu Dec 17 16:20:13 2009 -0800
@@ -287,12 +287,12 @@
 
 
 class CatalogRefreshException(ApiException):
-        def __init__(self, failed, total, succeeded, message=None):
+        def __init__(self, failed, total, succeeded, errmessage=None):
                 ApiException.__init__(self)
                 self.failed = failed
                 self.total = total
                 self.succeeded = succeeded
-                self.message = message
+                self.errmessage = errmessage
 
 
 class CatalogError(ApiException):
--- a/src/modules/client/image.py	Thu Dec 17 15:56:34 2009 -0800
+++ b/src/modules/client/image.py	Thu Dec 17 16:20:13 2009 -0800
@@ -2414,7 +2414,7 @@
                                         newimg.refresh_publishers(
                                             progtrack=progtrack)
                                 except api_errors.CatalogRefreshException, cre:
-                                        cre.message = \
+                                        cre.errmessage = \
                                             _("SUNWipkg update check failed.")
                                         raise
                         img = newimg
--- a/src/pkgdep.py	Thu Dec 17 15:56:34 2009 -0800
+++ b/src/pkgdep.py	Thu Dec 17 16:20:13 2009 -0800
@@ -42,7 +42,7 @@
 import pkg.publish.dependencies as dependencies
 from pkg.misc import msg, emsg, PipeError
 
-CLIENT_API_VERSION = 27
+CLIENT_API_VERSION = 28
 PKG_CLIENT_NAME = "pkgdepend"
 
 DEFAULT_SUFFIX = ".res"
--- a/src/tests/cli/t_api.py	Thu Dec 17 15:56:34 2009 -0800
+++ b/src/tests/cli/t_api.py	Thu Dec 17 16:20:13 2009 -0800
@@ -40,7 +40,7 @@
 import time
 import unittest
 
-API_VERSION = 26
+API_VERSION = 28
 PKG_CLIENT_NAME = "pkg"
 
 class TestPkgApi(testutils.SingleDepotTestCase):
--- a/src/tests/cli/t_api_info.py	Thu Dec 17 15:56:34 2009 -0800
+++ b/src/tests/cli/t_api_info.py	Thu Dec 17 16:20:13 2009 -0800
@@ -40,7 +40,7 @@
 import pkg.client.api_errors as api_errors
 import pkg.client.progress as progress
 
-API_VERSION = 26
+API_VERSION = 28
 PKG_CLIENT_NAME = "pkg"
 
 class TestApiInfo(testutils.SingleDepotTestCase):
--- a/src/tests/cli/t_api_list.py	Thu Dec 17 15:56:34 2009 -0800
+++ b/src/tests/cli/t_api_list.py	Thu Dec 17 16:20:13 2009 -0800
@@ -46,7 +46,7 @@
 import pkg.misc as misc
 import pkg.version as version
 
-API_VERSION = 26
+API_VERSION = 28
 PKG_CLIENT_NAME = "pkg"
 
 class TestApiList(testutils.ManyDepotTestCase):
--- a/src/tests/cli/t_api_search.py	Thu Dec 17 15:56:34 2009 -0800
+++ b/src/tests/cli/t_api_search.py	Thu Dec 17 16:20:13 2009 -0800
@@ -47,7 +47,7 @@
 import pkg.portable as portable
 import pkg.search_storage as ss
 
-API_VERSION = 26
+API_VERSION = 28
 PKG_CLIENT_NAME = "pkg"
 
 class TestApiSearchBasics(testutils.SingleDepotTestCase):
--- a/src/tests/cli/t_pkg_api_install.py	Thu Dec 17 15:56:34 2009 -0800
+++ b/src/tests/cli/t_pkg_api_install.py	Thu Dec 17 16:20:13 2009 -0800
@@ -38,7 +38,7 @@
 import pkg.client.api_errors as api_errors
 import pkg.client.progress as progress
 
-API_VERSION = 26
+API_VERSION = 28
 PKG_CLIENT_NAME = "pkg"
 
 class TestPkgApiInstall(testutils.SingleDepotTestCase):
--- a/src/tests/cli/t_pkg_intent.py	Thu Dec 17 15:56:34 2009 -0800
+++ b/src/tests/cli/t_pkg_intent.py	Thu Dec 17 16:20:13 2009 -0800
@@ -39,7 +39,7 @@
 import pkg.client.api_errors as api_errors
 import pkg.client.progress as progress
 
-API_VERSION = 26
+API_VERSION = 28
 PKG_CLIENT_NAME = "pkg"
 
 class TestPkgIntent(testutils.SingleDepotTestCase):
--- a/src/tests/cli/t_pkgdep_resolve.py	Thu Dec 17 15:56:34 2009 -0800
+++ b/src/tests/cli/t_pkgdep_resolve.py	Thu Dec 17 16:20:13 2009 -0800
@@ -40,7 +40,7 @@
 import pkg.portable as portable
 import pkg.publish.dependencies as dependencies
 
-API_VERSION = 27
+API_VERSION = 28
 PKG_CLIENT_NAME = "pkg"
 
 class TestApiDependencies(testutils.SingleDepotTestCase):