Title: marshal doesn't raise error when fed unmarshalable object
Type: behaviour Severity: normal
Components: Core Versions: Jython 2.7
Milestone: Jython 2.7.2
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: akuchling, irmen, jeff.allen, zyasoft
Priority: normal Keywords: patch

Created on 2013-08-26.14:27:20 by irmen, last changed 2019-07-21.05:44:19 by jeff.allen.

File name Uploaded Description Edit Remove
issue2077.patch akuchling, 2014-04-15.21:49:15
msg8088 (view) Author: Irmen de Jong (irmen) Date: 2013-08-26.14:27:19
marshal.dump(s) doesn't raise the appropriate ValueError when asked to marshal an unmarshalable object. Rather, it returns the string "?".

Observed behavior in Jython 2.7-b1:

>>> import marshal
>>> class Test(object): pass
>>> marshal.dumps(Test())

Expected behavior as shown by CPython 2.7:

>>> import marshal
>>> class Test(object): pass
>>> marshal.dumps(Test())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: unmarshallable object
msg8288 (view) Author: A.M. Kuchling (akuchling) Date: 2014-04-15.21:49:15
Patch attached.
msg8865 (view) Author: Jim Baker (zyasoft) Date: 2014-07-05.02:50:36
Target beta 4
msg12388 (view) Author: Jeff Allen (jeff.allen) Date: 2019-03-23.08:53:25
Thanks Andrew. I don't know why it took us so long to apply this simple patch.

Now in codebase at:

My attempt to find a complementary failing test ... er ... failed. In updating test_marshal from lib-python I just found three other things to fix, including #2744. Paradoxically, when those *are* fixed, the test does finally exercise the code Andrew added (in test_marshal.BugsTestCase.test_exact_type_match).
Date User Action Args
2019-07-21 05:44:19jeff.allensetstatus: pending -> closed
2019-03-23 08:53:25jeff.allensetstatus: open -> pending
severity: major -> normal
nosy: + jeff.allen
messages: + msg12388
priority: high -> normal
resolution: fixed
2015-12-29 23:46:28zyasoftsetmilestone: Jython 2.7.1 -> Jython 2.7.2
2015-04-19 22:14:09zyasoftsetassignee: zyasoft ->
2015-04-15 20:44:19zyasoftsetmilestone: Jython 2.7.1
2014-10-06 03:13:21zyasoftsetpriority: high
assignee: zyasoft
2014-07-05 02:50:36zyasoftsetnosy: + zyasoft
messages: + msg8865
2014-04-15 21:49:15akuchlingsetfiles: + issue2077.patch
keywords: + patch
messages: + msg8288
nosy: + akuchling
2013-08-26 14:27:20irmencreate