[issue2631] IMPORT_NAME Documentation is incomplete

2008-04-14 Thread Paul Bonser

New submission from Paul Bonser <[EMAIL PROTECTED]>:

The documentation for IMPORT_NAME at
http://docs.python.org/lib/bytecodes.html doesn't mention the fact that
the instruction requires two parameters to be on the stack.

TOS and TOS1 should map to the fromlist and level parameters to the
builtin function __import__, respectively.

--
assignee: georg.brandl
components: Documentation
messages: 65471
nosy: georg.brandl, pib
severity: normal
status: open
title: IMPORT_NAME Documentation is incomplete
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2631>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18873] "Encoding" detected in non-comment lines

2013-08-28 Thread Paul Bonser

New submission from Paul Bonser:

lib2to3.pgen2.tokenize:detect_encoding looks for the regex 
"coding[:=]\s*([-\w.]+)" in the first two lines of the file without first 
checking if they are comment lines.

You can get 2to3 to fail with "SyntaxError: unknown encoding: 0" with a single 
line file:

coding=0

A simple fix would be to check that the line is a comment before trying to look 
up the encoding from that line.

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 196435
nosy: Paul.Bonser
priority: normal
severity: normal
status: open
title: "Encoding" detected in non-comment lines
type: crash
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 
<http://bugs.python.org/issue18873>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com