Bugs item #898271, was opened at 2004-02-16 12:49
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=898271&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Peter Åstrand (astrand)
>Assigned to: Neal Norwitz (nnorwitz)
Summary: symtable module crashes w/ coding declaration

Initial Comment:
The symtable module doesn't work with source code
encodings, it seems. Sample code:

#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-

import sys
import symtable
filename = sys.argv[0]
tab = symtable.symtable(open(filename).read(),
filename, exec")
print tab.get_type()

When running this code, I get:

Traceback (most recent call last):
  File "./bar.py", line 8, in ?
    print tab.get_type()
  File "/usr/local/lib/python2.3/symtable.py", line 71,
in get_type
    assert self._table.type in (1, 2, 3), AssertionError: unexpected type: 0

If I remove the source code encoding declaration,
things work fine. I've verified this problem with 2.3.2
and 2.3.3. 2.2.0 and 2.2.2 works fine. 

----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2005-10-02 18:13

Message:
Logged In: YES 
user_id=33168

This is still a problem w/2.5.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=898271&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to