Roundup Robot added the comment:
New changeset 9cee201388c9 by Petri Lehtinen in branch '2.7':
Issue #11694: Raise ConversionError in xdrlib as documented
https://hg.python.org/cpython/rev/9cee201388c9
New changeset 7ef6e5f53418 by Petri Lehtinen in branch '3.4':
Issue #11694: Raise
Petri Lehtinen added the comment:
Applied, thanks!
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11694
___
Claudiu Popa added the comment:
Here's a refreshed patch:
- raising_conversion_error is now raise_conversion_error
- the decorator uses functools.wraps
- the ConversionError is instantiated with the first argument of the caught
expression
- the reraising of ConversionError has the exception
Petri Lehtinen added the comment:
LGTM
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11694
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Claudiu Popa pcmantic...@gmail.com:
--
nosy: +Claudiu.Popa
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11694
___
___
Python-bugs-list
Petri Lehtinen pe...@digip.org added the comment:
I see one obvious issue with the patch: The ConversionErrors it creates are
passed the struct.error or TypeError instance as a parameter. The first
argument of these exceptions would be better, i.e.
try:
...
except struct.error as e:
Filip Gruszczyński grusz...@gmail.com added the comment:
Bump! It's almost 3 months since I posted the patch, so I would like to remind
about this bug.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11694
Georg Brandl ge...@python.org added the comment:
Looks good to me.
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11694
___
Changes by Georg Brandl ge...@python.org:
--
stage: test needed - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11694
___
___
Filip Gruszczyński grusz...@gmail.com added the comment:
Patch with tests.
--
keywords: +patch
Added file: http://bugs.python.org/file23178/11694.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11694
Changes by Petri Lehtinen pe...@digip.org:
--
stage: - test needed
versions: +Python 2.7, Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11694
___
Petri Lehtinen pe...@digip.org added the comment:
This seems like a bug worth fixing. The ConversionError exception has been
documented, an there's an example in the docs that suggest that at least all
packing fails with a ConversionError.
--
nosy: +petri.lehtinen
New submission from Filip Gruszczyński grusz...@gmail.com:
xdrlib defines ConversionError, but very seldom uses it. For example:
def pack_float(self, x):
try: self.__buf.write(struct.pack('f', x))
except struct.error as msg:
raise ConversionError(msg)
But it
13 matches
Mail list logo