[Python-3000] [Python-3000-checkins] r54510 - in python/branches/p3yk/Lib: ConfigParser.py test/test_file.py
brett at python.org
Thu Mar 22 00:27:59 CET 2007
On 3/21/07, Collin Winter <collinw at gmail.com> wrote:
> On 3/21/07, Brett Cannon <brett at python.org> wrote:
> > On 3/21/07, Collin Winter <collinw at gmail.com> wrote:
> > > On 3/21/07, Guido van Rossum <guido at python.org> wrote:
> > > > On 3/21/07, Collin Winter <collinw at gmail.com> wrote:
> > > > > On 3/21/07, brett.cannon <python-3000-checkins at python.org> wrote:
> > > > > > When removing indexing/slicing on exceptions some places were changed
> > > > > > inappropriately from ``e`` to ``e.message`` instead of ``e.args``. The
> > > > > > reason it needs to be the last option is the dichotomy of 'message' and 'args':
> > > > > > 'message' can be the empty string but args can have a value if more than one
> > > > > > argument was passed.
> > > > >
> > > > > So e.args is going to stick around in 3.0?
> > > >
> > > > I think so. e.message OTOH I think we can kill (perhaps deprecate it
> > > > in 2.6; it was added in 2.5, this may be a record :-).
> > >
> > > I'll update 2to3's fix_except accordingly.
> > So I guess you are just going to notice when exceptions are caught and
> > if exc.message is found change it to exc.args? Could you use this
> > for the removal of indexing/slicing so that exc becomes
> > exc.args?
> No, I'm basically just backing out a transformation that used .message
> instead of .args. It would be possible to remove slicing/indexing like
> you suggest, but only when exc is mentioned explicitly; that is, "x =
> exc; x;" would defeat it.
In that case I say just go with the Py3K warning thing.
More information about the Python-3000