Code

Opened 6 years ago

Closed 6 years ago

#5809 closed (wontfix)

UnicodeEncodeError when entering Unicode character in DecimalField

Reported by: webjunkie Owned by: nobody
Component: Contrib apps Version: master
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: UI/UX:

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 webjunkie 6 years ago.

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by webjunkie

comment:1 Changed 6 years ago by anonymous

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from UnicodeEncodeError when entering Unicode character in DecimalField to [Patch] UnicodeEncodeError when entering Unicode character in DecimalField

comment:2 Changed 6 years ago by anonymous

  • Cc voehringer@… added

comment:3 Changed 6 years ago by PJCrosier

  • Needs tests set
  • Summary changed from [Patch] UnicodeEncodeError when entering Unicode character in DecimalField to UnicodeEncodeError when entering Unicode character in DecimalField

comment:4 Changed 6 years ago by jacob

  • Triage Stage changed from Unreviewed to Accepted

Yuck.

comment:5 Changed 6 years ago by julianb

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

Oldforms is history.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.