|Title||Python 2.4 breaks p4.py|
|Assigned user||Nick Barnes|
|Description||Python 2.4 has recently been released. Running the P4DTI under Python 2.4 causes errors when invoking the Perforce client, usually of the form "Unknown field name".|
|Analysis||Python 2.4 includes a silent change to the binary format of marshalled objects. The Perforce client 'p4 -G' accepts and produces marshalled objects in format version 0 (i.e. that generated by versions of Python prior to 2.4). Python 2.4 can produce such objects, but by default produces objects in format version 1 .|
To produce an object in format version 0, one uses marshal.dump(object, file, 0). Note that this call will generate an error in Python 2.3 (or earlier) so for compatibility we need to test which version of the marshal module we have (by using marshal.__dict__.has_key('version').
Note that Python 2.4 has no problem reading objects in format version 0, so this is only a problem with passing information to 'p4 -G', not receiving information back.
This problem was found by Perforce .
Here's a typical error message:
File "run.py", line 21, in ?
File "E:\Bugzilla\P4DTI-2.1.2\replicator.py", line 897, in run
File "E:\Bugzilla\P4DTI-2.1.2\replicator.py", line 888, in prepare_to_run
File "E:\Bugzilla\P4DTI-2.1.2\replicator.py", line 254, in update_and_check_jobspec
File "E:\Bugzilla\P4DTI-2.1.2\p4.py", line 480, in install_jobspec
self.run('jobspec -i', jobspec_dict)
File "E:\Bugzilla\P4DTI-2.1.2\p4.py", line 217, in run
raise error, catalog.msg(706, (msg, exit_status))
Perforce error: (P4DTI-7065) Error in job spec specification.
Error detected at line 2.
Unknown field name 'Status'.
The Perforce client exited with error code 1.
|Test procedure||test_p4dti.py normal.runTest|
|Created by||Nick Barnes|
|Created on||2005-01-03 14:55:31|
|Last modified by||Gareth Rees|
|Last modified on||2010-10-06 21:45:18|
|History||2004-01-03 NB Created.|
|137049||closed||2005-01-03 14:57:56||Nick Barnes||Fix marshal format problem with Python 2.4.|