Requires a character ... !!

K

karthikbalaguru

Hi,

I am new to python . I am face few problems related with
python and iam trying to resolve it.

The below is the error that i get when i invoke my application by
giving
the necessary input file.

[root@localhost hello]# Analyzer hello_input
Loading debug info: hello_input
Traceback (most recent call last):
File "/usr/local/SDK/host/bin/Analyzer", line 694, in ?
app.dbg.readObjectInfo(elf)
File "/usr/local/SDK/host/bin/debugprocessor.py", line 427, in
readObjectInfo
self.privateProcessorDwarfTree.readProcessorDwarfTree(filename)
File "/usr/local/SDK/bin/debugprocessor.py", line 314, in
readDwarfTree
if "DW_OP_reg" in value:
TypeError: 'in <string>' requires character as left operand

Is this related with the version conflicts ?
Should i need to configure any environment variables or change some
source code.
Any ideas ?

Thx in advans,
Karthik Balaguru
 
F

Fredrik Lundh

karthikbalaguru said:
I am new to python . I am face few problems related with
python and iam trying to resolve it.

The below is the error that i get when i invoke my application by
giving
the necessary input file.

[root@localhost hello]# Analyzer hello_input
Loading debug info: hello_input
Traceback (most recent call last):
File "/usr/local/SDK/host/bin/Analyzer", line 694, in ?
app.dbg.readObjectInfo(elf)
File "/usr/local/SDK/host/bin/debugprocessor.py", line 427, in
readObjectInfo
self.privateProcessorDwarfTree.readProcessorDwarfTree(filename)
File "/usr/local/SDK/bin/debugprocessor.py", line 314, in
readDwarfTree
if "DW_OP_reg" in value:
TypeError: 'in <string>' requires character as left operand

Is this related with the version conflicts ?
Should i need to configure any environment variables or change some
source code.

You should run the code on a Python version that supports the features
your code is using. Support for arbitrary strings on the left side of
the "in" operator was added in Python 2.3, which was released in 2003.

What software is this? If you've written it yourself, make sure to use
only features supported by the Python version you're actually using. If
it's written by someone else, please read the requirements section for
the software you're using, and follow the instructions in there.

(hasn't people been telling you this about a hundred times before in
this forum? or was that some other guy who also kept insisting on
running some program on a python version it didn't support?)

</F>
 
U

Ulrich Eckhardt

karthikbalaguru said:
[root@localhost hello]# Analyzer hello_input
^^^^^^^^^^^^^^
This is often a bad idea. Anyhow, that has nothing to do with Python.
Loading debug info: hello_input
Traceback (most recent call last):
File "/usr/local/SDK/host/bin/Analyzer", line 694, in ?
app.dbg.readObjectInfo(elf)
File "/usr/local/SDK/host/bin/debugprocessor.py", line 427, in
readObjectInfo
self.privateProcessorDwarfTree.readProcessorDwarfTree(filename)
File "/usr/local/SDK/bin/debugprocessor.py", line 314, in
readDwarfTree
if "DW_OP_reg" in value:
TypeError: 'in <string>' requires character as left operand

Is this related with the version conflicts ?

Which version conflict? Sorry, but my crystal ball is getting a new polish
today, so I can't see the actual code that causes the error. I suggest that
you reduce your code to the smallest possible piece of code that still
shows the error and post it here, otherwise nobody will be able to help
you.

Uli
 
K

karthikbalaguru

karthikbalaguru said:
I am new to python . I am face few problems related with
python and iam trying to resolve it.
The below is the error that i get when i invoke my application by
giving
the necessary input file.
[root@localhost hello]# Analyzer hello_input
Loading debug info: hello_input
Traceback (most recent call last):
File "/usr/local/SDK/host/bin/Analyzer", line 694, in ?
app.dbg.readObjectInfo(elf)
File "/usr/local/SDK/host/bin/debugprocessor.py", line 427, in
readObjectInfo
self.privateProcessorDwarfTree.readProcessorDwarfTree(filename)
File "/usr/local/SDK/bin/debugprocessor.py", line 314, in
readDwarfTree
if "DW_OP_reg" in value:
TypeError: 'in <string>' requires character as left operand
Is this related with the version conflicts ?
Should i need to configure any environment variables or change some
source code.

You should run the code on a Python version that supports the features
your code is using. Support for arbitrary strings on the left side of
the "in" operator was added in Python 2.3, which was released in 2003.

Thx for that info. I understand.
The requirements state that it needs Python 2.2, But i wonder
how that program has been implemented using Python 2.3 features.
Anyhow, this has to be resolved and i need your help.

Kindly let me know a trick to make to resolve
the 'in' operator related problem by using Python 2.2.

Thx in advans,
Karthik Balaguru
 
A

alex23

Kindly let me know a trick to make to resolve
the 'in' operator related problem by using Python 2.2.

You seem to be making life -very- difficult for yourself.

Your distro is running Python 2.4, you've gone out of your way to get
Py2.2 installed. Why are you so convinced that you -need- Python 2.2
over 2.4? Everyone problem you've posted here seems due to that
assumption...

Generally, Python is pretty good about backwards compatibility. Code
written for 2.2 should run fine under 2.4. As you're discovering, the
opposite isn't true. __future__ isn't a cure-all.
 
D

Diez B. Roggisch

Thx for that info. I understand.
The requirements state that it needs Python 2.2, But i wonder
how that program has been implemented using Python 2.3 features.
Anyhow, this has to be resolved and i need your help.

Kindly let me know a trick to make to resolve
the 'in' operator related problem by using Python 2.2.

You obviously don't understand and it appears that it's time to resort to
somewhat more explicit clue-batting:

YOU ARE UNDER A WRONG IMPRESSION THAT YOUR SOFTWARE REQUIRES PYTHON 2.2. YOU
HAVE BEEN TOLD THAT NUMEROUS TIMES. SO PLEASE - STOP USING PYTHON 2.2 FOR
IT. WHOEVER TOLD YOU THAT IT IS NEEDED WAS ****WROOOOONG******

Now did that get through? Given your record here, I think I have to
repeat...

STOP USING PYTHON 2.2. NOW!

Diez
 
F

Fredrik Lundh

karthikbalaguru said:
The requirements state that it needs Python 2.2, But i wonder
how that program has been implemented using Python 2.3 features.
Anyhow, this has to be resolved and i need your help.

No, you need the help of the original author. He/she might have
forgotten to update the requirements page, or you may have mis-
read the information. Only the author knows if this program might
have a chance of working on 2.2.

What program is this? Can you point us to the site where you
got it?
Kindly let me know a trick to make to resolve
the 'in' operator related problem by using Python 2.2.

Instead of backporting the software, why not just update to Python
2.3 or newer and be done with it? Why insist on using a Python version
that's nearly seven years old, when the program you're trying to run
obviously wasn't written for it?

(Note that you can have multiple versions of Python installed on the
same machine. Maybe you already have -- have you tried running the
program with "python2.3" or "python2.4" or "python2.5" instead of just
"python"?)

</F>
 
J

John Machin

karthikbalaguru said:
[root@localhost hello]# Analyzer hello_input

^^^^^^^^^^^^^^
This is often a bad idea. Anyhow, that has nothing to do with Python.
Loading debug info: hello_input
Traceback (most recent call last):
File "/usr/local/SDK/host/bin/Analyzer", line 694, in ?
app.dbg.readObjectInfo(elf)
File "/usr/local/SDK/host/bin/debugprocessor.py", line 427, in
readObjectInfo
self.privateProcessorDwarfTree.readProcessorDwarfTree(filename)
File "/usr/local/SDK/bin/debugprocessor.py", line 314, in
readDwarfTree
if "DW_OP_reg" in value:
TypeError: 'in <string>' requires character as left operand
Is this related with the version conflicts ?

Which version conflict? Sorry, but my crystal ball is getting a new polish
today, so I can't see the actual code that causes the error. I suggest that
you reduce your code to the smallest possible piece of code that still
shows the error and post it here, otherwise nobody will be able to help
you.

You don't need a crystal ball; you just need to have been reading this
group/list for the last day or so --- the OP is trying to use Python
2.2 on some *.py that are obviously written for a later version,
refuses to contemplate upgrading, and starts a new thread every time
he gets a syntax error.
 
F

Fredrik Lundh

John said:
You don't need a crystal ball; you just need to have been reading this
group/list for the last day or so --- the OP is trying to use Python
2.2 on some *.py that are obviously written for a later version,
refuses to contemplate upgrading, and starts a new thread every time
he gets a syntax error.

The traceback indicates that this is some software for working with
debug data (http://dwarfstd.org/), but neither Google nor Kodos finds
anything similar to the code you see in the tracebacks, so it's probably
some proprietary stuff. And for some reason, the OP seems to be a bit
unwilling to ask the supplier for help...

</F>
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top