Opened 5 years ago

Closed 5 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: master
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


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 Changed 5 years ago by loic84

Has patch: set


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

I chose the former.

comment:2 Changed 5 years ago by Tim Graham

Triage Stage: UnreviewedAccepted

comment:3 Changed 5 years ago by Tim Graham <timograham@…>

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