Opened 3 years ago

Closed 3 years ago

#18590 closed Cleanup/optimization (fixed)

Remove workaround for a Python 2.4 bug in Model.__reduce__

Reported by: koniiiik Owned by: nobody
Component: Database layer (models, ORM) Version: master
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 claudep 3 years ago.
Removed Python 2.4 workaround

Download all attachments as: .zip

Change History (8)

Changed 3 years ago by claudep

Removed Python 2.4 workaround

comment:1 Changed 3 years ago by claudep

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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

comment:2 Changed 3 years ago by koniiiik

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 Changed 3 years ago by charettes

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 Changed 3 years ago by koniiiik

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 Changed 3 years ago by aaugustin

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 Changed 3 years ago by aaugustin

  • Triage Stage changed from Accepted to Ready for checkin

comment:7 Changed 3 years ago by Claude Paroz <claude@…>

  • Resolution set to fixed
  • Status changed from new to closed

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