Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

digraphs on komment lines / xlib #38860

Closed
daddio2 mannequin opened this issue Jul 16, 2003 · 4 comments
Closed

digraphs on komment lines / xlib #38860

daddio2 mannequin opened this issue Jul 16, 2003 · 4 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@daddio2
Copy link
Mannequin

daddio2 mannequin commented Jul 16, 2003

BPO 772176
Nosy @birkenfeld, @terryjreedy

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2005-05-31.11:41:14.000>
created_at = <Date 2003-07-16.09:24:12.000>
labels = ['interpreter-core']
title = 'digraphs on komment lines / xlib'
updated_at = <Date 2005-05-31.11:41:14.000>
user = 'https://bugs.python.org/daddio2'

bugs.python.org fields:

activity = <Date 2005-05-31.11:41:14.000>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2003-07-16.09:24:12.000>
creator = 'daddio_2'
dependencies = []
files = []
hgrepos = []
issue_num = 772176
keywords = []
message_count = 4.0
messages = ['17072', '17073', '17074', '17075']
nosy_count = 3.0
nosy_names = ['georg.brandl', 'terry.reedy', 'daddio_2']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue772176'
versions = []

@daddio2
Copy link
Mannequin Author

daddio2 mannequin commented Jul 16, 2003

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.

@daddio2 daddio2 mannequin closed this as completed Jul 16, 2003
@daddio2 daddio2 mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jul 16, 2003
@daddio2 daddio2 mannequin closed this as completed Jul 16, 2003
@daddio2 daddio2 mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jul 16, 2003
@terryjreedy
Copy link
Member

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.

@daddio2
Copy link
Mannequin Author

daddio2 mannequin commented Jul 21, 2003

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.

@birkenfeld
Copy link
Member

Logged In: YES
user_id=1188172

This should already have been closed. As it is related to
python-xlib, marking as "3rd Party".

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Development

No branches or pull requests

2 participants