Opened 17 years ago

Closed 16 years ago

#5809 closed (wontfix)

UnicodeEncodeError when entering Unicode character in DecimalField

Reported by: Julian Bez Owned by: nobody
Component: Contrib apps Version: dev
Severity: Keywords: unicode decimalfield oldforms
Cc: voehringer@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When you have a DecimalField and you enter a Unicode character like € it doesn't just invalidate, it gives you an error.

Traceback (most recent call last):
File "c:\django_src\django\core\handlers\base.py" in _real_get_response
  81. response = callback(request, *callback_args, **callback_kwargs)
File "c:\django_src\django\contrib\auth\decorators.py" in _checklogin
  17. return view_func(request, *args, **kwargs)
File "xx" in xx
  764. errors = manipulator.get_validation_errors(new_data)
File "c:\django_src\django\oldforms\__init__.py" in get_validation_errors
  61. errors.update(field.get_validation_errors(new_data))
File "c:\django_src\django\oldforms\__init__.py" in get_validation_errors
  378. self.run_validator(new_data, validator)
File "c:\django_src\django\oldforms\__init__.py" in run_validator
  368. validator(new_data.get(self.field_name, ''), new_data)
File "c:\django_src\django\oldforms\__init__.py" in isValidDecimal
  789. v(field_data, all_data)
File "c:\django_src\django\core\validators.py" in __call__
  435. val = Decimal(field_data)
File "C:\Programme\Python24\lib\decimal.py" in __new__
  544. if _isinfinity(value):
File "C:\Programme\Python24\lib\decimal.py" in _isinfinity
  2930. num = str(num).lower()

  UnicodeEncodeError at /example/
  'ascii' codec can't encode character u'\u20ac' in position 3: ordinal not in range(128)

Attachments (1)

5809-UnicodeEncodeError.patch (576 bytes ) - added by Julian Bez 17 years ago.

Download all attachments as: .zip

Change History (6)

by Julian Bez, 17 years ago

comment:1 by anonymous, 17 years ago

Has patch: set
Summary: UnicodeEncodeError when entering Unicode character in DecimalField[Patch] UnicodeEncodeError when entering Unicode character in DecimalField

comment:2 by anonymous, 17 years ago

Cc: voehringer@… added

comment:3 by Pete Crosier, 17 years ago

Needs tests: set
Summary: [Patch] UnicodeEncodeError when entering Unicode character in DecimalFieldUnicodeEncodeError when entering Unicode character in DecimalField

comment:4 by Jacob, 17 years ago

Triage Stage: UnreviewedAccepted

Yuck.

comment:5 by Julian Bez, 16 years ago

Resolution: wontfix
Status: newclosed

Oldforms is history.

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