[issue24665] CJK support for textwrap

2017-02-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +Add functions to get the width in columns of a character, 
textwrap.wrap: add control for fonts with different character widths

___
Python tracker 

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



[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-14 Thread Martin Panter

Martin Panter added the comment:

Without more information about what the relevant code is and why you think the 
line number is wrong, my best guess is you may not realize how the 
ResourceWarning is emitted. It happens when the garbage collector runs and 
destroys the socket object, which happens sometime after the last reference to 
the socket has been deleted. So the line number can be rather arbitrary, 
especially if it was a reference cycle that triggered the garbage collector.

If you are having trouble tracking down what socket is involved, the new 
“python -X tracemalloc=” option 
 may help. It saves stack 
traces when objects are created.

--
nosy: +martin.panter
stage:  -> test needed

___
Python tracker 

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



[issue29561] Interactive mode gives sys.ps2 not sys.ps1 after comment-only line

2017-02-14 Thread Eryk Sun

Eryk Sun added the comment:

For the tokenizer, a blank line is "[a] logical line that contains only spaces, 
tabs, formfeeds and possibly a comment" [1]. A blank line is normally ignored, 
except in the REPL an entirely blank line (i.e. no whitespace or comment) is 
used to end a multi-line statement.

This behavior is coded in Parser/tokenizer.c in tok_get(). After removing 
leading whitespace to get the indentation level, it decides whether the line 
should be ignored as blank as follows:

if (c == '#' || c == '\n') {
/* Lines with only whitespace and/or comments
   shouldn't affect the indentation and are
   not passed to the parser as NEWLINE tokens,
   except *totally* empty lines in interactive
   mode, which signal the end of a command group. */
if (col == 0 && c == '\n' && tok->prompt != NULL) {
blankline = 0; /* Let it through */
}
else {
blankline = 1; /* Ignore completely */
}
/* We can't jump back right here since we still
   may need to skip to the end of a comment */
}

The tokenizer switches to the ps2 prompt unconditionally, even if the first 
line was ignored as a blank line. One can argue that this behavior is outside 
of the norm for a shell or REPL. For example, bash doesn't switch to its PS2 
prompt after ignoring an initial blank line. On the other hand, the interpreter 
is correctly conveying that it's still tokenizing the input; it hasn't compiled 
or executed any code.

[1]: https://docs.python.org/3/reference/lexical_analysis.html#blank-lines

--
nosy: +eryksun

___
Python tracker 

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



[issue24665] CJK support for textwrap

2017-02-14 Thread INADA Naoki

INADA Naoki added the comment:

FYI, I had implemented textwrap respects EAW in Bazaar project.
See here.
http://bazaar.launchpad.net/~bzr-pqm/bzr/bzr.dev/revision/5874

--

___
Python tracker 

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



[issue24665] CJK support for textwrap

2017-02-14 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Some CJK character are marked as "ambiguous width". Seems in this patch 
ambiguous characters are assumed as narrow. Maybe it's better to document it?

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



Re: WANT: bad code in python (for refactoring example)

2017-02-14 Thread Steven D'Aprano
On Wed, 15 Feb 2017 07:44:03 +0900, Makoto Kuwata wrote:

> Hi,
> 
> Is there any *just right* python code to refactor?
> In other words, I'm finding bad code example in python.


Try looking at the ActiveState website for recipes in Python. Especially 
look at the ones with negative ratings, but even positively rated recipes 
are often nonsense.

E.g. http://code.activestate.com/recipes/580750

does nothing more that define

echo = sys.stdout.write

Why not use sys.stdout.write directly? Or print? If I saw somebody using 
this recipe in production code, in the way shown, I'd refactor it to just 
use print. There's no advantage to re-inventing the wheel this way.



-- 
Steve
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24665] CJK support for textwrap

2017-02-14 Thread INADA Naoki

INADA Naoki added the comment:

Sorry, I'm not unicode expert.

Important usage of textwrap is printing in terminal.
So I think we should learn from software relating terminal.

tmux uses utf8proc.  utf8proc calculates display width by script at here.
https://github.com/JuliaLang/utf8proc/tree/master/data

--
nosy: +inada.naoki

___
Python tracker 

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



[issue29557] binhex documentation claims unknown bug

2017-02-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +macOS
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



[issue29557] binhex documentation claims unknown bug

2017-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think this should be read in the context of previous lines:

If you code or decode textfiles on non-Macintosh platforms they will still 
use
the old Macintosh newline convention (carriage-return as end of line).

And may be related to the in-code comment:

#  Do translation on non-mac systems

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks, Thomas :) I'll let you close your own PR on GitHub.

--

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-14 Thread Thomas Caswell

Thomas Caswell added the comment:

I am not optimistic about the speed at which my employer will get this
sorted out.

better to just fix it and drop my commit!

On Tue, Feb 14, 2017, 23:43 Mariatta Wijaya  wrote:

Mariatta Wijaya added the comment:

Thanks, Raymond :) I prepared the pull requests for 3.5, 3.6, and master
branches.

Thomas, you mentioned about needing to go over CLA with your employer in
your PR.

Not sure if you have any update on that? If your CLA is approved, I can
merge and cherry-pick your PR instead.

--
stage:  -> patch review

___
Python tracker 

___

--

___
Python tracker 

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



[issue28929] Provide a link from documentation back to its source file

2017-02-14 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +75

___
Python tracker 

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



[issue29521] Minor warning messages when compiling documentation

2017-02-14 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +73

___
Python tracker 

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



[issue29521] Minor warning messages when compiling documentation

2017-02-14 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +74

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks, Raymond :) I prepared the pull requests for 3.5, 3.6, and master 
branches.

Thomas, you mentioned about needing to go over CLA with your employer in your 
PR.

Not sure if you have any update on that? If your CLA is approved, I can merge 
and cherry-pick your PR instead.

--
stage:  -> patch review

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-14 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +72

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-14 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +71

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-14 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +70

___
Python tracker 

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



[issue29536] test_hashlib failure on Ubuntu 16.04

2017-02-14 Thread Xiang Zhang

Xiang Zhang added the comment:

I am using 16.10 but I can't reproduce the failures. Sachin can you reliably 
reproduce the failures? And one thing interesting is that all the failed test 
cases need the network source to be enabled but your command doesn't do that, 
it's better to use ./python -m test -uall -v test_hashlib.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue29521] Minor warning messages when compiling documentation

2017-02-14 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +69

___
Python tracker 

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



[issue29563] Update Devguide about building documentation.

2017-02-14 Thread Zachary Ware

Zachary Ware added the comment:

I'd suggest replacing as much as possible in the devguide with a link to 
Doc/README.rst (or Doc/README.txt, if that's what it still is).  Other 
improvements should be made in the README.

--
nosy: +zach.ware

___
Python tracker 

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



[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0

2017-02-14 Thread David Ford (FirefighterBlu3)

David Ford (FirefighterBlu3) added the comment:

Arch Linux (updated ~weekly but not often rebooted) on a Digital Ocean droplet.

Kernel 4.5.1-1-ARCH, x86_64, OpenSSL 1.0.2j, Python 3.6.0

--

___
Python tracker 

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



[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0

2017-02-14 Thread David Ford (FirefighterBlu3)

David Ford (FirefighterBlu3) added the comment:

my SNI callback is a function that chooses which SSL certificate to load and 
summarized is:

  6 def sni_callback(sock, servername, context):
[...]
 44 # load a specific crt/key
 45 store = crtstore[servername]
 46 
 47 context.load_cert_chain( certfile = store['certfile'],
 48  keyfile  = store['keyfile'],
 49  password = store['password'] )

--

___
Python tracker 

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



[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0

2017-02-14 Thread David Ford (FirefighterBlu3)

David Ford (FirefighterBlu3) added the comment:

in process of creating a non-stripped python install. the default Arch Linux 
PKGBUILD uses xvfb-run at the end of the build process which is crashing.

--

___
Python tracker 

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



[issue29529] Backport Travis configuration

2017-02-14 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +68

___
Python tracker 

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



[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-14 Thread David Ford (FirefighterBlu3)

New submission from David Ford (FirefighterBlu3):

the following warning is incorrectly reported as initiated at 
psycopg2/extras.py:314, it actually occurs inside the Twilio python module.

/usr/lib/python3.6/site-packages/psycopg2/extras.py:314: ResourceWarning: 
unclosed 
  ts = super(NamedTupleCursor, self).fetchall()
namedtuple_Record:19: ResourceWarning: unclosed 



This is the snippet of my code which makes the Twilio API call over https 
(noted by the >>> line).

# get failed/undelivered
with (yield from 
self.aiopg_pool.cursor(cursor_factory=psycopg2.extras.NamedTupleCursor)) as c:
yield from c.execute(stmt_bad, (id,))
rows = yield from c.fetchall()

# make calls to twilio and fetch failure reasons
for r in rows:
>>> msg = self._twilio.messages.get(r.delivery_id)
errors[r.delivery_id] = r.recipient, msg.error_code, 
msg.error_message


my tool uses crossbar.io's python-autobahn asyncio classes which do not use 
threading to my knowledge. psycopg2/pool.py does use threading. python-twilio 
does not use threading either.

--
messages: 287810
nosy: David Ford (FirefighterBlu3)
priority: normal
severity: normal
status: open
title: ResourceWarning tracking is attaching incorrect file:position to 
unclosed socket
type: resource usage
versions: Python 3.6

___
Python tracker 

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



[issue29563] Update Devguide about building documentation.

2017-02-14 Thread Jim DeLaHunt

New submission from Jim DeLaHunt:

The Devguide section 7.5.1 "Building the documentation" / "Using make / 
make.bat" is out of date.  The document lists 10 documentation targets for 
`make`. The Doc/Makefile lists 17. 

One important omission is `make check`, which looks for errors in 
reStructuredText syntax, using `rstlint.py`. It's important for contributors to 
know about and to run `make check`, because with the move to GitHub, the 
project is running make check after pulling in new code.  If contributors 
haven't cleaned up their submissions, the build fails.

I suggest that the following improvements be made:

1. rewrite the bullet list "Available make targets are:" in 7.5.1 
https://cpython-devguide.readthedocs.io/documenting.html#using-make-make-bat to 
match the list of targets in Doc/Makefile:21-38.

2. add a comment that `make help` will give the most up-to-date list of targets 
from the makefile, which might be better than the list in the Devguide.

3. add `make help` to both Doc/Makefile:21-38 and Devguide 7.5.1.

4. add to Devguide 6.3. "Helping with the Developer’s Guide" an instruction to 
run `make check` before submitting a pull request to the Devguide.

--
assignee: docs@python
components: Documentation
messages: 287808
nosy: JDLH, docs@python
priority: normal
severity: normal
status: open
title: Update Devguide about building documentation.
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



[issue18779] Misleading documentations and comments in regular expression HOWTO

2017-02-14 Thread A.M. Kuchling

A.M. Kuchling added the comment:

Unfortunately making the sentences pedantically correct also makes them 
ungainly, and I think people generally assume that underscores are treated as a 
letter.

--
nosy: +akuchling
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



[issue29562] test_getgroups of test_posix fails (on OS X 10.10)

2017-02-14 Thread Jim DeLaHunt

Jim DeLaHunt added the comment:

I have pushed a branch for this issue to my cpython fork:

https://github.com/JDLH/cpython/tree/bpo-29562_failing_test_getgroups_on_os_x

It modifies test_getgroups in test_posix.py to give better diagnostics in the 
event of a test failure. It says specifically which groups were in id -G, and 
posix.getgroups(), but not in the other.

% ./python.exe -m unittest -v test.test_posix.PosixTester.test_getgroups 
test_getgroups (test.test_posix.PosixTester) ... FAIL

==
FAIL: test_getgroups (test.test_posix.PosixTester)
--
Traceback (most recent call last):
  File "/Users/jdlh/workspace/cpython/Lib/test/test_posix.py", line 841, in 
test_getgroups
self.assertEqual(len(symdiff), 0, msg)
AssertionError: 2 != 0 : id -G and posix.groups() should have zero difference.
Groups in id -G but not posix.groups(): [(701, 'com.apple.sharepoint.group.1'), 
(398, 'com.apple.access_screensharing')]
Groups in posix.groups() but not id -G: []
(Effective GID (20) was disregarded.)

--
Ran 1 test in 0.020s

I don't think this branch is ready yet to submit to the main codebase, but it 
may help people diagnose the issue.

--

___
Python tracker 

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



[issue29562] test_getgroups of test_posix fails (on OS X 10.10)

2017-02-14 Thread Jim DeLaHunt

New submission from Jim DeLaHunt:

When I run test.test_posix.PosixTester.test_getgroups on my Mac OS X system, it 
fails:

% ./python.exe -m unittest -v test.test_posix.PosixTester.test_getgroups
test_getgroups (test.test_posix.PosixTester) ... FAIL

==
FAIL: test_getgroups (test.test_posix.PosixTester)
--
Traceback (most recent call last):
  File "/Users/jdlh/workspace/cpython/Lib/test/test_posix.py", line 824, in 
test_getgroups
self.assertTrue(not symdiff or symdiff == {posix.getegid()})
AssertionError: False is not true

--
Ran 1 test in 0.013s

FAILED (failures=1)


Details of my system:
% sw_vers
ProductName:Mac OS X
ProductVersion: 10.10.5
BuildVersion:   14F2109

% id -G
20 507 12 61 80 
98 399 33 100 
204 395 398 
701
% id -G -n
staff xampp everyone localaccounts admin 
_lpadmin com.apple.access_ssh _appstore _lpoperator 
_developer com.apple.access_ftp com.apple.access_screensharing 
com.apple.sharepoint.group.1
# I wrapped these lines similarly, to make the correspondence clearer

% ./python.exe -c 'import grp,os; g={i: (n, p, i, mem) for (n, p, i, mem) in 
grp.getgrall()}; print(sorted([(i, g[i][0]) for i in os.getgroups()]) )'
[(12, 'everyone'), (20, 'staff'), (33, '_appstore'), (61, 'localaccounts'), 
(80, 'admin'), (98, '_lpadmin'), (100, '_lpoperator'), (204, '_developer'), 
(395, 'com.apple.access_ftp'), (399, 'com.apple.access_ssh'), (507, 'xampp')]

So the difference, which triggers the test failure, is that id -G is returning 
groups (701, 'com.apple.sharepoint.group.1'), and (398, 
'com.apple.access_screensharing'), while posix.getgroups() is not.  I do not 
yet understand why.

Others say this test works on their OS X 10.10 system, so maybe it's triggered 
by something in my environment. 

Also: python3.6 from MacPorts, and python2.7 from MacPorts, return the same set 
of groupids as does the dev build of python3.7.

This bug affects the same test, and the same posix.getgroups() call, as 
http://bugs.python.org/issue17557 "test_getgroups of test_posix can fail on OS 
X 10.8 if more than 16 groups" (2013-2014, closed).  But I think it is a 
different problem: issue17557 is related to how posix.getgroups() deals with 
large numbers of groups, and it is fixed.

I would appreciate help in getting this test to pass. Maybe my environment is 
wrong, in which case I should fix my environment. But maybe the cpython code is 
sensitive to some detail of my environment, in which case perhaps I should fix 
the cpython code.

--
components: Tests
messages: 287806
nosy: JDLH
priority: normal
severity: normal
status: open
title: test_getgroups of test_posix fails (on OS X 10.10)
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



[issue29531] Update Doc/README.txt to README.rst

2017-02-14 Thread Roger Sachan

Changes by Roger Sachan :


--
pull_requests: +67

___
Python tracker 

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



[issue29531] Update Doc/README.txt to README.rst

2017-02-14 Thread Roger Sachan

Changes by Roger Sachan :


--
pull_requests:  -31

___
Python tracker 

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



[issue29546] A more helpful ImportError message

2017-02-14 Thread Matthias Bussonnier

Matthias Bussonnier added the comment:

See https://github.com/python/cpython/pull/103 that implements Barry's proposed 
format.

--

___
Python tracker 

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



[issue29546] A more helpful ImportError message

2017-02-14 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


--
pull_requests: +66

___
Python tracker 

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



[issue29546] A more helpful ImportError message

2017-02-14 Thread Matthias Bussonnier

Matthias Bussonnier added the comment:

I'm unsure I understand changing only the default __str__() method. You will 
anyway have to format the message differently depending on whether you raise 
from a from-import or a from-import-* or any other locations. 

AFAIU you "just" need the following 

  -PyErr_SetImportError(PyUnicode_FromFormat("cannot import name %R", 
name), pkgname, pkgpath);
  +PyErr_SetImportError(
  +PyUnicode_FromFormat("cannot import name %R from %R (%S)",
  +name, pkgname, pkgpath),
  +pkgname, pkgpath);

To use Barry format (though keeping quotes around identifiers to match current 
behavior).
(And similar if path is null). 

I'm unsure if you meant to provide a set of "format-template" to ImportError 
that are guarantied to be called with format(name=..., path=...) but I doubt it.

--

___
Python tracker 

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



[issue29546] A more helpful ImportError message

2017-02-14 Thread Brett Cannon

Brett Cannon added the comment:

Thanks to Matthias' PR the information is all there in the exception, but the 
message has not been changed. One idea for this -- depending on how much C code 
you want to write -- is to provide a default message for __str__() that changes 
depending on whether 'path' and/or 'name' are set. Then you can just set the 
attributes in the __init__() and have __str__() take care of providing a common 
message format. Another option is to do all of that in the __init__() so that 
BaseException.args continues to have the full error message (but that is added 
overhead if the __str__() is never taken of the exception). I also have no clue 
how much C code this would take :) (This is all why I have toyed with the idea 
of re-implementing the exceptions in Python for easier customization.)

--

___
Python tracker 

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



[issue29546] A more helpful ImportError message

2017-02-14 Thread Brett Cannon

Brett Cannon added the comment:


New changeset bc4bed440504597cac47d0a215ee094bfa99ba7e by Brett Cannon in 
branch 'master':
bpo-29546: Set 'path' on ImportError for ``from ... import ...`` (GH-91)
https://github.com/python/cpython/commit/bc4bed440504597cac47d0a215ee094bfa99ba7e


--

___
Python tracker 

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



Re: WANT: bad code in python (for refactoring example)

2017-02-14 Thread Irmen de Jong
On 14-2-2017 23:44, Makoto Kuwata wrote:
> Hi,
> 
> Is there any *just right* python code to refactor?
> In other words, I'm finding bad code example in python.
> 
> (background)
> I'm teaching Python to some novice programmer, and
> want to show refactoring example to them.
> 
> (required)
> * not good code
> * not too large (for novice programmer)
> * not too complex (for novice programmer)
> * released under open source license
> 
> If you know good material in github or bitbucket to refactor,
> let me know it.
> 
> --
> regards,
> kwatch
> 


No code in text form, but I find the following video by Raymond Hettinger very 
clear
about the values of refactoring otherwise seemingly fine code

https://youtu.be/wf-BqAjZb8M?t=12m39s

code starts at 12 min. 40 sec.

It does require a bit of background knowledge about Python and the PEP8 code 
style and
API design.

Irmen

-- 
https://mail.python.org/mailman/listinfo/python-list


WANT: bad code in python (for refactoring example)

2017-02-14 Thread Makoto Kuwata
Hi,

Is there any *just right* python code to refactor?
In other words, I'm finding bad code example in python.

(background)
I'm teaching Python to some novice programmer, and
want to show refactoring example to them.

(required)
* not good code
* not too large (for novice programmer)
* not too complex (for novice programmer)
* released under open source license

If you know good material in github or bitbucket to refactor,
let me know it.

--
regards,
kwatch
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29557] binhex documentation claims unknown bug

2017-02-14 Thread Berker Peksag

Changes by Berker Peksag :


--
stage:  -> patch review
type:  -> behavior
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue29557] binhex documentation claims unknown bug

2017-02-14 Thread Berker Peksag

Berker Peksag added the comment:


New changeset 6de2b7817fa9403e81dc38f13f3690f0bbf3d064 by Berker Peksag in 
branch 'master':
bpo-29557: Remove ambiguous line in binhex docs (#90)
https://github.com/python/cpython/commit/6de2b7817fa9403e81dc38f13f3690f0bbf3d064


--
nosy: +berker.peksag

___
Python tracker 

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



[issue29546] A more helpful ImportError message

2017-02-14 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


--
pull_requests: +62

___
Python tracker 

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



[issue29546] A more helpful ImportError message

2017-02-14 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


--
pull_requests: +62, 63, 64

___
Python tracker 

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



[issue29546] A more helpful ImportError message

2017-02-14 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


--
pull_requests: +62, 63

___
Python tracker 

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



[issue29558] Provide run_until_complete inside loop

2017-02-14 Thread Martin Panter

Martin Panter added the comment:

Sounds related to Issue 22239

--
nosy: +martin.panter

___
Python tracker 

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



[issue29561] Interactive mode gives sys.ps2 not sys.ps1 after comment-only line

2017-02-14 Thread Jim DeLaHunt

New submission from Jim DeLaHunt:

When you run the Python interpreter in interactive mode, get a sys.ps1 prompt 
(`...`), and type a comment-only or white-space-only line, the interpreter 
responds with a sys.ps2 prompt (`...`), instead of a sys.ps1 prompt. This seems 
wrong.

For example: 

% ./python.exe 
Python 3.7.0a0 (default, Feb 13 2017, 16:27:07) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> # comment-only<<-- line A
...   <<-- line B
>>>   <<-- line C 
>>>   <<-- line D 

Line A is a comment-only line entered by the user. The interpreter responds 
with the sys.ps2 prompt (`...`), in line B. Line C is a null line (user enters 
only the Enter key, nothing else). The interpreter responds with a sys.ps1 
prompt (`...`).  

If user enters a white-space-only line at a sys.ps1 prompt, the interpreter 
responds the same as if it were a comment-only line, with a sys.ps2 prompt 
(line B).

The expected expected interpreter behaviour in response to a  comment-only line 
or a white-space-only line, not in the midst of a compound statement, is that 
it be the same as to a null line, with a sys.ps1 prompt. 

In the context of a compound statement, the expected interpreter behaviour is 
that a comment-only line or a white-space-only line continue the compound 
statement. Entering a null line in a compound statement ends the compound 
statement.

Another way to phrase it: the expected interpreter behaviour is that a 
comment-only line or white-space-only line not change the interpreter prompt: 
if it was sys.ps1, it remains so; if it was sys.ps2, it remains so.

I have reproduced this behaviour on my build of cpython 3.7.a0, python 3.6 from 
MacPorts, python 2.7 from MacPorts, all on Mac OS X.  I see the same behaviour 
in the interactive shell at python.org/shell .

This makes me suspect that the Python design says my expectations are wrong. In 
that case, the current behaviour certainly is surprising. It should be 
documented.  I haven't found such documentation yet.

--
components: Interpreter Core
messages: 287799
nosy: JDLH
priority: normal
severity: normal
status: open
title: Interactive mode gives sys.ps2 not sys.ps1 after comment-only line
type: behavior
versions: Python 2.7, Python 3.5, 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



[issue28695] Add SSL_CTX_set_client_cert_engine

2017-02-14 Thread Gennady Kovalev

Gennady Kovalev added the comment:

Ok, thank you.

--

___
Python tracker 

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



[issue28695] Add SSL_CTX_set_client_cert_engine

2017-02-14 Thread Christian Heimes

Christian Heimes added the comment:

I haven't started to design the new feature yet. Since it is going to be a new 
feature and feature freeze of 3.7 is 2018-01-29, I'm going to start working on 
new stuff around in April or May for PyCon.

--

___
Python tracker 

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



[issue10746] ctypes c_long & c_bool have incorrect PEP-3118 type codes

2017-02-14 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue28695] Add SSL_CTX_set_client_cert_engine

2017-02-14 Thread Gennady Kovalev

Gennady Kovalev added the comment:

Is there any news?

--

___
Python tracker 

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



[issue11165] Document PyEval_Call* functions

2017-02-14 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue10746] ctypes c_long & c_bool have incorrect PEP-3118 type codes

2017-02-14 Thread Pauli Virtanen

Pauli Virtanen added the comment:

Converted patch to Github PR + some cleanup.

--
pull_requests: +61

___
Python tracker 

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



[issue29560] Turtle graphics fill behavior differs between versions

2017-02-14 Thread John Simmons

New submission from John Simmons:

When I run the demo program on the library 24.1 documentation page to draw the 
star, it colors the entire star yellow, not just the parts that are show yellow 
on the page.  This appears to be a behavior change.  This is running on a 
Windows 7 or 10 machine with Python 3.2, 3.5, or 3.6.

I have not tried this program at home, but when I run a similar program that 
draws and then fills 10 overlapping circles, my Linux Mint 17.3 computer at 
home, running IDLE in Python 3.4, fills the "interior" points inside and odd 
number of circles but does not fill the "exterior" points inside an even number 
of circles.  This appears to be the behavior shown on documentation page 24.1.  
I would like to know what is intended to be the correct behavior and why the 
implementations differ.

--
components: Tkinter
messages: 287794
nosy: John Simmons
priority: normal
severity: normal
status: open
title: Turtle graphics fill behavior differs between versions
type: behavior
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue29534] _decimal difference with _pydecimal

2017-02-14 Thread Mark Dickinson

Mark Dickinson added the comment:

All done. Closing. (In theory, as a bugfix, this could be backported to 3.5 and 
3.6. In practice, I doubt it's worth the effort.)

--
resolution:  -> fixed
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



[issue29534] _decimal difference with _pydecimal

2017-02-14 Thread Mark Dickinson

Mark Dickinson added the comment:


New changeset 996c3874fdbc91d29f0a06b37043f62cf4ead6cb by GitHub in branch 
'master':
Issue #29534: move Misc/NEWS entry to correct section; add Misc/ACS entry for 
Andrew Nester. (#99)
https://github.com/python/cpython/commit/996c3874fdbc91d29f0a06b37043f62cf4ead6cb


--

___
Python tracker 

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



[issue6143] IDLE - an extension to clear the shell window

2017-02-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Alwx, please do not change the headers.  IDLE menu commands cannot be invoked 
from a program.

--
type: resource usage -> behavior
versions: +Python 3.6, Python 3.7 -Python 2.7

___
Python tracker 

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



[issue29534] _decimal difference with _pydecimal

2017-02-14 Thread Mark Dickinson

Mark Dickinson added the comment:

PR to fix the Misc/NEWS entry: https://github.com/python/cpython/pull/99

--

___
Python tracker 

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



[issue29559] Detect mouse over lines on canvas while mouse button is down

2017-02-14 Thread Ted Shaneyfelt

New submission from Ted Shaneyfelt:

There way mouse captures are done, mouse-over events seem to be disabled while 
dragging. 

This makes it difficult to provides hints as feedback, and more complicated 
than it should be to detect when dropping over a particular line object. 

Tk may not directly support it, but is there any way of getting into its guts 
to provide an option to re-enable mouse-over events while dragging? Or even 
providing a tuple with the pending mouse-overs upon release? or perhaps even 
simulate a mouse-up-mouse-down sequence to allow the events to propagate 
through and consume the noise within tkinter? Or even detect that there is a 
pending mouseover waiting for the mouseup event and delivering it along with 
the mouseup or notifying within the event that there is one pending?

--
components: Tkinter
messages: 287789
nosy: Ted Shaneyfelt2
priority: normal
severity: normal
status: open
title: Detect mouse over lines on canvas while mouse button is down
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue29534] _decimal difference with _pydecimal

2017-02-14 Thread Mark Dickinson

Mark Dickinson added the comment:

PR merged; thank you!

Unfortunately, just after I merged it I noticed that the Misc/NEWS entry was in 
the wrong section. I'll make a new PR to fix that, and close this issue once 
it's done.

--

___
Python tracker 

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



[issue29534] _decimal difference with _pydecimal

2017-02-14 Thread Mark Dickinson

Mark Dickinson added the comment:


New changeset 6d1dece06d13a7d40637e07b2c79f34aab368766 by Mark Dickinson in 
branch 'master':
Fixed #29534 - _decimal difference with _pydecimal (#65)
https://github.com/python/cpython/commit/6d1dece06d13a7d40637e07b2c79f34aab368766


--

___
Python tracker 

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



Re: Doubt with files

2017-02-14 Thread Peter Pearson
On Tue, 14 Feb 2017 09:13:48 -0800 (PST), José Manuel Suárez Sierra wrote:
> hello,
> im trying to read a rtf or txt file with this python script:
>
> with open(dirFichero,'r') as reader:
> for line in reader:
> print line
>
> the problem is that shown is :   [suppressing blank lines]
>
> {\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf810
> {\fonttbl\f0\fswiss\fcharset0 Helvetica;}
> {\colortbl;\red255\green255\blue255;}
> {\*\expandedcolortbl;;}
> \paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
> \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx [snip]
> \f0\fs24 \cf0 1l2m,1svo,1lme}
>
> INSTEAD of:
> 1l2m,1svo,1lme
>
> How could I fix it?

An RTF file *is* a text file, with formatting information inserted as
text strings.  Your program is reading and printing an RTF file.  If
all you want is the part of the file's content that will be visible
when it has been rendered into graphics, you'll need to convert the file
from RTF to "plain" text at some point.  I'd do that with LibreOffice.
Alternativey, I see that there's a PyRTF package that might do what
you want from within your Python program.

-- 
To email me, substitute nowhere->runbox, invalid->com.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29540] Add compact=True flag to json.dump/dumps

2017-02-14 Thread Brett Cannon

Brett Cannon added the comment:

I'm a little confused as the PR proposes a COMPACT constant for the module but 
the issue proposes a new compact argument. Which are we actively considering?

--

___
Python tracker 

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



Re: Doubt with files

2017-02-14 Thread boB Stepp
On Tue, Feb 14, 2017 at 11:31 AM, Joaquin Alzola
 wrote:
>
>>with open(dirFichero,'r') as reader:
>  >   for line in reader:
>  >   print line
>>
>>the problem is that shown is :
>>{\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf810
>>{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
>>{\colortbl;\red255\green255\blue255;}
>>{\*\expandedcolortbl;;}
>>\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
>>\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
>>
>>\f0\fs24 \cf0 1l2m,1svo,1lme}
>>
>>INSTEAD of:
>>1l2m,1svo,1lme
>>
>>How could I fix it?
>
> I do not know exactly what encoding rtf or the txt file has but you can use:
>
> with open(dirFichero,'r',encoding='utf-8') as reader:

This won't work.  It will still display the rtf format coding, which
the OP apparently does not want.


-- 
boB
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Doubt with files

2017-02-14 Thread boB Stepp
On Tue, Feb 14, 2017 at 11:13 AM, José Manuel Suárez Sierra
 wrote:
> hello,
> im trying to read a rtf or txt file with this python script:
>
> with open(dirFichero,'r') as reader:
> for line in reader:
> print line
>
> the problem is that shown is :
>
> {\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf810
>
> {\fonttbl\f0\fswiss\fcharset0 Helvetica;}
>
> {\colortbl;\red255\green255\blue255;}
>
> {\*\expandedcolortbl;;}
>
> \paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
>
> \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
>
>
>
> \f0\fs24 \cf0 1l2m,1svo,1lme}
>
>
> INSTEAD of:
> 1l2m,1svo,1lme
>
> How could I fix it?

Your program seems to be faithfully printing out the contents of your
rtf file as a txt file, showing all of the rtf formatting code.  If
you want a different result, I suggest you search online for something
like:  python read write rtf


-- 
boB
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue19675] Pool dies with excessive workers, but does not cleanup

2017-02-14 Thread Dustin Oprea

Dustin Oprea added the comment:

I don't think this can be tested. Throwing exceptions in the remote process 
causes exceptions that can't be caught in the same way (when the initializer 
fails the pool just attempts to recreate the process over and over) and I don't 
think it'd be acceptable to try to spawn too many processes in order to induce 
the original problem. There's not a lot of surface area to what we've doing 
here. We can't simulate failures any other way.

Can I get an agreement on this from someone?

--
pull_requests: +60

___
Python tracker 

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



RE: Doubt with files

2017-02-14 Thread Joaquin Alzola

>with open(dirFichero,'r') as reader:
 >   for line in reader:
 >   print line
>
>the problem is that shown is :
>{\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf810
>{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
>{\colortbl;\red255\green255\blue255;}
>{\*\expandedcolortbl;;}
>\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
>\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
>
>\f0\fs24 \cf0 1l2m,1svo,1lme}
>
>INSTEAD of:
>1l2m,1svo,1lme
>
>How could I fix it?

I do not know exactly what encoding rtf or the txt file has but you can use:

with open(dirFichero,'r',encoding='utf-8') as reader:
This email is confidential and may be subject to privilege. If you are not the 
intended recipient, please do not copy or disclose its content but contact the 
sender immediately upon receipt.
-- 
https://mail.python.org/mailman/listinfo/python-list


Doubt with files

2017-02-14 Thread José Manuel Suárez Sierra
hello,
im trying to read a rtf or txt file with this python script:

with open(dirFichero,'r') as reader:
for line in reader:
print line

the problem is that shown is :

{\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf810

{\fonttbl\f0\fswiss\fcharset0 Helvetica;}

{\colortbl;\red255\green255\blue255;}

{\*\expandedcolortbl;;}

\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0

\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0



\f0\fs24 \cf0 1l2m,1svo,1lme}


INSTEAD of:
1l2m,1svo,1lme

How could I fix it?

THANK YOU
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29558] Provide run_until_complete inside loop

2017-02-14 Thread Javier Domingo

New submission from Javier Domingo:

The current architecture of asyncio makes it really hard to combine both async 
and sync code.

When porting a Thread based application to asyncio, the first step is usually 
to start merging threads to the main loop, by using `run_coroutine_threadsafe`. 
This works well and allows to use a single ioloop from different threads.

There is another step, that usually involves the patching of libraries to work 
in an async way. One will typically patch the IO calls to be asyncio, and using 
`run_until_complete` proves useful in these situations.

However, at the moment it's not possible to `run_until_complete` from an 
ioloop. The possibility to be able to patch sync libraries to run in asyncio is 
something that would help a lot the migration.

This functionality would basically provide a way to continue running the ioloop 
until the future is resolved.

Sync code -> async code -> Sync code -> Async code

If you know how to have this without spawning an executor, that would be good 
too, in such case I would rather ask for documentation on how to do it =)

--
components: asyncio
messages: 287784
nosy: gvanrossum, txomon, yselivanov
priority: normal
severity: normal
status: open
title: Provide run_until_complete inside loop
type: enhancement
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



[issue29556] Remove unused #include

2017-02-14 Thread Chi Hsuan Yen

Changes by Chi Hsuan Yen :


--
title: Remove an unused #include from bltinmodule.c -> Remove unused #include 


___
Python tracker 

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



[issue29387] Tabs vs spaces FAQ out of date

2017-02-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 38c8354f3204441f6c6bd22213b449d2d8954fcc by GitHub in branch 
'3.5':
bpo-29521 Fix two minor documentation build warnings (#41) (#84)
https://github.com/python/cpython/commit/38c8354f3204441f6c6bd22213b449d2d8954fcc


--
nosy: +Mariatta

___
Python tracker 

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



memory access ordering between processes in python 3.6

2017-02-14 Thread c . curtit
Hi everyone,

I'm looking at building an application that allows lockless interprocess data 
passing using a ring buffer style (sorta) shared memory zone.

My initial plan is to create a shared memory zone (probably using C functions 
thru ctypes), then write data to it with a writer process, then the reader 
process comes to read that data in its own time.

Basically the zone is read/written using ctypes or memoryview objects. The zone 
(say 1GB) is split in many small buckets approx 10k in size. Each bucket has a 
flag either showing 0 (free) or 1 (needs reading) in a header. The flag is 
reset by the reader when done. and is set by the writer once the full bucket 
has been written to memory and is ready to be read.

I know I have to be carefull to make sure writes appear in the proper order to 
the reader process (that is : data writen by the writer needs to appear before 
the flag is set by the writter process, from the point of view of the reader 
process, which is absolutely not a given on modern cpu).

So questions :

*does python takes care of that automagically, and that's why I havn't found 
anything on the subject while googling ? (I imagine that within one single 
multithreaded process the GIL does that neatly, but what of multiprocess 
applications ?)

*or is there a native mechanism or module that allows to play with memory 
barriers like C does allow one to 
(https://www.kernel.org/doc/Documentation/memory-barriers.txt).

* or do I have to write my own shims to C functions wrapping C/asm memory 
barrier instructions ? (sounds lighter weight than pulling in the various 
python asm modules I have around)

Any answers much appreciated. Please don't :

* tell me to use message queues (that works with some trickery, it's not the 
purpose of this question)
* tell me to use array from the the multiprocessing module, or the data proxy 
classes (or explain me if the locking scheme in that context can be lockless :) 
)

Cheers !
Charlie
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29553] Argparser does not display closing parentheses in nested mutex groups

2017-02-14 Thread Christoph Stahl

Changes by Christoph Stahl :


--
type:  -> behavior

___
Python tracker 

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



[issue29556] Remove an unused #include from bltinmodule.c

2017-02-14 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Hmmm, seems there are more redundant #include ; let me check one by 
one

--

___
Python tracker 

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



[issue29557] binhex documentation claims unknown bug

2017-02-14 Thread David Wilemski

New submission from David Wilemski:

The binhex documentation has a line in it that says "As of this writing, 
hexbin() appears to not work in all cases."

This is a bit ambiguous and there is no context for what the bug may be. It 
appears this line is from the first commit to the hexbin function's 
documentation in 1995 (https://hg.python.org/cpython/rev/3911d4a89ab0#l4.40) 
but the commit also has no information about what this bug may be. I also see 
no current open bugs for the binhex module that seem related.

In 2009, there was a patch for the hexbin function but I have no idea if this 
is the bug from the original documentation or if it was something else 
entirely: https://bugs.python.org/issue6369

Given this, I believe the line should be removed unless more details about the 
referenced buggy behavior can be found.

--
assignee: docs@python
components: Documentation
messages: 287781
nosy: David Wilemski, docs@python
priority: normal
pull_requests: 59
severity: normal
status: open
title: binhex documentation claims unknown bug
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



[issue29556] Remove an unused #include from bltinmodule.c

2017-02-14 Thread Chi Hsuan Yen

Changes by Chi Hsuan Yen :


--
pull_requests: +58

___
Python tracker 

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



[issue29556] Remove an unused #include from bltinmodule.c

2017-02-14 Thread Chi Hsuan Yen

New submission from Chi Hsuan Yen:

This #include is added in b744ba1d14c5487576c95d0311e357b707600b47 (issue8610) 
and later the use of CODESET is removed in 
d64e8a75e5138d5e5970f0c70995ae5cc377c421 (issue9642).

Found this in investigating issue29436

Add haypo as both commit is written by you

--
components: Build
messages: 287780
nosy: Chi Hsuan Yen, haypo
priority: normal
severity: normal
status: open
title: Remove an unused #include from bltinmodule.c
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



[issue29555] Update Python Software Foundation Copyright Year

2017-02-14 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
nosy: +lemburg

___
Python tracker 

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



[issue29555] Update Python Software Foundation Copyright Year

2017-02-14 Thread Senthil Kumaran

New submission from Senthil Kumaran:

In the attached patch, I updated the copyright year to 2017 at places it was 
mentioned until 2016.

There was a suggestion that we remove the copyright line of Python Software 
Foundation from module headers since the code is already covered 1) by top 
level copyright mention, 2) The mention of copyright is inconsistent in 
modules, 3) will avoid unnecessary churn every year. 

This idea needs to be vetted by PSF Board and legal staff.

--
files: pr-4.diff
keywords: patch
messages: 287779
nosy: orsenthil
priority: normal
severity: normal
status: open
title: Update Python Software Foundation Copyright Year
versions: Python 2.7, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46638/pr-4.diff

___
Python tracker 

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



[issue29554] profile/pstat doc clariification

2017-02-14 Thread Matthias Bussonnier

New submission from Matthias Bussonnier:

profile .rst say:

> Each restriction is either an integer (to select a count of lines), or a 
> decimal fraction between 0.0 and 1.0 inclusive (to select a percentage of 
> lines), **or a regular expression**

Actually it accept a string that will be compiled to a regex.

Profile.py also mention:

> (i.e., in addition to the old -1, 0, 1, or 2)

Which is not really helpful, to newcomers to Python who do not know what these 
are meant to be. Either explaining (or removing if considered old behavior that 
should be stopped) seem to be better alternative.

See https://github.com/python/cpython/pull/88

--
assignee: docs@python
components: Documentation
messages: 287778
nosy: docs@python, mbussonn
priority: normal
severity: normal
status: open
title: profile/pstat doc clariification
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



[issue29548] deprecate PyEval_Call*() functions.

2017-02-14 Thread INADA Naoki

INADA Naoki added the comment:

I stopped deprecating PyEval_Call APIs, and removing it's usage in PR 75.

Summary of current pull requests:

PR 87 contains fix regression of PyEval_CallObjectWithKeywords for Python 3.6.

PR 75 is for master branch.  It contains fix same to PR 87. Additionally, 
PyEval_CallFunction and PyEval_CallMethod is now copy of PyObject_CallFunction 
and PyObject_CallMethod.  And comment about PyObject_Call preference is added.

--

___
Python tracker 

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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2017-02-14 Thread Christoph Stahl

New submission from Christoph Stahl:

When creating nested mutually exclusive groups, all closing brackets except one 
are omitted.

Example:
parser = ArgumentParser()
group = parser.add_mutually_exclusive_group()
group.add_argument('-a')
group.add_argument('-b')
group2 = group.add_mutually_exclusive_group()
group2.add_argument('-c')
group2.add_argument('-d')
group3 = group2.add_mutually_exclusive_group()
group3.add_argument('-e')
group3.add_argument('-f')

prints a usage line of:
usage: test.py [-h] [-a A | -b B | [-c C | -d D | [-e E | -f F]

it should print something like:
usage: test.py [-h] [-a A | -b B | [-c C | -d D | [-e E | -f F]]]

--
components: Library (Lib)
messages: 287776
nosy: christofsteel
priority: normal
severity: normal
status: open
title: Argparser does not display closing parentheses in nested mutex groups
versions: Python 2.7, Python 3.6

___
Python tracker 

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



[issue29548] deprecate PyEval_Call*() functions.

2017-02-14 Thread STINNER Victor

STINNER Victor added the comment:

> So they are part of stable ABI.  We can't remove them until Python 4.

Please just stop right now using "Python 4" as the starting point to
break -again- the Python world.

If you plan to remove the function, plan it right now with versions
like "in 2 cycles".

If the function is part of the stable ABI, we simply cannot remove it.
Since these functions are used outside CPython and they are part of
the stable ABI, I'm not sure anymore that there is any value to remove
them.

Maybe just document them and write "please don't use them", but don't
deprecate the functions.

--

___
Python tracker 

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



[issue29540] Add compact=True flag to json.dump/dumps

2017-02-14 Thread STINNER Victor

STINNER Victor added the comment:

"Add compact=True flag to json.dump/dumps"

Oh, fun, I implemented exactly this option in my perf project. Extract:

def dump(data, fp, compact):
kw = {}
if compact:
kw['separators'] = (',', ':')
else:
kw['indent'] = 4
json.dump(data, fp, sort_keys=True, **kw)

So I like the idea of moving the compact=True feature directly into the json 
module ;-)

(I don't propose to change the default to indent=4, that's a personal choice 
;-))

--
nosy: +haypo

___
Python tracker 

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



[issue29540] Add compact=True flag to json.dump/dumps

2017-02-14 Thread Berker Peksag

Berker Peksag added the comment:

I'm +1 on the idea. Currently, a user needs to find this information in a wall 
of text: "To get the most compact JSON representation, you should specify (',', 
':') to eliminate whitespace." It's easy to miss the lack of trailing space in 
(',', ':').

Perhaps the constant name could be changed to something more descriptive, but I 
don't have a better suggestion at the moment.

(Adding Brett since he also reviewed the PR.)

--
nosy: +berker.peksag, brett.cannon
stage:  -> patch review

___
Python tracker 

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



ANN: poliastro 0.6 released

2017-02-14 Thread Juan Luis Cano

Hi all,

I am very pleased to announce poliastro 0.6.0, a MIT licensed, pure 
Python library for studying Orbital Mechanics and Astrodynamics problems!


This is a new major release, focused on refactoring some internal core 
parts and improving the propagation functionality. Among the new 
features are:


* Support for Python 3.6.
* Allow propagation functions to receive a callback
* New Orbit objects that supersede the State API.

See the changelog for a more complete list of changes:

http://poliastro.readthedocs.io/en/v0.6.0/changelog.html#new-in-poliastro-0-6-0

You can install poliastro using either pip or conda:

   $ pip install poliastro

   $ conda install poliastro --channel conda-forge

And cite it using this DOI:

https://doi.org/10.5281/zenodo.290596

If you want to see an overview of poliastro capabilities, check out the 
gallery of Jupyter notebooks where we list some specific applications 
and interesting problems analyzed with this library:


http://nbviewer.jupyter.org/github/poliastro/poliastro/blob/v0.6.0/index.ipynb

And if you prefer video format, don't miss the recording of my talk on 
EuroPython 2016:


https://youtu.be/VCpTgU1pb5k

This release is probably the last one I'm going to make as an "almost 
aerospace engineer", so wish me luck for my MSc final project :) You can 
check its progress here:


https://github.com/Juanlu001/pfc-uc3m

poliastro is an open source collection of Python subroutines for solving 
problems in Astrodynamics and Orbital Mechanics. It combines cutting 
edge technologies like Python JIT compiling (using numba) with young, 
well developed astronomy packages (like astropy and jplephem) to provide 
a user friendly API for solving Astrodynamics problems. It is therefore 
an experiment to mix the best Python open source practices with my love 
for Orbital Mechanics.


The project is still a work in progress and the API is subject to 
change. Contributions, bug reports, suggestions and advice are more than 
welcome! If you are willing to help, please join our mailing list on 
groups.io:


https://groups.io/g/poliastro-dev

/Per Python ad Astra!

/Juan Luis Cano Rodríguez

--
https://mail.python.org/mailman/listinfo/python-announce-list

   Support the Python Software Foundation:
   http://www.python.org/psf/donations/


ANN: PISI development branch

2017-02-14 Thread examachine
PISI is an efficient, compact, feature-rich package manager written in Python.

You may find the sources of the revived original development branch of PISI on 
github: 

   https://github.com/examachine/pisi

The current revision is 1.1_beta12. I uploaded this revision from my local 
subversion working copies, it belongs to the last development branch that I 
maintained in Pardus Linux project. You may see the details about this branch 
for yourself:

$ svn info .
Path: .
Working Copy Root Path: /Volumes/Centauri/Users/malfunct/Code/projects/pisi-svn
URL: https://svn.uludag.org.tr/uludag/trunk/pisi
Repository Root: https://svn.uludag.org.tr/uludag
Repository UUID: 26e1f6f6-46e4-0310-a0b7-a8a415fd4c45
Revision: 8647
Node Kind: directory
Schedule: normal
Last Changed Author: caglar
Last Changed Rev: 8644
Last Changed Date: 2006-07-07 16:45:27 +0400 (Fri, 07 Jul 2006)

Since the PISI based Pardus project has officially ended, the development 
branch will likely remove Pardus dependencies (at least not make them 
mandatory), and continue as a next-generation portable package manager. That 
is, I will make it work on systems without other Pardus tools. I might use this 
to maintain an OS distribution for my AI startup. There are interesting 
platforms considered that might be useful.

Another objective is to fork one of the existing PISI based distributions, and 
make a brand new distribution. I just forked the latest official Pardus Linux 
repo on github.

My vision for PISI was way beyond Pardus, I thought I would have a reason to 
write more code if I worked towards that direction. Since I'm a parallel 
computing researcher, I might wish to make a distro to ease cluster 
installation for instance. Pardus did not go much beyond a basic KDE desktop 
distro and a server distro. There might be many variations as is the case with 
debian, and its derivative ubuntu. A PISI/debconf hybrid, or a configuration 
tool that is good enough to replace debconf would also be useful.

Eray Özkural, PhD
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[Release] Pyo 0.8.2 (Python dsp library)

2017-02-14 Thread Olivier Bélanger
Hello all,

I'm glad to announce the release of pyo 0.8.3, available for python 2.7 and 3.5.

Pyo is a Python module written in C to help real-time digital signal processing
script creation. It is available for Windows, macOS and linux. It is released
under the LGPL 3 license.

For more info, downloads and other links, see the official web site:

http://ajaxsoundstudio.com/software/pyo/

The documentation:

http://ajaxsoundstudio.com/pyodoc/

For the latest sources and bug tracker:

https://github.com/belangeo/pyo

What's new:

New objects:
- SharedTable, an inter-process shared memory table (unix only).
- Particle2, An even more full control granular synthesis generator.
- TableFill, continuously fills a table with incoming samples.
- TableScan, Reads the content of a table in loop, without interpolation.
- MidiDispatcher, self-contained midi dispatcher thread.

Changes & bug fixes:
- Jack ports activation and auto-connection now happen in the boot process.
- Added "onlyonce" argument to Seq and Beat objects.
- Seq now accepts floating-point values as time units.
- Added "maxwindow" argument to TableWrite. This is the maximum number
of samples over which the object is allowed to interpolate. Useful to
avoid interpolation over the entire table when using a circular
writing pointer.
- Added "shape" argument to PVAmpMod and PVFreqMod objects. This
allows to change the modulation oscillator's waveform.
- Added setGlobalDur, setGlobalDel, getGlobalDur and getGlobalDel
methods to the Server object. These methods allow the user to manage
the start time and duration of audio objects globally.
- Fader and Adsr now start a new envelope from the current amplitude
value if the previous ramp has not finished yet.

Olivier Belanger
belan...@gmail.com
http://olivier.ajaxsoundstudio.com/



P>http://ajaxsoundstudio.com/software/pyo/;>Pyo 0.8.3
Python DSP library. (13-Feb-17)
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[issue29552] Issue in Dictionary fromkeys

2017-02-14 Thread Prudvi Mangadu

Prudvi Mangadu added the comment:

Thanks Martin , I will close it.

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



[issue29552] Issue in Dictionary fromkeys

2017-02-14 Thread Martin Panter

Martin Panter added the comment:

I suggest to close this as not a bug.

--
resolution:  -> not a bug

___
Python tracker 

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



[issue29552] Issue in Dictionary fromkeys

2017-02-14 Thread Martin Panter

Martin Panter added the comment:

This is similar to the problem of building a list by repeating one item: 
.

With dict.fromkeys(), the resulting dictionary maps each specified key object 
to the one and only value object (empty list) you passed to fromkeys(). If you 
look up one of the keys, it returns the list object. If you modify that object, 
all references to that object will see the update.

The difference with the dictionary comprehension workaround is that the 
interpreter executes the expressions “D_IP” and “[]” once for each iteration of 
“input”, resulting in a new empty list instance each iteration. But when you 
call fromkeys(), you pass a single object. The fromkeys() method just copies 
references; it does not create objects itself.

If the id() function returns the same identity, it means you have two 
references to the same underlying object instance. This is the same as checking 
“result['1'] is result['2']”.

--
nosy: +martin.panter

___
Python tracker 

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



[issue29548] deprecate PyEval_Call*() functions.

2017-02-14 Thread INADA Naoki

INADA Naoki added the comment:

> I would suggest to deprecate PyEval_Call*() functions first only in the 
> documentation. In 3.8 or 3.9 add the Py_DEPRECATED attribute.


 doesn't excluded by PEP 384.
And these 3 functions and 1 macro is outside of "#ifndef Py_LIMITED_API" check.
So they are part of stable ABI.  We can't remove them until Python 4.
No reason to hurry up.

I'll remove Py_DEPRECATED for Python 3.7.

--

___
Python tracker 

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



[issue29548] deprecate PyEval_Call*() functions.

2017-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Any idea of the popularity of the undocumented PyEval_xxx() functions?

You can just search code at GitHub.

I would suggest to deprecate PyEval_Call*() functions first only in the 
documentation. In 3.8 or 3.9 add the Py_DEPRECATED attribute.

--

___
Python tracker 

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



[issue29548] deprecate PyEval_Call*() functions.

2017-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

PyEval_CallObject() was added at Jan 12 1995 (05360cd616ae). 
PyObject_CallObject(), PyObject_CallFunction() and PyObject_CallMethod() were 
added with Include/abstract.h at Jul 18 1995 (d5398acafa2c) and implemented in 
terms of PyEval_CallObject(). PyEval_CallObjectWithKeywords() was added few 
minutes later (0261bf5b3819). PyObject_Call() was added at Aug 02 2001 
(09df3254b49d) as a simple wrapper around tp_call. PyObject_CallFunction() and 
PyObject_CallMethod() were reimplemented in terms of PyObject_Call() at Aug 16 
2002 (255d1d3e66a3).

--

___
Python tracker 

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



[issue29548] deprecate PyEval_Call*() functions.

2017-02-14 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 14.02.2017 11:16, STINNER Victor wrote:
> 
>> Please note that the two sets of APIs are not identical, e.g. you cannot 
>> simply replace PyEval_CallObject() with PyObject_Call(), since the former 
>> applies a few extra checks and defaults, which the latter doesn't.
> 
> IMHO these checks are too expensive at runtime for little benefit. If you 
> pass non-tuple to PyObject_Call(), Python immediately crash. You are 
> immediately noticied of the bug :-) I don't think that such bugs are common 
> enough to justify the overhead.

>From the design of the abstract API layer, it is rather
uncommon to have these not do extra checks to prevent segfaults.
They were originally designed to be safe and developer friendly.

OTOH, the PyEval_* APIs were designed to be fast, only for people
who know what they are doing and for interpreter internals.

Historically, this design approach appears to have been swapped
somewhere between Python 2.1 and 2.2 for the call APIs,
which is unfortunate.

So from a design perspective, it would be better to have the
abstract APIs again do proper checks and leave the low level,
"segfault protected" :-) call APIs around as PyEval_Call*()
or better yet: not make them public at all.

> Any idea of the popularity of the undocumented PyEval_xxx() functions? Are 
> they used by Cython for example? By a single random extension module in the 
> world?

Well, I know that our eGenix extensions are using them
and there are quite a few hits on github as well:

https://github.com/search?utf8=%E2%9C%93=PyEval_CallObjectWithKeywords=Code=searchresults

> I'm more in favor of modifying PyEval_xxx() to call PyObject_xxx() and 
> deprecate them.

--

___
Python tracker 

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



[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0

2017-02-14 Thread Christian Heimes

Christian Heimes added the comment:

Please also provide more information about your system: platform, distro, 
architecture, OpenSSL version, exact Python version etc.

--

___
Python tracker 

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



[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0

2017-02-14 Thread Christian Heimes

Christian Heimes added the comment:

Please install debug symbols and provide a proper C backtrace of the invalid 
free call. The backtrace in your first comment is missing both line numbers, 
file and function names.

--

___
Python tracker 

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



[issue29548] deprecate PyEval_Call*() functions.

2017-02-14 Thread INADA Naoki

INADA Naoki added the comment:

> I'm more in favor of modifying PyEval_xxx() to call PyObject_xxx() and 
> deprecate them.

That's PR 75 :)

--

___
Python tracker 

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



[issue29157] random.c: Prefer getrandom() over getentropy() to support glibc 2.24 on Linux

2017-02-14 Thread STINNER Victor

STINNER Victor added the comment:

Python 2.7, see issue #29188: "Backport random.c from Python 3.5 to Python 
2.7". Mercurial commit 13a39142c047, Git commit 
01bdbad3e951014c58581635b94b22868537901c.

https://github.com/python/cpython/commit/01bdbad3e951014c58581635b94b22868537901c

--

___
Python tracker 

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



[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0

2017-02-14 Thread STINNER Victor

STINNER Victor added the comment:

You now have to test "PYTHONMALLOC=malloc valgrind python3 ...".

IMHO it's not a bug in Python, but in your code ussing OpenSSL:

  File "/var/bluelabs/python/_cams_threaded_server.py", line 49 in sni_callback

--

___
Python tracker 

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



[issue29548] deprecate PyEval_Call*() functions.

2017-02-14 Thread STINNER Victor

STINNER Victor added the comment:

> Please note that the two sets of APIs are not identical, e.g. you cannot 
> simply replace PyEval_CallObject() with PyObject_Call(), since the former 
> applies a few extra checks and defaults, which the latter doesn't.

IMHO these checks are too expensive at runtime for little benefit. If you pass 
non-tuple to PyObject_Call(), Python immediately crash. You are immediately 
noticied of the bug :-) I don't think that such bugs are common enough to 
justify the overhead.

Any idea of the popularity of the undocumented PyEval_xxx() functions? Are they 
used by Cython for example? By a single random extension module in the world?

I'm more in favor of modifying PyEval_xxx() to call PyObject_xxx() and 
deprecate them.

--

___
Python tracker 

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



  1   2   >