[Python-bugs-list] [ python-Bugs-772176 ] digraphs on komment lines / xlib
SourceForge.net
noreply@sourceforge.net
Sun, 20 Jul 2003 17:37:05 -0700
Bugs item #772176, was opened at 2003-07-16 09:24
Message generated for change (Comment added) made by daddio_2
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=772176&group_id=5470
Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Gregory Eckersley (daddio_2)
Assigned to: Nobody/Anonymous (nobody)
Summary: digraphs on komment lines / xlib
Initial Comment:
Python 2.3 falls over if it encounters non-ascii
characters on comment lines. These occur with digraphs
and non English names.
e.g.
This simple program
#!/usr/bin/python
print 'This program does nothing'
# Aber eine Kommentarzeile l�uft nicht!
# The " � " causes trouble
# This causes Xlib to stop working
causes the following output
sys:1: DeprecationWarning: Non-ASCII character '\xe4'
in file /nglob/g/bat/digraph.py on line 6, but no
encoding declared; see
http://www.python.org/peps/pep-0263.html for details
This program does nothing
Some libraries (such as python-xlib 2.2 ) cause this
problem. The line
parser ought ignore all comment content whether ascii
or not.
----------------------------------------------------------------------
>Comment By: Gregory Eckersley (daddio_2)
Date: 2003-07-21 00:37
Message:
Logged In: YES
user_id=823572
I understand & agree with your comments. I did not include
the exact version
since it , as you say, seems to be an undesirable (in this
case) consequence of the PEP. Please consider this bug
report closed, and I'll follow it up in the short term with
xlib, and in the longer term with the PEP after looking at
whether there is a simple and systematic way of handling this.
----------------------------------------------------------------------
Comment By: Terry J. Reedy (tjreedy)
Date: 2003-07-20 20:46
Message:
Logged In: YES
user_id=593130
1. Python 2.3 has not been released yet. Please indicate
exact versions on bug reports. Including the system and OS
often helps too.
2. The reported behavior is intentional and not a bug. See
Reference Manual 2. Lexical analysis: "Python uses the 7-bit
ASCII character set" and the referenced PEP 0263. Please
close this report.
3. If a standard library module were to generate this
warning, that would be a bug that should be reported here.
If a third-party library does so, get a version updated for 2.3
or request that the authors make one.
4. If you want to discuss intended behavior, post to
comp.lang.python. While your request about ignoring
comments is superficially reasonable, the PEP seems to
indicate that encoding is dealt with, and the warning issued,
*before* any actual parsing, which is to say, before the
parser knows what is a comment and what is not. Detecting
comments is not trivial since '#' within a string does not
start a comment.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=772176&group_id=5470