Greetings,
The following webrev contains fixes for the following issues:
13003 pkgsend doesn't always display exception messages correctly
with python 2.6
webrev
======
http://cr.opensolaris.org/~swalker/pkg-13003/
Summary
=======
When pkgsend open fails due to a duplicate FMRI, the following error
message should be seen:
pkgsend: 'open' failed for transaction ID 'None'; status '400':
The specified FMRI, '[email protected],5.11-0', already exists or has been
restricted., <class 'pkg.publish.transaction.TransactionOperationError'>
[returned 1]
Instead this is seen:
pkgsend: open
returned 1
Investigation reveals this line is responsible for printing the
exception in publish.py:
435 print >> sys.stderr, "pkgsend: %s" % _e
Under python 2.4, this works as expected. Implicitly calling the
__str__ method for the exception. But in python 2.6, you get only the
string version of the non-keyword arguments to the exception instead.
The cause is likely related to this open bug in python2.6:
http://bugs.python.org/issue6108
Because the message wasn't being printed, the retry400 logic in place in
tests/cli/testutils.py was failing and so if we were able to trigger
multiple pkgsend invocations within the same second, some tests would
fail since the timestamp of the FMRIs wouldn't be different.
While there may be a larger issue in general here with testutils, I'm
more concerned about fixing the immediate issue of messages not printing
correctly for pkgsend.
Cheers,
--
Shawn Walker
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss