Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#19989 closed Bug (fixed)

Validating BinaryField against validators.EMPTY_VALUES raises UnicodeWarning

Reported by: aaugustin Owned by: nobody
Component: Core (Other) 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

django/db/models/fields/__init__.py:160: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  if value in validators.EMPTY_VALUES:

I don't know which test triggers this.

Attachments (1)

19989-1.diff (1.8 KB) - added by claudep 2 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 2 years ago by claudep

  • Component changed from Python 3 to Core (Other)
  • Summary changed from Warning when running the tests under Python 3.3 to Validating BinaryField against validators.EMPTY_VALUES raises UnicodeWarning
  • Triage Stage changed from Unreviewed to Accepted

Changed 2 years ago by claudep

comment:2 Changed 2 years ago by claudep

  • Has patch set

With this patch, the warning is gone.

comment:3 Changed 2 years ago by charettes

  • Triage Stage changed from Accepted to Ready for checkin

comment:4 Changed 2 years ago by Claude Paroz <claude@…>

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

In 22be90dd171deebd0cf52bdd749f27b18e29a2f2:

Fixed #19989 -- Suppressed UnicodeWarning during BinaryField validation

Thanks Aymeric Augustin for the report and Simon Charette for the
review.

comment:5 Changed 2 years ago by Claude Paroz <claude@…>

In 2add24cc2c605a51695258d45d6d1b61556dec9f:

One more EMPTY_VALUES replacement following 22be90dd17

Thanks Loic Bistuer for catching this omission. Refs #19989.

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