You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2015-05-27.08:58:31.563>created_at=<Date2015-03-27.13:05:10.057>labels= ['library']
title='When xdrlib.Packer().pack_string() fails, the Packer is corrupted'updated_at=<Date2015-05-27.08:58:31.563>user='https://bugs.python.org/ostcar'
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.
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.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: