Opened 11 years ago

Closed 11 years ago

#21037 closed Bug (fixed)

MigrationWriter.serialize() output invalid python for lambda functions.

Reported by: loic84 Owned by: Tim Graham <timograham@…>
Component: Migrations Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

AssertionError: Could not exec u'import migrations.test_writer\ntest_value_result = migrations.test_writer.<lambda>' (from value <function <lambda> at 0x104c7bde8>): invalid syntax (<string>, line 2)

Change History (3)

comment:1 by loic84, 11 years ago

Has patch: set

PR https://github.com/django/django/pull/1550

We have two options here, either we error out or we nullify them: lambda *args, **kwargs: None.

I chose the former.

comment:2 by Tim Graham, 11 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Tim Graham <timograham@…>, 11 years ago

Owner: set to Tim Graham <timograham@…>
Resolution: fixed
Status: newclosed

In adc0ab3386520874dbc96c2f905fd66769b8f16d:

Fixed #21037 -- Made MigrationWriter raise a ValueError when serializing lambda functions.

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