[issue31493] IDLE cond context: fix code update and font update timers

2017-09-16 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3613

___
Python tracker 

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



[issue31493] IDLE cond context: fix code update and font update timers

2017-09-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset a6bb313c70f8619e6dc4af5cef7d73fa3bbd59ca by Terry Jan Reedy in 
branch 'master':
bpo-31493: Fix code context update and font update timers. (#3622)
https://github.com/python/cpython/commit/a6bb313c70f8619e6dc4af5cef7d73fa3bbd59ca


--

___
Python tracker 

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



[issue31484] Cache single-character strings outside of the Latin1 range

2017-09-16 Thread Ezio Melotti

Ezio Melotti added the comment:

> The cache of size 2 x 256 slots can increase memory consumption by 50 KiB in 
> worst case, 2 x 1024 -- by 200 KiB.

How much is this compared to the total usage?

> But I don't know how common `for c in s` or `s[i]` is used for Japanese text.

I think the same applies to other languages/scripts too, so this optimization 
might be moot unless the cache also improves performances of other more common 
operations (e.g. encoding/decoding).

It would be interesting to see how this affects real-world application: if 
there are no regressions and the memory overhead is not too much I think we can 
accept the patch.

--

___
Python tracker 

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



[issue31493] IDLE cond context: fix code update and font update timers

2017-09-16 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
keywords: +patch
pull_requests: +3612
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



[issue26858] setting SO_REUSEPORT fails

2017-09-16 Thread Guido van Rossum

Guido van Rossum added the comment:

Can't you just submit a PR? It's so easy now!

--

___
Python tracker 

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



[issue31495] Wrong offset with IndentationError ("expected an indented block")

2017-09-16 Thread Martin Panter

Martin Panter added the comment:

Some relevant info I wrote in Issue 25677:

‘The caret points to the character _before_ offset. . . . In some cases (e.g. 
the line “1 +”), the offset is the string index _after_ the error. But in the 
case of “1;1 + 1 = 2”, offset is the index where the error (statement) begins.’

In this case it looks like the offset is of the end of the first word on the 
line that has the wrong indentation. The caret is positioned one position back, 
to point at the last character of that word.

--
nosy: +martin.panter

___
Python tracker 

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



[issue10496] Python startup should not require passwd entry

2017-09-16 Thread R. David Murray

R. David Murray added the comment:

Dmitriy: you will note from the discussion on this issue that your "simple 
patch" was not considered sufficient.  There were additional concerns voiced 
about haypo's patch, which is why I guess it didn't get applied.  However, can 
you review that and confirm that it solves your problem?  Maybe that will 
encourage a reconsideration of this issue.

--

___
Python tracker 

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



[issue31492] assertion failures in case a module has a bad __name__ attribute

2017-09-16 Thread Oren Milman

Changes by Oren Milman :


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

___
Python tracker 

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



[issue31495] Wrong offset with IndentationError ("expected an indented block")

2017-09-16 Thread daniel hahler

New submission from daniel hahler:

Given the following file `t-expected-indent.py`:
```
if 1:
foo
```

python t-expected-indent.py reports:

```
  File "t-expected-indent.py", line 2
foo
  ^
IndentationError: expected an indented block
```

However, it should get reported for column 1 instead of 3.

--
components: Interpreter Core
messages: 302354
nosy: blueyed
priority: normal
severity: normal
status: open
title: Wrong offset with IndentationError ("expected an indented block")
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



[issue31494] Valgrind suppression file

2017-09-16 Thread Aaron Michaux

New submission from Aaron Michaux:

The file "Misc/valgrind-python.supp" doesn't work on Linux x64, running 
Python3.5.2, when configured as such:

  --with-pydebug --with-valgrind --without-pymalloc

Running the interpreter

   echo "x = 1; print(x)" | valgrind --tool=memcheck --leak-check=full 
--track-origins=yes --verbose --log-file=valgrind.log 
--suppressions=Misc/valgrind-python.supp /path/to/built/python3

Gives the attached valgrind.log file. The tail of this file says:

==22828== 
==22828== LEAK SUMMARY:
==22828==definitely lost: 0 bytes in 0 blocks
==22828==indirectly lost: 0 bytes in 0 blocks
==22828==  possibly lost: 298,529 bytes in 690 blocks
==22828==still reachable: 605,872 bytes in 4,874 blocks
==22828== suppressed: 0 bytes in 0 blocks
==22828== Reachable blocks (those to which a pointer was found) are not shown.
==22828== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==22828== 
==22828== ERROR SUMMARY: 256 errors from 256 contexts (suppressed: 0 from 0)
==22828== ERROR SUMMARY: 256 errors from 256 contexts (suppressed: 0 from 0)

--
components: Interpreter Core
files: valgrind.log
messages: 302353
nosy: Aaron Michaux
priority: normal
severity: normal
status: open
title: Valgrind suppression file
versions: Python 3.5
Added file: https://bugs.python.org/file47140/valgrind.log

___
Python tracker 

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



[issue31493] IDLE cond context: fix code update and font update timers

2017-09-16 Thread Terry J. Reedy

New submission from Terry J. Reedy:

1. Currently, each instance of codecontext.CodeContext creates 2 root.after 
loops.  There should be at most two loops for the class, and preferably fewer 
by using the new reload().

2. The loops are never explicitly shut down.  Since conversion to a feature,  
the following appears after running test_idle.

.invalid command name "109891384timer_event"
while executing
"109891384timer_event"
("after" script)
invalid command name "109891512font_timer_event"
while executing
"109891512font_timer_event"
("after" script)

This is because of
  File "F:\dev\3x\lib\idlelib\idle_test\test_outwin.py", line 20, in setUpClass
w = cls.window = outwin.OutputWindow(None, None, None, root)
  File "F:\dev\3x\lib\idlelib\outwin.py", line 78, in __init__
EditorWindow.__init__(self, *args)
  File "F:\dev\3x\lib\idlelib\editor.py", line 319, in __init__
  text.bind("<>",  # added to traceback
self.CodeContext(self).toggle_code_context_event)

The statement, which creates an instance, was added as part of the conversion.  
However, the outwin tests were merged a week before the conversion, so this 
message might have started the.  In any case, 
editor.EditorWindow.load_extension does the same thing in doing the binding.  
It is not clear why there is no message from other editor-creating tests. 

I want to fix at least this before next Monday's cutoff for new releases.  I 
will first try is after_cancel in a __del__ method.

--
assignee: terry.reedy
components: IDLE
messages: 302352
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE cond context: fix code update and font update timers
type: behavior
versions: 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



[issue22703] Idle Code Context: separate changing current and future editors

2017-09-16 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions: +Python 3.6, Python 3.7 -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue26858] setting SO_REUSEPORT fails

2017-09-16 Thread Philip Jenvey

Philip Jenvey added the comment:

Note that this isn't an android specific issue: See issue19901, and 
9791c5d55f52 for an appropriate solution patch.

(Renaming title)

--
nosy: +pjenvey
title: android: setting SO_REUSEPORT fails -> setting SO_REUSEPORT fails

___
Python tracker 

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



[issue31458] Broken link to Misc/NEWS in What's New page

2017-09-16 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
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



[issue31487] Improve f-strings documentation wrt format specifiers

2017-09-16 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
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



[issue31487] Improve f-strings documentation wrt format specifiers

2017-09-16 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 46c1052404c1a6e4d35af8e96613db8a4be75b52 by Mariatta (Miss 
Islington (bot)) in branch '3.6':
bpo-31487: Improve f-strings documentation (GH-3604) (GH-3619)
https://github.com/python/cpython/commit/46c1052404c1a6e4d35af8e96613db8a4be75b52


--

___
Python tracker 

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



[issue31487] Improve f-strings documentation wrt format specifiers

2017-09-16 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3610

___
Python tracker 

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



[issue31458] Broken link to Misc/NEWS in What's New page

2017-09-16 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset d3cba8175ca48d33a4e0117109a44935a1cec658 by Mariatta (Miss 
Islington (bot)) in branch '3.6':
bpo-31458: Clarify that Changelog is built from Misc/NEWS.d directory (GH-3617) 
(GH-3618)
https://github.com/python/cpython/commit/d3cba8175ca48d33a4e0117109a44935a1cec658


--

___
Python tracker 

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



[issue31492] assertion failures in case a module has a bad __name__ attribute

2017-09-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31492] assertion failures in case a module has a bad __name__ attribute

2017-09-16 Thread Oren Milman

Changes by Oren Milman :


--
components: +Interpreter Core -Extension Modules

___
Python tracker 

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



[issue31492] assertion failures in case a module has a bad __name__ attribute

2017-09-16 Thread Oren Milman

New submission from Oren Milman:

The following code causes an assertion failure:
import os
os.__name__ = None
os.does_not_exist

this is because module_getattro() (in Objects/moduleobject.c) assumes that
__name__ is a string, and passes it to PyErr_Format(), which asserts it is a
string.


if we fixed that one (so that the code above would raise an AttributeError),
the following code would still cause an assertion failure:

import os
os.__name__ = None
from os import does_not_exist


this is because import_from() (in Python/ceval.c) also assumes that __name__
is a string, and passes it to PyUnicode_FromFormat(), which asserts it is a
string.


BTW, while we are in module_getattro(): isn't the second call to PyErr_Clear()
redundant? (Ethan, IIUC, you worked on this as part of #8297 some years ago..)

--
components: Extension Modules
messages: 302348
nosy: Oren Milman, ethan.furman
priority: normal
severity: normal
status: open
title: assertion failures in case a module has a bad __name__ attribute
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



[issue31458] Broken link to Misc/NEWS in What's New page

2017-09-16 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3609

___
Python tracker 

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



[issue31458] Broken link to Misc/NEWS in What's New page

2017-09-16 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 0ec8c4bd10dcfd8e580628868efdd3df91038898 by Mariatta in branch 
'master':
bpo-31458: Clarify that Changelog is built from Misc/NEWS.d directory (GH-3617)
https://github.com/python/cpython/commit/0ec8c4bd10dcfd8e580628868efdd3df91038898


--

___
Python tracker 

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



[issue31016] [Regression] sphinx shows an EOF error when using python2.7 from the trunk

2017-09-16 Thread Benjamin Peterson

Benjamin Peterson added the comment:

wontfixing since Sphinx has fixed their code.

--
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



[issue31170] Update to expat 2.2.4 (expat: utf8_toUtf8 cannot properly handle exhausting buffer)

2017-09-16 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
versions:  -Python 2.7

___
Python tracker 

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



[issue31438] Mac Apple tcl/tk crashes program when caret ^ character typed in IDLE or tkinter

2017-09-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The 'all text' is apparently limited to 2 words.  'idle crash caret' in the 
title box gets this issue and the superseder above.  Move to all-text box and 
nothing is returned.  Delete 1 of 3 words and get multiple answers.

--

___
Python tracker 

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



[issue31438] Mac Apple tcl/tk crashes program when caret ^ character typed in IDLE or tkinter

2017-09-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:

OK.  This is more complete, still succinct enough, and still true.

--
components: +macOS
title: Apple tcl/tk crashes and quits when caret character typed -> Mac Apple 
tcl/tk crashes program when caret ^ character typed in IDLE or tkinter

___
Python tracker 

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



[issue31458] Broken link to Misc/NEWS in What's New page

2017-09-16 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +3608
stage:  -> patch review

___
Python tracker 

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



[issue31484] Cache single-character strings outside of the Latin1 range

2017-09-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:

If I understand correctly, anyone could change the cache size for their 
personal or corporate binary by changing
#define BMP_CACHE_SIZE 256

There should be a comment that it must not be 0 and should be a power of 2 at 
least, say, 256.

--

___
Python tracker 

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



[issue31438] Apple tcl/tk crashes and quits when caret character typed

2017-09-16 Thread ALPER PAKSOY

ALPER PAKSOY added the comment:

I believe it would be better if IDLE was somehow mentioned in the header. This 
is partly the reason I failed to recognize that this was a problem encountered 
before.

new title suggestion: Apple tcl/tk crashes and causes IDLE to quit when caret 
character typed in IDLE

--

___
Python tracker 

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



[issue27391] server_hostname should only be required when checking host names

2017-09-16 Thread Christian Heimes

Christian Heimes added the comment:

So it's not a problem with the SSL module but rather in asyncio. From the 
initial report it was not clear to me that it only affects asyncio.

I'm not sure this issue should be fixed at all. As I explained earlier, a 
hostname is required for both hostname verification and SNI TLS extension. We 
may allow to omit the parameter with verify_mode=CERT_NONE and 
check_hostname=False only. In all other cases the server may return a wrong 
cert or refuse to establish a connection.

--
assignee: christian.heimes -> yselivanov
components:  -SSL

___
Python tracker 

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



[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2017-09-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Yes.  When we are more or less done with reworking the config dialog, I expect 
to work on editor/shell.

--
versions: +Python 3.6, Python 3.7 -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue31440] wrong default module search path in help message

2017-09-16 Thread Christian Heimes

Christian Heimes added the comment:

See site module, especially site._get_path()

# Same to sysconfig.get_path('purelib', os.name+'_user')
def _get_path(userbase):
version = sys.version_info

if os.name == 'nt':
return f'{userbase}\\Python{version[0]}{version[1]}\\site-packages'

if sys.platform == 'darwin' and sys._framework:
return f'{userbase}/lib/python/site-packages'

return f'{userbase}/lib/python{version[0]}.{version[1]}/site-packages'

--

___
Python tracker 

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



[issue31440] wrong default module search path in help message

2017-09-16 Thread Christian Heimes

Christian Heimes added the comment:

You are right, the path is wrong on Unix-like platforms. It's 
os.path.join(sys.prefix, 'lib', 'python{major}.{minor}'). But the actual path 
may depend on the platform, too. I don't recall how Windows sets up the path.

--
nosy: +christian.heimes
type:  -> behavior

___
Python tracker 

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



[issue13487] inspect.getmodule fails when module imports change sys.modules

2017-09-16 Thread Patrik Simons

Patrik Simons added the comment:

I cannot reproduce. In fact I cannot even get list(d.items())
to raise RuntimeError: dictionary changed size during iteration
for any dict d.

--

___
Python tracker 

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



[issue31465] Allow _PyType_Lookup() to raise exceptions

2017-09-16 Thread Stefan Behnel

Stefan Behnel added the comment:

Test suite passes now. The crash was due to an uninitialised error flag in one 
case, which lead the C compiler to do incorrect optimisations on undefined 
behaviour.

--

___
Python tracker 

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



[issue31465] Allow _PyType_Lookup() to raise exceptions

2017-09-16 Thread Stefan Behnel

Changes by Stefan Behnel :


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

___
Python tracker 

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



[issue31491] Add is_closing() to asyncio.StreamWriter.

2017-09-16 Thread Aymeric Augustin

New submission from Aymeric Augustin:

asyncio.StreamWriter wraps a transport. The first three document methods of 
asyncio.BaseTransport are close(), is_closing() and get_extra_info().

It is somewhat surprising that StreamWriter provides close() and 
get_extra_info() but not is_closing(). I'm proposing that StreamWriter 
implement is_closing() as well.

It's as simple as:

def is_closing(self):
return self._transport.is_closing()

Perhaps it was simply missed in https://github.com/python/asyncio/pull/291.

It's trivial to work around this omission with 
stream_writer.transport.is_closing().

I'm only suggesting to add it for consistency.

--
components: asyncio
messages: 302335
nosy: aymeric.augustin, yselivanov
priority: normal
severity: normal
status: open
title: Add is_closing() to asyncio.StreamWriter.
type: enhancement
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



[issue29916] No explicit documentation for PyGetSetDef and getter and setter C-API

2017-09-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Michael for your contribution.

--

___
Python tracker 

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



[issue29916] No explicit documentation for PyGetSetDef and getter and setter C-API

2017-09-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee: docs@python -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> enhancement
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



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

2017-09-16 Thread Oren Milman

Changes by Oren Milman :


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

___
Python tracker 

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



[issue29916] No explicit documentation for PyGetSetDef and getter and setter C-API

2017-09-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 41376241e364e4f84cd14631634604edbd105da0 by Serhiy Storchaka 
(Michael Seifert) in branch '2.7':
bpo-29916: Include PyGetSetDef in C API extension documentation. (#831) (#3609)
https://github.com/python/cpython/commit/41376241e364e4f84cd14631634604edbd105da0


--

___
Python tracker 

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



[issue29916] No explicit documentation for PyGetSetDef and getter and setter C-API

2017-09-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 51ea80697b023595cdd79c7696589a04cc581693 by Serhiy Storchaka 
(Michael Seifert) in branch '3.6':
bpo-29916: Include PyGetSetDef in C API extension documentation. (#831) (#3607)
https://github.com/python/cpython/commit/51ea80697b023595cdd79c7696589a04cc581693


--

___
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-09-16 Thread Oren Milman

New submission from Oren Milman:

The following code causes an assertion failure:
import ctypes
class BadStruct(ctypes.Structure):
_fields_ = []
_anonymous_ = ['foo']
foo = None


this is because MakeAnonFields() (in Modules/_ctypes/stgdict.c) goes over the
names specified in _anonymous_, and looks each name up in the class by calling
PyObject_GetAttr().
in case an attribute of such a name is found (i.e. PyObject_GetAttr() 
succeeded),
MakeAnonFields() assumes that the attribute was created by MakeFields(), so it
asserts the type of the attribute is PyCField_Type.

however, PyObject_GetAttr() would succeed also in case it is a normal attribute
specified by the user, but isn't specified in _fields_, as in the code above.
in such a case, the type of the attribute is not PyCField_Type, and so the
assertion fails.

--
components: ctypes
messages: 302331
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: assertion failure in ctypes in case an _anonymous_ attr appears outside 
_fields_
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



[issue31484] Cache single-character strings outside of the Latin1 range

2017-09-16 Thread INADA Naoki

INADA Naoki added the comment:

Interesting optimization.  But I don't know how common `for c in s`
or `s[i]` is used for Japanese text.

--

___
Python tracker 

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



[issue31482] random.seed() doesn't work with bytes and version=1

2017-09-16 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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

___
Python tracker 

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



[issue31484] Cache single-character strings outside of the Latin1 range

2017-09-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Initially I used 2 x 128 slots. It is enough for single block alphabetic 
languages. But it was caused significant slow down for Chinese. Increasing the 
size to 2 x 256 compensates the overhead for Chinese and restores the 
performance. If it is appropriate that the optimization affects only languages 
with small alphabets and keeps the performance for Chinese, Japan and Korean 
roughly unchanged (plus-minus few percents), this size is enough. I we want to 
optimize also processing texts with Chinese characters, it can be increased to 
2 x 512 or 2 x 1024. Further increasing have smaller effect.

The cache of size 2 x 256 slots can increase memory consumption by 50 KiB in 
worst case, 2 x 1024 -- by 200 KiB.

--
nosy: +inada.naoki, xiang.zhang

___
Python tracker 

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



[issue31182] Suggested Enhancements to zipfile & tarfile command line interfaces

2017-09-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The command-line interface of zipfile and tarfile modules was deliberately kept 
simple. If you need more complex functionality, just write a script. Python is 
a programming language!

> 1. Wildcard filename matching for archiving

This is a work for a shell. Interpreting wildcards by a program breaks 
compatibility and makes impossible to handle files containing special 
characters. For example it breaks:

python3 -m zipfile -c myzip.zip "The Book [vol. 5].txt".

No way.

> 2. Recursive archiving (with excludes)

Archiving already is recursive. It may be worth to add an option for adding 
directories not recursively.

> 3. Append to archive option

May be. I don't know what to do with compressed tar archives.

> 4.1 For zipfile: zip64, bizp2 & lzma (if available)

Would be nice. And this option could force compression for tarfile.

As new features they can be added only in 3.7.

--
nosy: +serhiy.storchaka
versions:  -Python 2.7

___
Python tracker 

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



[issue13487] inspect.getmodule fails when module imports change sys.modules

2017-09-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

dict.copy() is not thread-safe still (but it can be made thread-safe).

list(dict) is thread-safe. It copies a list of keys only.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31488] IDLE: Update feature classes when options are changed.

2017-09-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 77b52e463ab9f8bea7703ff9c03c06b3ec889db7 by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-31488: IDLE - update former extensions when options change. (GH-3612) 
(#3613)
https://github.com/python/cpython/commit/77b52e463ab9f8bea7703ff9c03c06b3ec889db7


--

___
Python tracker 

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



[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2017-09-16 Thread Big Stone

Big Stone added the comment:

is there still any hope on this ?

--
nosy: +Big Stone

___
Python tracker 

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