strange import error with Python-2.4.1

R

Robin Becker

Whilst testing the excellent xlrd http://www.python.org/pypi/xlrd/0.3a1
I came across the following strangeness when trying to add an import of os to
assist with debugging/tracing.


At line 66 I replaced

import sys

with import sys, os

and then ran python runxlrd.py --help and got this error which is not a real
syntax problem

Traceback (most recent call last):
File "runxlrd.py", line 5, in ?
import xlrd
File "C:\python24\lib\site-packages\xlrd\__init__.py", line 552
if DEBUG: print >> self.logfile, "SST Processing"

if I remove the , os then the run produces the expected

usage: runxlrd.py [options] command input-file-patterns

options:
-h, --help show this help message and exit
-l LOGFILENAME, --logfilename=LOGFILENAME
contains error messages
-v VERBOSITY, --verbosity=VERBOSITY
level of information and diagnostics provided

I also am able to change the line to

import sys
import os

without error.

This behaviour doesn't occur with 2.4.2 or 2.4 only with 2.4.1. I looked for
some bug fix in the recently released 2.4.2 that related, but couldn't find
anything obvious. My system doesn't have psyco so xlrd's attempted psyco use
shouldn't be an issue. Thanks for 2.4.2, but is this one of the fixed bugs or
has it just got harder to induce?
 
R

Richard Brodie

This behaviour doesn't occur with 2.4.2 or 2.4 only with 2.4.1. I looked for
some bug fix in the recently released 2.4.2 that related, but couldn't find
anything obvious.

One of the various codecs fixes, I think. Bug #1175396, perhaps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top