Bug 251491 - "import decimal" fails in turkish locale
Summary: "import decimal" fails in turkish locale
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: python
Version: 9
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: James Antill
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-08-09 13:11 UTC by Sertaç Ö. Yıldız
Modified: 2009-07-14 17:59 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-07-14 17:59:51 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Sertaç Ö. Yıldız 2007-08-09 13:11:41 UTC
Description of problem:
decimal.py has the following code:

...
 143 ROUND_CEILING = 'ROUND_CEILING'
...
 507 class Decimal(object):
...
1716     def _round_ceiling(self, prec, expdiff, context):
...
2210 rounding_functions = [name for name in Decimal.__dict__.keys() if
name.startswith('_round_')]
2211 for name in rounding_functions:
2212     #name is like _round_half_even, goes to the global ROUND_HALF_EVEN value.
2213     globalname = name[1:].upper()
2214     val = globals()[globalname]
2215     Decimal._pick_rounding_function[val] = name

This module fails if imported in turkish locale since '_round_ceiling_'.upper()
is '_ROUND_CEiLiNG_' and exported global dict does not have such a key.


Version-Release number of selected component (if applicable):
python-2.5-12.fc7

Steps to Reproduce:
$ LANG=tr_TR.UTF-8 python
Python 2.5 (r25:51908, Apr 10 2007, 10:29:13) 
[GCC 4.1.2 20070403 (Red Hat 4.1.2-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "")
'tr_TR.UTF-8'
>>> import decimal
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/decimal.py", line 2214, in <module>
    val = globals()[globalname]
KeyError: 'ROUND_CEiLiNG'

Comment 1 Sertaç Ö. Yıldız 2007-08-09 15:20:09 UTC
also _isinfinity() method has a problem here:
2989     num = str(num).lower()

[with turkish locale, 'Inf'.lower() != 'inf']


Comment 2 Bug Zapper 2008-05-14 13:55:39 UTC
This message is a reminder that Fedora 7 is nearing the end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 7. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '7'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 7's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 7 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug. If you are unable to change the version, please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. If possible, it is recommended that you try the newest available Fedora distribution to see if your bug still exists.

Please read the Release Notes for the newest Fedora distribution to make sure it will meet your needs:
http://docs.fedoraproject.org/release-notes/

The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Bug Zapper 2008-06-17 02:07:52 UTC
Fedora 7 changed to end-of-life (EOL) status on June 13, 2008. 
Fedora 7 is no longer maintained, which means that it will not 
receive any further security or bug fix updates. As a result we 
are closing this bug. 

If you can reproduce this bug against a currently maintained version 
of Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 4 Sertaç Ö. Yıldız 2008-07-16 03:50:42 UTC
same with python-2.5.1-26.fc9.i386

Comment 5 Bug Zapper 2009-06-09 22:45:01 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Bug Zapper 2009-07-14 17:59:51 UTC
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.