Issue 1230553: decimal module is no longer 2.3 compatible (original) (raw)
decimal.py is no longer compatible with Python 2.3.
mso@tux ~/src/Python-2.4.1/Lib $ python 'import site' failed; use -v for traceback Python 2.3.4 (#1, Nov 30 2004, 10:15:28) [GCC 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import decimal Traceback (most recent call last): File "", line 1, in ? File "decimal.py", line 137, in ? import copy File "copy.py", line 65, in ? import inspect File "inspect.py", line 31, in ? import sys, os, types, string, re, dis, imp, tokenize, linecache File "os.py", line 133 from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, altsep, ^ SyntaxError: invalid syntax
The error is the "()" in the 'from' statement.
The docstring reads:
This module is currently Py2.3 compatible and should
be kept that way
unless a major compelling advantage arises. IOW, 2.3
compatibility is
strongly preferred, but not guaranteed.
Please remove this paragraph or otherwise correct it. Perhaps there should also be a note in Misc/NEWS or somewhere since the following thread in python-dev seems to suggest decimal was meant to remain compatible until 2.5 is released: http://mail.python.org/pipermail/python-dev/2004-August/048135.html
Logged In: YES user_id=80475
Are you mixing tools across multiple Python versions?
The traceback says the problem is in os.py which was changed after Py2.3. The decimal module ought to work fine with Py2.3's original os.py. Also, your directory line says 2.4.1. Further, there is a failed "import site" indicating that something else is wrong with your build.
Please double check your assertions on a clean 2.3 build. If the original report is invalid, please mark it as such and close the bug.