[issue30767] logging must check exc_info correctly

2017-10-12 Thread Vinay Sajip

Vinay Sajip  added the comment:

This is not an issue that needs fixing; the current behaviour is by design. The 
documentation states about exc_info:

"There are two keyword arguments in kwargs which are inspected: exc_info which, 
if it does not evaluate as false, causes exception information to be added to 
the logging message. If an exception tuple (in the format returned by 
sys.exc_info()) is provided, it is used; otherwise, sys.exc_info() is called to 
get the exception information."

So, an individual exception instance returning false will not affect the 
truthiness of an exc_info tuple (if provided). I propose to close this issue as 
"not a bug" and reject the PR because (a) there's no issue to fix and (b) what 
Serhiy said.

If you still think there's an issue here, please post an example script which 
uses logging as documented and demonstrates a problem.

--
resolution:  -> not a bug
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13802] IDLE font settings: use multiple character sets in examples

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I think empty lines and headers are not needed. They just increase the size of 
the dialog window, it may be too large for low resolution screens.

The standard font chooser on Windows uses the following sets for Unicode-aware 
fonts: Western, Cyrillic, Hebrew, Arabic, Greek, Turkish, Baltic (doesn't 
differ from Western), Central-European, Vietnamese. I think it is worth to 
decrease the Devanagari sample and add few Central-European (ÁáÔô), Turkish 
(ĞğŞş) and Vietnamese (ƠơƯư) characters. Maybe decrease the size of all 
non-ASCII samples? 2-3 letters (in upper and lower cases) should be enough.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28647] python --help: -u is misdocumented as binary mode

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The -u option doesn't affect the buffering of stdin. Is it worth to document 
this explicitly? Or it just adds a noise? Maybe remove this from the help and 
manpage but add in the RST documentation?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13802] IDLE font settings: use multiple character sets in examples

2017-10-12 Thread Louie Lu

Louie Lu  added the comment:

PR 3960 display on my Linux works well, and the combination of the Chinese 
characters has no political controversial.

But it is lack of simplify characters, the only one is '汉', others are all 
traditional characters (or they are same in simp. and trad.).

For Japanese, there are katakana (カタカナ), hiragana(ひらがな) and kanji (漢字), the 
characters you provide only contain hiragana. Maybe a sentence that contains 
all kinds of characters will be better.

For Korean, the characters are compound to one, but I'm not sure will they use 
the first four characters to test the font. CC for corona10.

For Chinese, Japanese, Korean, I'll still prefer and recommend to use a 
sentence to give user the perspective of the font.


For other character set, maybe we can reference from Google fonts:
https://fonts.google.com/
they got a list of Unicode-aware language:

Arbic, Bengali, Cyrillic, Cyrillic Extended, Devanagari, Greek,
Greek Extended, Gujarati, Gurmukhi, Hebrew, Kannada, Khmer,
Latin, Latin Extended, Malayalam, Myanmar, Oriya, Tamil, Telugu,
Thai, Vietnamese.

--
nosy: +corona10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31741] backports import path can not be overridden in Windows (Linux works fine)

2017-10-12 Thread Paul Moore

Paul Moore  added the comment:

Also, one of the packages installed creates a file

configparser-3.5.0-py2.7-nspkg.pth

This has some very suspicious looking content:

import sys, types, os;has_mfs = sys.version_info > (3, 5);p = 
os.path.join(sys._getframe(1).f_locals['sitedir'], *('backports',)); importlib 
= has_mfs and __import__('importlib.util');has_mfs and 
__import__('importlib.machinery');m = has_mfs and sys.modules.set 
default('backports', 
importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec('backports',
 [os.path.dirname(p)]))) ;m = m or sys.modules.setdefault('backports', 
types.ModuleType('backports'));mp = (m or []) and 
m.__dict__.setdefault('__path__',[ ]);(p not in mp) and mp.append(p)

That's likely your problem. I've no idea what it's doing, but as Zachary says, 
the backports module is a strange beast...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31732] Add TRACE level to the logging module

2017-10-12 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I vote against this on the ground that five levels have sufficed for a long and 
that the need for finer distinctions almost never arises in practice.  There 
would be an ongoing mental cost to making users learn and think about finer 
levels of distinction.

--
assignee:  -> vinay.sajip
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31753] Unnecessary closure in ast.literal_eval

2017-10-12 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I prefer the existing code and think this shouldn't be changed.

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28647] python --help: -u is misdocumented as binary mode

2017-10-12 Thread Berker Peksag

Berker Peksag  added the comment:

I think it's better to be explicit and mention 'stdin' in this case. Plus, 
"stdin is always buffered" is quite short so potential of creating noise is 
quite minimal IMO.

(FYI, I asked this question on GitHub: 
https://github.com/python/cpython/pull/3961#issuecomment-336035358)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30767] logging must check exc_info correctly

2017-10-12 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I agree that this should be closed.

--
nosy: +rhettinger
stage: patch review -> resolved
status: pending -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31763] Add NOTICE level to the logging module

2017-10-12 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

As mentioned in the other tracker item, I'm against adding another level.  
While it might serve an exotic need, I think most users would be worse off 
having to learn and think about yet another level of distinction.  The mental 
costs would be on going.

FWIW, users already have the ability to define new levels (as simply as: 
SEMI_INTERESTING=25) but we rarely see this in practice.  The long and 
successful history of this module is somewhat strong evidence that the current 
five levels suffice for most users, most of the time.

--
assignee:  -> vinay.sajip
nosy: +rhettinger, vinay.sajip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13802] IDLE font settings: use multiple character sets in examples

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I suggest to make the sample text editable:

self.font_sample = Text(frame_sample, font=temp_font, width=20)
self.font_sample.insert(END, sample)

This will allow a user to test fonts in any perspective.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31770] crash and refleaks when calling sqlite3.Cursor.__init__() more than once

2017-10-12 Thread Oren Milman

New submission from Oren Milman :

The following code crashes:
import sqlite3
import weakref
def callback(*args):
pass

connection = sqlite3.connect(":memory:")
cursor = sqlite3.Cursor(connection)
ref = weakref.ref(cursor, callback)
cursor.__init__(connection)
del cursor
del ref

IIUC, this is because pysqlite_cursor_init() (in Modules/_sqlite/cursor.c) sets
`self->in_weakreflist` to NULL, and thus corrupts the weakref list. Later,
clear_weakref() (in Objects/weakrefobject.c) tries to remove a reference from
the corrupted list, and crashes.

In every other place (that i saw) where such a weakreflist field is used, it is
set to NULL right after allocating the object (usually in __new__()), or just
not set at all, e.g. in `functools.partial`.
So since PyType_GenericNew() is the __new__() of sqlite3.Cursor, ISTM that the
simplest solution is to not touch `self->in_weakreflist` at all in
pysqlite_cursor_init().


Also, the following code results in refleaks:
import sys
import sqlite3
connection = sqlite3.connect(":memory:")
cursor = sqlite3.Cursor(connection)
refcount_before = sys.gettotalrefcount()
cursor.__init__(connection)
print(sys.gettotalrefcount() - refcount_before)  # should be close to 0

This is because pysqlite_cursor_init() doesn't decref before assigning to
fields of `self`.


I would open a PR to fix this soon.

--
components: Extension Modules
messages: 304220
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: crash and refleaks when calling sqlite3.Cursor.__init__() more than once
type: crash
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31770] crash and refleaks when calling sqlite3.Cursor.__init__() more than once

2017-10-12 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31753] Unnecessary closure in ast.literal_eval

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I prefer the existing code too.

But I'm surprised that this change has a measurable effects at all. I thought 
that creating a closure is cheaper. Of course it is much faster than creating a 
class. Maybe it is worth to spend some time for optimizing closure creation.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31761] regrtest: faulthandler.enable() fails with io.UnsupportedOperation: fileno when run from IDLE

2017-10-12 Thread STINNER Victor

Change by STINNER Victor :


--
components: +Tests -Documentation
title: Possible error in devguide part about tests -> regrtest: 
faulthandler.enable() fails with io.UnsupportedOperation: fileno when run from 
IDLE

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13802] IDLE font settings: use multiple character sets in examples

2017-10-12 Thread Dong-hee Na

Dong-hee Na  added the comment:

Louie Lu 

Thanks for the cc.
In Korea, 'ᅡᅦᅩᆨᆫ가결걵곴극' are not recommended characters sequence.
This sequence is not fully cover Korean characters.

FYI, 
MS Windows default font preview sequence is 
'다람쥐 헌 쳇바퀴에 타고파'

Google chrome preview sequence is
'정 참판 양반댁 규수 큰 교자 타고 혼례 치른 날'

Those two sequences are the Korean version of 'The quick brown fox jumps over 
the lazy dog'.

If you want to use Korean version of 'AaBbCcDdEeFfGgHhIiJj'
I recommend '가나다라마바사아자차카파타하'

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31769] configure includes user CFLAGS when detecting pthreads support

2017-10-12 Thread Chi Hsuan Yen

Change by Chi Hsuan Yen :


--
nosy: +Chi Hsuan Yen

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13802] IDLE font settings: use multiple character sets in examples

2017-10-12 Thread Dong-hee Na

Dong-hee Na  added the comment:

'가냐더려모뵤수유즈치캐턔페혜' is better than '가나다라마바사아차카파타하'

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25588] Run test suite from IDLE idlelib.run subprocess

2017-10-12 Thread STINNER Victor

Change by STINNER Victor :


--
keywords: +patch
pull_requests: +3940
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25588] Run test suite from IDLE idlelib.run subprocess

2017-10-12 Thread STINNER Victor

STINNER Victor  added the comment:

I proposed PR 3962 to fix a few issues in regrtest when sys.stdout and 
sys.stderr have to file descriptor.

I'm not sure that we should promote running tests with unusual sys.stdout and 
sys.stderr, since many tests fail in that case. That's why I chose to not add a 
NEWS entry to my PR.

For example, test_builtin hangs until you write something in IDLE, whereas no 
prompt is displayed. test_faulthandler fails, and much more tests. I'm not 
interested to support running the Python test suite in IDLE.

Maybe we should even detect that we are running in IDLE and fail with an 
helpful error message like :

"Running the Python test suite inside IDLE is not supported. Run the test suite 
in a terminal."

At least, write a warning in UPPERCASE if sys.stdout or sys.stderr have no file 
descriptor?

--
nosy: +haypo, serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31761] regrtest: faulthandler.enable() fails with io.UnsupportedOperation: fileno when run from IDLE

2017-10-12 Thread STINNER Victor

STINNER Victor  added the comment:

> "If you don’t have easy access to a command line, you can run the test suite 
> from a Python or IDLE shell:

The devguide is wrong. You should not run the Python test suite in IDLE. It 
doesn't work and many tests fail just because of IDLE.

Please run the test suite in a command line (like "cmd.exe" on Windows).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31732] Add TRACE level to the logging module

2017-10-12 Thread STINNER Victor

STINNER Victor  added the comment:

Raymond Hettinger: "... the need for finer distinctions almost never arises in 
practice"

I gave a list of 10 projects which are alreading using widely the 6th TRACE 
level.

In this list, I consider that OpenStack and SaltStack are two big and serious 
projects which justify to add the TRACE level in the stdlib. It will avoid 
these projects to have to "patch" the stdlib for their need.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25588] Run test suite from IDLE idlelib.run subprocess

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I think it would be nice to make testing so flexible as possible. This would 
help to get rid of unintended assumptions. If some tests are failed on IDLE I 
would prefer to fix or skip only these tests.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28647] python --help: -u is misdocumented as binary mode

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

In Python 2 there is an internal buffering in xreadlines(), readlines() and 
file-object iterators. You need to enter many lines first that the program get 
the first of them. And -u doesn't help.

But in Python 3 the program gets the input right as it becomes available. 
Reading is not blocked if the input is available. There are internal buffers, 
but they affect only performance, not the behavior. If you can edit a line 
before pressing Enter, this is because your terminal buffers a line before 
sending it to the program. I think it is more correct to say that stdin is 
always unbuffered in Python 3.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31732] Add TRACE level to the logging module

2017-10-12 Thread pmpp

pmpp  added the comment:

As a dumb user I vote in favor of this on the ground that five levels is not 
sufficient for a long and that the need for finer distinctions already arose 
for me in practice.  Till i overcame the mental cost to think, learn and *find 
time* on how to make a finer level of distinction to work.

line tracing logging is a level on its own and doesn't fit with provided ones 
which are *too simple*.

--

If python is "battery included". It's time to provide a multiplatform charger 
...

--
nosy: +pmpp

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25588] Run test suite from IDLE idlelib.run subprocess

2017-10-12 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy: "If some tests are failed on IDLE I would prefer to fix or skip only 
these tests."

Ok, go ahead. There are many failing tests :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28647] python --help: -u is misdocumented as binary mode

2017-10-12 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy: "(...) I think it is more correct to say that stdin is always 
unbuffered in Python 3."

I disagree. Technically, sys.stdin.read(1) reads up to 1024 bytes from the file 
descriptor 0. For me, "unbuffered read" means that read(1) reads a single byte.

Expected behaviour of an fully unbuffered stdin:

assert sys.stdin.read(1) == 'a'
assert os.read(0, 1) == b'b'

The program should not fail with an assertion error nor block if you write 'ab' 
characters into stdin.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31771] tkinter geometry string +- when window ovelaps left or top of screen

2017-10-12 Thread Peter J

New submission from Peter J :

the root.geometry() top-level window method returns strings like 
"212x128+-9+-8" when the window is located in the top left corner. The 
documentation only describes geometry strings containing + or - location 
coordinates. If this is correct behaviour, the documentation should provide a 
better description of the syntax - perhaps a regular expression such as: 
"\d+x\d+(\+|-|\+-)\d+(\+|-|\+-)\d+" and some text indicating that a +- 
coordinate indicates a value to the left of or above the screen.

Tested Linux Mint 18, Python 3.5.3, tkinter 8.6

Behaviour is consistent with python 2.7 Tkinter 8.6

--
components: Tkinter
messages: 304232
nosy: 8baWnoVi
priority: normal
severity: normal
status: open
title: tkinter geometry string +- when window ovelaps left or top of screen
type: behavior
versions: Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30767] logging must check exc_info correctly

2017-10-12 Thread Matthew Patton

Matthew Patton  added the comment:

"exc_info which, if it does not evaluate as false", so we provide '1' or 
'True'. The IF passes and immediately the formatter tries to dereference it 
blindly assuming it's Tuple and throws an Exception.

Either the Formatter needs to guard itself (best) or the caller needs to check 
the Type before allowing a call to the Formatter to go thru.

Should sys.exc_info() have already been called then the Tuple can have a valid 
frame reference or it's 3 None's. In this last case the Formatter is emitting a 
naked, zero context "NoneType None" line into the middle of the stack trace 
which is just annoying and pointless.

Again, I probably should have written the guard at the formatter to emit 
nothing when the field is None. It actually checks for the 2nd and 3rd fields, 
not the first.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31771] tkinter geometry string +- when window ovelaps left or top of screen

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Tkinter is just a wrapper around the Tk library. It returns what Tk returns. 
See Tk documentation:

https://www.tcl.tk/man/tcl8.6/TkCmd/winfo.htm#M15
https://www.tcl.tk/man/tcl8.6/TkCmd/wm.htm#M42

If you want to improve Tkinter documentation, patches are welcome.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python, serhiy.storchaka
type: behavior -> enhancement
versions: +Python 2.7, Python 3.6, Python 3.7 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30767] logging must check exc_info correctly

2017-10-12 Thread Matthew Patton

Matthew Patton  added the comment:

Additionally (probably should have separate PR) the _checkLevel was full of 
holes.
First, it's allowing any Integer which if you're claiming to "check" things is 
rather silly. At least bounds-check it to GE to NOTSET and LE to CRITICAL (or 
MAX or something handy in that regard).

Second, why is a string representation of an Integer a problem that needs to 
force the caller to fix his code? Same with lowercase of a recognized value. 
"Be liberal in what you accept" would seem to apply here. If it can be 
trivially reduced to an integer or upcased() to get a match then just do it, 
and send the corrected value back to the caller.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31772] SourceLoader uses stale bytecode in case of equal mtime seconds

2017-10-12 Thread Devin Bayer

New submission from Devin Bayer :

The current import machinery will use stale cached bytecode if the source is 
modified more than once per second and with equal size.

A straightforward fix is to require the bytecode mtime to be greater than the 
source file mtime. In the unusual case where the file is written twice with the 
precision the filesystem records, this will ignore the cache, but at least we 
aren't behaving incorrectly.

--
components: Interpreter Core
messages: 304236
nosy: akvadrako
priority: normal
severity: normal
status: open
title: SourceLoader uses stale bytecode in case of equal mtime seconds
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28647] python --help: -u is misdocumented as binary mode

2017-10-12 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy Storchaka:
https://github.com/python/cpython/pull/3961#issuecomment-336136160

"I suggest to continue the discussion on the tracker."

Ok, let's continue here.

"We are fixing the outdated documentation inherited from Python 2. First than 
keep some statement we should consider what it means in the context of Python 2 
and what it means in the context of Python 3."

stdin buffering is a complex thing.

When running the UNIX command "producer | consumer", many users are confused by 
the buffering on the *producer* side.

When running a program in a TTY, the TTY does line buffering for you, you 
cannot get immediately a single character (without changing the default TTY 
configuration).

I don't think that we need to say too much. I just suggest to say "stdin is 
always buffered". That's all.

See my previous messages for the my definition of "buffered" versus 
"unbuffered" read.

Note: Today I learned the UNIX "stdbuf" command, useful to configure the stdin, 
stdout and stderr buffering of C applications using .

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31772] SourceLoader uses stale bytecode in case of equal mtime seconds

2017-10-12 Thread Devin Bayer

Change by Devin Bayer :


--
keywords: +patch
pull_requests: +3941
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30767] logging must check exc_info correctly

2017-10-12 Thread Matthew Patton

Matthew Patton  added the comment:

And the reason to stomp on the "Level " is because by not doing so the message 
that is a single field (regex/awk) has been converted non-deterministically 
into two. This is very bad behavior. If emitting the string/int as-is looks 
wrong then "Level(value)" or some other notation that keeps it a single field 
is how it should print.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31773] Rewrite _PyTime_GetWinPerfCounter() for _PyTime_t

2017-10-12 Thread STINNER Victor

New submission from STINNER Victor :

The commit a997c7b434631f51e00191acea2ba6097691e859 of bpo-31415 moved the 
implementation of time.perf_counter() from Modules/timemodule.c to 
Python/pytime.c. The change not only moved the code, but also changed the 
internal type storing time from floatting point number (C double) to integer 
number (_PyTyime_t = int64_t).

The drawback of this change is that time.perf_counter() now converts 
QueryPerformanceCounter() / QueryPerformanceFrequency() double into a _PyTime_t 
(integer) and then back to double. Two useless conversions required by the 
_PyTime_t format used in Python/pytime.c. These conversions introduced a loss 
of precision.

Try attached round.py script which implements the double <=> _PyTime_t 
conversions and checks to check for precision loss. The script shows that we 
loose precision even with a single second for QueryPerformanceFrequency() == 
3579545.

It seems like QueryPerformanceFrequency() now returns 10 ** 7 (10_000_000, 
resolution of 100 ns) on Windows 8 and newer, but returns 3,579,545 (3.6 MHz, 
resolution of 279 ns) on Windows 7. It depends maybe on the hardware clock, I 
don't know. Anyway, whenever possible, we should avoid precision loss of a 
clock.

--
components: Interpreter Core
files: round.py
messages: 304239
nosy: haypo
priority: normal
severity: normal
status: open
title: Rewrite _PyTime_GetWinPerfCounter() for _PyTime_t
type: enhancement
versions: Python 3.7
Added file: https://bugs.python.org/file47217/round.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28647] python --help: -u is misdocumented as binary mode

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

stdin is mentioned in the documentation of the -u option only due to weird 
internal buffering in Python 2, because user can expect that -u disables it. It 
is documented what methods use internal buffering and how get rid of it. No 
other buffering is mentioned.

This no longer actual in Python 3. I think there is no need to mention stdin in 
the context of the -u option at all. -u doesn't affect stdin buffering, 
whatever that would mean. Period.

Alternatively you can include a lecture about different kinds of buffering and 
how -u doesn't affect them.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31774] tarfile.open ignores custom bufsize value when creating a new archive

2017-10-12 Thread Charalampos Stratakis

New submission from Charalampos Stratakis :

Trying to create an archive with the tarfile module, by specifying a different 
blocking factor, doesn't seem to work as only the default value is being used. 
The issue is reproducible on all the active python branches.

Attaching a script to reproduce it.

Original bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1492157

--
components: Library (Lib)
files: tartest.py
messages: 304241
nosy: cstratak, lars.gustaebel
priority: normal
severity: normal
status: open
title: tarfile.open ignores custom bufsize value when creating a new archive
versions: Python 2.7, Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47218/tartest.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28647] python --help: -u is misdocumented as binary mode

2017-10-12 Thread Berker Peksag

Berker Peksag  added the comment:

> -u doesn't affect stdin buffering, whatever that would mean.

I think we need to document behavior of stdin somewhere, because current the 
sys.stdin documentation states:

> When interactive, standard streams are line-buffered. Otherwise, they
> are block-buffered like regular text files. You can override this value
> with the -u command-line option.

https://docs.python.org/3/library/sys.html#sys.stdin

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31773] Rewrite _PyTime_GetWinPerfCounter() for _PyTime_t

2017-10-12 Thread STINNER Victor

Change by STINNER Victor :


--
keywords: +patch
pull_requests: +3943
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31490] assertion failure in ctypes in case an _anonymous_ attr appears outside _fields_

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset fb3bb8d5d5d70acaaa0fdec15c137544fdd4463f by Serhiy Storchaka 
(Oren Milman) in branch '2.7':
[2.7] bpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ attr 
is defined only outside _fields_. (GH-3615) (#3952)
https://github.com/python/cpython/commit/fb3bb8d5d5d70acaaa0fdec15c137544fdd4463f


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31567] Inconsistent documentation around decorators

2017-10-12 Thread Éric Araujo

Éric Araujo  added the comment:


New changeset 0e61e67a57deb4abc677808201d7cf3c38138e02 by Éric Araujo (Daisuke 
Miyakawa) in branch 'master':
bpo-31567: add or fix decorator markup in docs (#3959)
https://github.com/python/cpython/commit/0e61e67a57deb4abc677808201d7cf3c38138e02


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31567] Inconsistent documentation around decorators

2017-10-12 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +3944

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31761] regrtest: faulthandler.enable() fails with io.UnsupportedOperation: fileno when run from IDLE

2017-10-12 Thread Denis Osipov

Denis Osipov  added the comment:

Got it. Thank you for your help.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31567] Inconsistent documentation around decorators

2017-10-12 Thread Berker Peksag

Berker Peksag  added the comment:

Use of classmethod and staticmethod decorators as functions is still a valid 
use case. I think the old signatures should be kept. It should be possible to 
document both uses in same place:

.. function:: classmethod(function)
.. decorator:: classmethod

   Documentation body.

--
nosy: +berker.peksag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24084] pstats: sub-millisecond display

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I concur with Victor. This change likely breaks graphical viewers of pstat data.

How gprof and similar tools solve the problem of outputting sub-microsecond 
timings?

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24084] pstats: sub-millisecond display

2017-10-12 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
Removed message: https://bugs.python.org/msg304247

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24084] pstats: sub-millisecond display

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I concur with Victor. This change likely breaks graphical viewers of pstat data.

How gprof and similar tools solve the problem of outputting sub-millisecond 
timings?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24084] pstats: sub-millisecond display

2017-10-12 Thread STINNER Victor

STINNER Victor  added the comment:

> I concur with Victor. This change likely breaks graphical viewers of pstat 
> data.

I propose to *do* break the format by always displaying percall timings with a 
precision of 6 digits.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31490] assertion failure in ctypes in case an _anonymous_ attr appears outside _fields_

2017-10-12 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28647] python --help: -u is misdocumented as binary mode

2017-10-12 Thread STINNER Victor

STINNER Victor  added the comment:

Interesting comment in create_stdio() of Python/pylifecycle.c:
---
/* stdin is always opened in buffered mode, first because it shouldn't
   make a difference in common use cases, second because TextIOWrapper
   depends on the presence of a read1() method which only exists on
   buffered streams.
*/
if (Py_UnbufferedStdioFlag && write_mode)
buffering = 0;
else
buffering = -1;
---

stdin is always buffered ;-)

I created bpo-31775: "Support unbuffered TextIOWrapper".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31775] Support unbuffered TextIOWrapper

2017-10-12 Thread STINNER Victor

New submission from STINNER Victor :

It seems like that some methods of the io.TextIOWrapper class requires that its 
buffer object has the read1() method, whereas the constructor checks if the 
buffer has a read1() method and the TextIOWrapper _read_chunk() method is able 
to call buffer.read() if buffer doesn't have read1().

This issue may help to get fully unbuffered sys.stdin, at least when replaced 
manually:

stdin = sys.stdin
sys.stdin = open(0, "r", buffering=0, encoding=stdin.encoding, 
errors=stdin.errors, newline=stdin.newline)

--
components: IO
messages: 304250
nosy: haypo
priority: normal
severity: normal
status: open
title: Support unbuffered TextIOWrapper
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31567] Inconsistent documentation around decorators

2017-10-12 Thread Éric Araujo

Change by Éric Araujo :


--
pull_requests: +3945

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31775] Support unbuffered TextIOWrapper

2017-10-12 Thread STINNER Victor

STINNER Victor  added the comment:

I created this issue because of this comment in create_stdio() of 
Python/pylifecycle.c:
---
/* stdin is always opened in buffered mode, first because it shouldn't
   make a difference in common use cases, second because TextIOWrapper
   depends on the presence of a read1() method which only exists on
   buffered streams.
*/
if (Py_UnbufferedStdioFlag && write_mode)
buffering = 0;
else
buffering = -1;
---

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28647] python --help: -u is misdocumented as binary mode

2017-10-12 Thread STINNER Victor

STINNER Victor  added the comment:

> I think we need to document behavior of stdin somewhere, because current the 
> sys.stdin documentation states:
>
>> When interactive, standard streams are line-buffered. Otherwise, they
>> are block-buffered like regular text files. You can override this value
>> with the -u command-line option.

The last sentence is wrong and should be removed from sys.stdin documentation, 
no?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31567] Inconsistent documentation around decorators

2017-10-12 Thread Éric Araujo

Éric Araujo  added the comment:

I think existing uses of the decorator markup rely on the reader’s 
understanding that it’s syntactic sugar for a call and an assignment, and they 
don’t have decorator+function markup.  The PRs for this ticket follow that.

That said, staticmethod as a non-decorator has an important use case for 
function injection in tests (using self.func in TestCase classes that work with 
a C module and an equivalent Python version).  Maybe this deserves an extra 
example?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31775] Support unbuffered TextIOWrapper

2017-10-12 Thread STINNER Victor

STINNER Victor  added the comment:

Oh, currently it's not possible to create an unbuffered read-only TextIOWrapper 
object:

haypo@selma$ python3
Python 3.6.2 (default, Oct  2 2017, 16:51:32) 
>>> open("/etc/issue", "r", 0)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: can't have unbuffered text I/O

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31767] Windows Installer fails with error 0x80091007 when trying to install debugging symbols

2017-10-12 Thread Steve Dower

Steve Dower  added the comment:

Can you try moving the installer exe to its own (empty) directory before 
running it?

The correct file is on the server (I just redownloaded and verified), so the 
most likely cause is that you ran a /layout at some point in the past and are 
getting that file locally. As you saw in the log, we will look in the directory 
the installer is launched from for a matching local file, so that it's possible 
to download all the optional components and then do a full install while 
offline.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31775] Support unbuffered TextIOWrapper

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The falling back to read() was implemented in issue12591. What methods still 
require read1()?

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28647] python --help: -u is misdocumented as binary mode

2017-10-12 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy: "I think there is no need to mention stdin in the context of the -u 
option at all. -u doesn't affect stdin buffering, whatever that would mean. 
Period."

Hum, I propose to mention stdin in -u documentation as: "The option has no 
effect on stdin." What do you think?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28647] python --help: -u is misdocumented as binary mode

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> Hum, I propose to mention stdin in -u documentation as: "The option has no 
> effect on stdin." What do you think?

This LGTM too. More precise, it has no effect on stdin buffering. It has effect 
on the line_buffering attribute, but this attribute has no effect on reading.

> The last sentence is wrong and should be removed from sys.stdin 
> documentation, no?

Or correct it, making it related only to stdout and stderr.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31775] Support unbuffered TextIOWrapper

2017-10-12 Thread STINNER Victor

STINNER Victor  added the comment:

> The falling back to read() was implemented in issue12591. What methods still 
> require read1()?

I read the Python implementation of TextIOWrapper in _pyio:

* seek() calls buffer.read() "if chars_to_skip:"... not sure that it can happen 
if buffer is a FileIO?
* read(None)  and read(-1) to read "everything" (until EOF): buffer.read()

It seems like read(None) also calls buffer.read() in the C implementation, 
_io_TextIOWrapper_read_impl():

/* Read everything */
PyObject *bytes = _PyObject_CallMethodId(self->buffer, &PyId_read, 
NULL);
PyObject *decoded;
if (bytes == NULL)
goto fail;

and in _io_TextIOWrapper_seek_impl():

/* Just like _read_chunk, feed the decoder and save a snapshot. */
PyObject *input_chunk = _PyObject_CallMethodId(
self->buffer, &PyId_read, "i", cookie.bytes_to_feed);

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31567] Inconsistent documentation around decorators

2017-10-12 Thread Berker Peksag

Berker Peksag  added the comment:

> That said, staticmethod as a non-decorator has an important use case for
> function injection in tests (using self.func in TestCase classes that work 
> with
> a C module and an equivalent Python version).  Maybe this deserves an extra
> example?

Yes, that would be nice.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31775] Support unbuffered TextIOWrapper

2017-10-12 Thread STINNER Victor

STINNER Victor  added the comment:

Context: I created this issue as a follow-up of the discussion on the -u 
command line option, bpo-28647, which still leaves sys.stdin *buffered* in the 
current master branch.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31773] Rewrite _PyTime_GetWinPerfCounter() for _PyTime_t

2017-10-12 Thread STINNER Victor

Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31773] Rewrite _PyTime_GetWinPerfCounter() for _PyTime_t

2017-10-12 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset cba9a0c6def70549046f1afa6a80e38fe706520e by Victor Stinner in 
branch 'master':
bpo-31773: time.perf_counter() uses again double (GH-3964)
https://github.com/python/cpython/commit/cba9a0c6def70549046f1afa6a80e38fe706520e


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31415] Add -X option to show import time

2017-10-12 Thread STINNER Victor

STINNER Victor  added the comment:

Ok, the feature was implemented, the Windows clock resolution was fixed as 
well. It's time to close this issue.

If you still have concerns about import time, see open discussions on the 
python-dev mailing list, or open new issues ;-)

Thanks again Naoki INADA for this nice and useful feature!

--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30767] logging must check exc_info correctly

2017-10-12 Thread Matthew Patton

Matthew Patton  added the comment:

I believe this diff addresses the failure of formatException() to check it's 
parameter's datatype. I still maintain this should be re-opened since it's 
guaranteed to raise an exception when someone sets 'exc_info=TruthyValue' in 
kwargs. albeit with a more focused PR.


diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 00a022039d..5c61cd56a1 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -533,6 +533,8 @@ class Formatter(object):
 This default implementation just uses
 traceback.print_exception()
 """
+if not isinstance(ei, tuple) or ei[0] is None:
+return ""
 sio = io.StringIO()
 tb = ei[2]
 # See issues #9427, #1553375. Commented out for now.
@@ -584,9 +586,7 @@ class Formatter(object):
 if self.usesTime():
 record.asctime = self.formatTime(record, self.datefmt)
 s = self.formatMessage(record)
-if (isinstance(record.exc_info, tuple) and record.exc_info[0]):
-# Intercept 'Boolean' - causes subscript error if passed to 
formatException,
-# and empty Tuples which emit 'NoneType None' into message.
+if record.exc_info:
 # Cache the traceback text to avoid converting it multiple times
 # (it's constant anyway)
 if not record.exc_text:

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31775] Support unbuffered TextIOWrapper

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

What methods still require read1()?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31770] crash and refleaks when calling sqlite3.Cursor.__init__() more than once

2017-10-12 Thread Oren Milman

Change by Oren Milman :


--
keywords: +patch
pull_requests: +3946
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31567] Inconsistent documentation around decorators

2017-10-12 Thread Éric Araujo

Éric Araujo  added the comment:


New changeset 03b9537dc515d10528f83c920d38910b95755aff by Éric Araujo in branch 
'master':
bpo-31567: more decorator markup fixes in docs (GH-3959) (#3966)
https://github.com/python/cpython/commit/03b9537dc515d10528f83c920d38910b95755aff


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31567] Inconsistent documentation around decorators

2017-10-12 Thread Éric Araujo

Éric Araujo  added the comment:


New changeset 205dd4e14de77f9c8ed2903ddebbcf9968bbb6a9 by Éric Araujo (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-31567: add or fix decorator markup in docs (GH-3959) (GH-3966)
https://github.com/python/cpython/commit/205dd4e14de77f9c8ed2903ddebbcf9968bbb6a9


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31567] Inconsistent documentation around decorators

2017-10-12 Thread Éric Araujo

Éric Araujo  added the comment:

Cheers!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31761] regrtest: faulthandler.enable() fails with io.UnsupportedOperation: fileno when run from IDLE

2017-10-12 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Closing this issue, I opened https://github.com/python/devguide/issues/280 so 
that Dev Guide can be updated.

Thanks!

--
nosy: +Mariatta
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31766] Python 3.5 missing from documentation

2017-10-12 Thread Anthony Flury

Anthony Flury  added the comment:

Isn't Python 2.7 in Security Fix only as well ?

It seems strange; Python 3.5 probably the most heavily installed Python 3 
release (every Ubuntu installation has Python 3.5 installed by default - and 
neither Python 3.6 or 3.7 are available from the standard ubuntu repository); 
the docs.python.org site is the normal place people are directed to for help - 
and the implication of the removal will be for many people is that Python 3.5 
is obsolete which isn't the case at all.

--
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31766] Python 3.5 missing from documentation

2017-10-12 Thread Fred L. Drake, Jr.

Fred L. Drake, Jr.  added the comment:

The 3.5 docs should really remain in the main docs UI via the pulldown as long 
as it's so widely used.  The fact that it won't be changing much just means it 
can be served efficiently.

--
nosy: +fdrake

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31761] regrtest: faulthandler.enable() fails with io.UnsupportedOperation: fileno when run from IDLE

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

See issue25588. Currently running tests from IDLE doesn't work, but it worked 
in the past and maybe we can make it working again.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31766] Python 3.5 missing from documentation

2017-10-12 Thread Ned Deily

Change by Ned Deily :


--
keywords: +patch
pull_requests: +3947
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31763] Add NOTICE level to the logging module

2017-10-12 Thread Matthew Patton

Matthew Patton  added the comment:

syslog(3) is cited in the code as inspiration and has been the goto definition 
for logging levels for 40 years across many, many projects. NOTICE is 
incredibly useful especially to those of us who are sysadmins.

Why would Python not implement the full suite of syslog levels? Admittedly the 
case for ALERT and EMERGENCY might be a stretch. It at least doesn't hobble 
those who want to use them. Without proper coverage one has to settle for 
unnecessary jumbling of Noteworthy items being buried in the torrent of 
Informational but not really interesting items.

eg. INFO for attempting a connection. NOTICE for temporary service 
unavailability or handshake timeout, WARNING (maybe ERROR) for retry exhausted 
depending on what the failure means to the app.

eg. INFO for login attempts. NOTICE for password expiry date approaching, for 
failed logins (bad username/passwords, locked/expired account), for password 
change attempts, for temporary Federated Auth connect failure. None of which 
rise to the level of WARNING.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31766] Python 3.5 missing from documentation

2017-10-12 Thread Ned Deily

Ned Deily  added the comment:


New changeset b7cbfe49e39a7bbd7da20b937735a8a60bbf1872 by Ned Deily in branch 
'master':
bpo-31766: restore 3.5 to docs version switchers (#3969)
https://github.com/python/cpython/commit/b7cbfe49e39a7bbd7da20b937735a8a60bbf1872


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31766] Python 3.5 missing from documentation

2017-10-12 Thread Ned Deily

Change by Ned Deily :


--
pull_requests: +3948

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31766] Python 3.5 missing from documentation

2017-10-12 Thread Ned Deily

Ned Deily  added the comment:


New changeset f8d42ea0e4341b270f1de71b4ff40cfa18420eed by Ned Deily in branch 
'3.6':
bpo-31766: restore 3.5 to docs version switchers (#3970)
https://github.com/python/cpython/commit/f8d42ea0e4341b270f1de71b4ff40cfa18420eed


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31766] Python 3.5 missing from documentation

2017-10-12 Thread Ned Deily

Change by Ned Deily :


--
pull_requests: +3949

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31766] Python 3.5 missing from documentation

2017-10-12 Thread Ned Deily

Ned Deily  added the comment:


New changeset 356b68023d6fee5e30d25a4a680ac5b9e4f8dd65 by Ned Deily in branch 
'2.7':
bpo-31766: restore 3.5 to docs version switchers (#3971)
https://github.com/python/cpython/commit/356b68023d6fee5e30d25a4a680ac5b9e4f8dd65


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31766] Python 3.5 missing from documentation

2017-10-12 Thread Ned Deily

Ned Deily  added the comment:

> Isn't Python 2.7 in Security Fix only as well ?

No, 2.7 is still being actively maintained (until 2020).
(https://devguide.python.org/#status-of-python-branches)

But, bowing to popular demand, I've restored 3.5 to the switchers for 3.7, 3.6, 
and 2.7.  It should appear again in the on-line docs shortly.  Thanks for all 
of your comments!

--
resolution: not a bug -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 2.7, Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31772] SourceLoader uses stale bytecode in case of equal mtime seconds

2017-10-12 Thread Brett Cannon

Brett Cannon  added the comment:

The problem with that is it will increase the number of stat calls which we 
have always tried to minimize due to performance worries.

https://www.python.org/dev/peps/pep-0552/ has also been accepted which will 
take care of this specific case. So while I appreciate the work on this, Devin, 
I'm going to close this in favour of people who have this problem to use 
deterministic .pyc files instead.

--
nosy: +brett.cannon, eric.snow, ncoghlan
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31767] Windows Installer fails with error 0x80091007 when trying to install debugging symbols

2017-10-12 Thread Igor Skochinsky

Igor Skochinsky  added the comment:

Hi Steve,

 Thanks for the suggestion! I tried that and while it did not succeed it
gave me an idea of what went wrong last time since it complained about lack
of disk space. I have *not* run the /layout but now that I checked I indeed
had core_d.msi and core_pdb.msi (and a few more) in the Downloads
directory, so I think maybe the installer tried to download them but ran
out of space and the download was incomplete.

Another possibility is that the .msi was for the wrong installer - I first
tried installing the x86 version but later changed my mind but since I did
not expect it to download extra files into the same directory I did not
clean them. Also it seems the downloaded .msi files have the original
timestamp (16-09-27) so I did not notice them when sorting my downloads by
date until I tried to look for .msi files specifically.

In the end I guess this could be closed as PEBKAC but I think maybe some
more testing in low-disk-space conditions and/or installing x86 then x64
from the same directory could uncover some real issues.

In general, I found the 3.3 install experience not very straightforward
compared to 2.7 - I expected that the installer contains everything
necessary (since I did *not* pick "webinstall" one) and won't download
extra files (with the exception of the PDB option which did say
"download"). If the .msi files came from the .exe itself, I'd expect them
to be extracted into a unique temporary directory and not next to the exe.

I will work on freeing some space and then try again.

> Steve Dower  added the comment:
>
> Can you try moving the installer exe to its own (empty) directory before
> running it?
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30058] Buffer overflow in kqueue.control()

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I have tested it on FreeBSD, found and fixed one bug.

--
assignee:  -> serhiy.storchaka
versions:  -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30767] logging must check exc_info correctly

2017-10-12 Thread Matthew Patton

Change by Matthew Patton :


--
pull_requests: +3950

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30058] Buffer overflow in kqueue.control()

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset de072100775cc29e6cd93a75466cecbd1086f258 by Serhiy Storchaka in 
branch 'master':
bpo-30058: Fixed buffer overflow in select.kqueue.control(). (#1095)
https://github.com/python/cpython/commit/de072100775cc29e6cd93a75466cecbd1086f258


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30058] Buffer overflow in kqueue.control()

2017-10-12 Thread Roundup Robot

Change by Roundup Robot :


--
keywords: +patch
pull_requests: +3951

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31640] Document exit() from parse_args

2017-10-12 Thread paul j3

paul j3  added the comment:

And the actual exit is via `parse.error` and `parse.exit`, which are documented 
in 16.4.5.9.

When run interactively in Ipython, exits (including the help) are captured and 
displayed with:

In [896]: parser.parse_args()
usage: ipython3 [-h] [--one | --two | --six]
ipython3: error: unrecognized arguments: --pylab --nosep --term-title 
--InteractiveShellApp.pylab_import_all=False
An exception has occurred, use %tb to see the full traceback.

SystemExit: 2

The exit makes unittesting a challenge.  'test_argparse.py' resolves this by 
using a subclassed parser, one that changes the error/exit, and also redirects 
output.

--
nosy: +paul.j3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2017-10-12 Thread Catalin Patulea

Change by Catalin Patulea :


--
nosy: +Catalin Patulea

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31768] argparse drops '|'s when the arguments are too long

2017-10-12 Thread paul j3

paul j3  added the comment:

As documented in many other issues, the usage formatter is brittle.  It formats 
the individual usages, joins them into a string. Then if too long to fit on one 
line it tries t split into actions, etc.  This split produces an assertion 
error if there are 'wierd' characters in the names (e.g. #[]).

With mutually exclusive groups it gets even worse.  The brackets and | are 
spliced into the original string, and then excess [] and spaces are removed.  
Once recent issue complained about its handling of nested groups (which are 
borderline wrong).

So I"m not surprised that a long group that spans a couple of lines gets messed 
up.   It requires a major rewrite, and even then I there will be formats 
involving groups that fall through the cracks.

--
nosy: +paul.j3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31772] SourceLoader uses stale bytecode in case of equal mtime seconds

2017-10-12 Thread Devin Bayer

Devin Bayer  added the comment:

Hello Brett, it would be nice if you would discuss this before closing. The 
referenced PEP will not solve my use case, because hash-based checking will not 
become the default.

The issue is that by default the source file loader will be returning stale 
bytecode and that's incorrect behavior.

If you wish to avoid the stat call you could use a higher resolution timestamp 
in the pyc file, or better yet add a second field indicating bytecode 
compilation time.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30058] Buffer overflow in kqueue.control()

2017-10-12 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +3952

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30058] Buffer overflow in kqueue.control()

2017-10-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset c923da188bc055e4f3001a6daf1caf54f2b10e40 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-30058: Fixed buffer overflow in select.kqueue.control(). (GH-1095) 
(#3973)
https://github.com/python/cpython/commit/c923da188bc055e4f3001a6daf1caf54f2b10e40


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31768] argparse drops '|'s when the arguments are too long

2017-10-12 Thread paul j3

paul j3  added the comment:

I've changed your example a bit to clarify some points.

parser.add_argument('n', type=int)
group = parser.add_mutually_exclusive_group()
group.add_argument("-v", "--verbose", action="store_true")
group.add_argument("-q", "--quiet", action="store_true")
group.add_argument("-x", metavar='X', type=str, help="the base", nargs='?')
group.add_argument("-y", metavar='Y', type=str, help="the exponent", 
nargs='?')

for i in range(int(sys.argv[1])):
 group.add_argument("z%s"%i, nargs='?')

With `n=0`, usage is:

usage: PROG [-h] [-v | -q | -x [X] | -y [Y]] n

Notice that the positional is placed last.  That is, regardless of the 
definition order, 'usage' shows optionals first, positionals last.

With 2 'z':

usage: PROG [-h] [-v] [-q] [-x [X]] [-y [Y]] n [z0] [z1]

All the mutually exclusive markings have been dropped.  That's because the 
component actions are not consecutive, having been split up by the reordering 
of positionals.  Marking the group is done only if it can do so in a simple 
minded way.  The group testing is not dependent on being able to format it.  
That's done by a different part of the code.

For 7 'z' it splits the line.  Positionals are printed on a new line.

usage: PROG [-h] [-v] [-q] [-x [X]] [-y [Y]]
n [z0] [z1] [z2] [z3] [z4] [z5] [z6]


I noticed this problem with formating group positional in multiline usage some 
time ago, https://bugs.python.org/issue10984#msg192954


Another thing to watch out for - multiple positionals in a group don't make 
sense.  Only the first one can ever be filled.  I don't see a formal check, but 
it doesn't make logical sense.

If I change the code so it produces multiple optionals:

usage: PROG [-h] [-v | -q | -x X | -y Y | --z0 [Z0] | --z1 [Z1] | --z2 [Z2] 
|
--z3 [Z3] | --z4 [Z4]]
n

the group markings are preserved across lines.  Note again that the positional 
(n) is on its own line.

---

Here's another weird behavior, with just one positional in the group:

1314:~/mypy$ python3 argdev/issue31768.py 1 -v 3
usage: PROG [-h] [-v] [-q] [-x X] [-y Y] n [z0]
PROG: error: unrecognized arguments: 3

It complains about not recognizing the '3', rather than complaining about 'z0' 
not allow with '-v'.  That's because the '?' has already been satisfied with [] 
when parsing the 'n' (see https://bugs.python.org/issue15112).

---

In sum, I think this is pathological case that doesn't need to be fixed.  

Usage is ok if there's a long list of optionals.  Usage (and parsing) with just 
one positional in the group is brittle.  We shouldn't expect it work with many 
positionals in the group.

---

@Louie, you 2nd example interweaves the definitions of two groups.  Except for 
the optionals/positions reordering that I mentioned above, usage does not 
reorder arguments.  Mutually exclusive groups are marked only if they are 
contiguous.  

https://bugs.python.org/issue10984 has a patch that can format groups even if 
the actions don't occur in the right order.  It isn't a trivial fix.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31776] Inconsistent exception chaining in /Lib/xml/etree/ElementPath.py

2017-10-12 Thread Pablo

New submission from Pablo :

Based on bpo-29762 
(https://github.com/python/cpython/commit/5affd23e6f42125998724787025080a24839266e),
 there is an inconsistency on one exception chain in 
/Lib/xml/etree/ElementPath.py:

 try:
 selector.append(ops[token[0]](next, token))
 except StopIteration:
raise SyntaxError("invalid path")

should be

  raise SyntaxError("invalid path") from None

--
components: Library (Lib)
messages: 304288
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Inconsistent exception chaining in /Lib/xml/etree/ElementPath.py
type: behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31776] Missing "raise from None" in /Lib/xml/etree/ElementPath.py

2017-10-12 Thread Pablo

Change by Pablo :


--
title: Inconsistent exception chaining in /Lib/xml/etree/ElementPath.py -> 
Missing "raise from None" in /Lib/xml/etree/ElementPath.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >