[issue23790] When xdrlib.Packer().pack_string() fails, the Packer is corrupted

2015-05-27 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
resolution:  - rejected
stage:  - resolved
status: pending - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23790
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23790] When xdrlib.Packer().pack_string() fails, the Packer is corrupted

2015-04-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
status: open - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23790
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23790] When xdrlib.Packer().pack_string() fails, the Packer is corrupted

2015-03-27 Thread Oskar Hahn

Changes by Oskar Hahn m...@oshahn.de:


Added file: http://bugs.python.org/file38711/reset_buffer.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23790
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23790] When xdrlib.Packer().pack_string() fails, the Packer is corrupted

2015-03-27 Thread Oskar Hahn

New submission from Oskar Hahn:

When xdrlib.Packer().pack_string() is called with an unsupported value, it 
raises a TypeError. But it calles self.pack_uint(n) before it raises the 
exception so the buffer is changed.

There are two possible solutions to solve this behaviour. The argument s can be 
tested to be supported, or undo the call of self.pack_uint(n).

I added two alternative patches for this two solutions.

This is my first patch for cpython, I hope it is ok.

--
components: Library (Lib)
files: test_value.patch
keywords: patch
messages: 239396
nosy: ostcar
priority: normal
severity: normal
status: open
title: When xdrlib.Packer().pack_string() fails, the Packer is corrupted
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file38710/test_value.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23790
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23790] When xdrlib.Packer().pack_string() fails, the Packer is corrupted

2015-03-27 Thread R. David Murray

R. David Murray added the comment:

Your patches are great, thanks.  Now we have to decide which to use :)

--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23790
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23790] When xdrlib.Packer().pack_string() fails, the Packer is corrupted

2015-03-27 Thread Oskar Hahn

Oskar Hahn added the comment:

I would prefer the reset_buffer.patch because I do not like argument testing at 
the begin of a function/method.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23790
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23790] When xdrlib.Packer().pack_string() fails, the Packer is corrupted

2015-03-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I doubt that this issue is worth fixing. It is common that when error is happen 
inside complex operation, the output can be incomplete. When you pickle a list 
containing non-pickleable data, resulting file content will be not 
unpickleable. When you write a number of lines in text file, and one of lines 
contains non-encodable characters, resulting file content will be incomplete 
and may even don't contain complete lines.

And when other xdrlib.Packer methods that write complex data (pack_uhyper, 
pack_list, pack_farray, pack_array) fail, they left incomplete output.

--
nosy: +serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23790
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com