From cd7ef5f5815908f985dfe04b7c1511b360199555 Mon Sep 17 00:00:00 2001 From: Ziirish Date: Wed, 13 Mar 2019 17:45:31 +0100 Subject: [PATCH 1/2] fix python 3 compatibility --- src/wtforms/fields/core.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/wtforms/fields/core.py b/src/wtforms/fields/core.py index 08327979..42a61a1b 100644 --- a/src/wtforms/fields/core.py +++ b/src/wtforms/fields/core.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from copy import copy import datetime import decimal import itertools @@ -513,7 +512,7 @@ def __init__( ): super(SelectField, self).__init__(label, validators, **kwargs) self.coerce = coerce - self.choices = copy(choices) + self.choices = list(choices) if choices is not None else None def iter_choices(self): for value, label in self.choices: From 27947a2a7d800c25f2472ce494237be12868860d Mon Sep 17 00:00:00 2001 From: Fraser May Date: Mon, 17 Jun 2019 21:55:14 +0100 Subject: [PATCH 2/2] Added #475 to changelog --- CHANGES.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index e0b9e188..bd1effd2 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -59,6 +59,9 @@ Unreleased - Added a parameter to :class:`~fields.SelectField` to skip choice validation (`#434`_, `#493`_) - Permitted underscores in ``HostnameValidation`` (`#463`_) +- Modified the changes made in `#286`_: instead of copying the list of + ``choices``, :class:`~fields.SelectField` now uses ``list()`` to construct + a new list of choices. (`#475`_) .. _#238: https://github.com/wtforms/wtforms/issues/238 .. _#239: https://github.com/wtforms/wtforms/issues/239 @@ -96,6 +99,7 @@ Unreleased .. _#434: https://github.com/wtforms/wtforms/issues/434 .. _#463: https://github.com/wtforms/wtforms/pull/463 .. _#471: https://github.com/wtforms/wtforms/pull/471 +.. _#475: https://github.com/wtforms/wtforms/pull/475/ .. _#482: https://github.com/wtforms/wtforms/issues/482 .. _#483: https://github.com/wtforms/wtforms/issues/483 .. _#484: https://github.com/wtforms/wtforms/pull/484