Opened 12 years ago

Closed 12 years ago

#18590 closed Cleanup/optimization (fixed)

Remove workaround for a Python 2.4 bug in Model.__reduce__

Reported by: Michal Petrucha Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Model.__reduce__ contains a workaround for a buggy implementation of pickling/unpickling where calling super(Model, self).__reduce__() resulted in infinite recursion.

With Python 2.6 and 2.7 this seems no longer to be relevant, which means the workaround can probably be removed.

Attachments (1)

18590-1.diff (2.9 KB ) - added by Claude Paroz 12 years ago.
Removed Python 2.4 workaround

Download all attachments as: .zip

Change History (8)

by Claude Paroz, 12 years ago

Attachment: 18590-1.diff added

Removed Python 2.4 workaround

comment:1 by Claude Paroz, 12 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

Sure, less code is better. Attached patch passes all tests on Python 2.6 - SQLite.

comment:2 by Michal Petrucha, 12 years ago

Passes here as well. We still need someone to verify it passes on Mac; according to #12121, on the bug was present in the Mac version of 2.5.

comment:3 by Simon Charette, 12 years ago

All tests passes on Python 2.7.3rc1 - SQLite here as well.

@koniiiik I think we're dropping Python 2.5 support for 1.5?

comment:4 by Michal Petrucha, 12 years ago

Actually, what I meant was that someone should test against 2.6 on Mac to make sure 2.6 is no longer affected…

comment:5 by Aymeric Augustin, 12 years ago

The test suite passes on OS X with this patch, SQLite and the following Pythons:

Python 2.6.7 (r267:88850, Jul 31 2011, 19:30:54) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin

comment:6 by Aymeric Augustin, 12 years ago

Triage Stage: AcceptedReady for checkin

comment:7 by Claude Paroz <claude@…>, 12 years ago

Resolution: fixed
Status: newclosed

In [146aff3bac974e56ec8cb597c2720d1cd4f77b26]:

Fixed #18590 - Reverted Python 2.4 workaround for Model pickling

Revert of 08d521efa0. Refs #10547, #12121.
Thanks Michal Petrucha for the report.

Note: See TracTickets for help on using tickets.
Back to Top