[issue29438] SIGSEGV in PyObject_Malloc on python 3.6 and 3.7

2017-02-03 Thread INADA Naoki

INADA Naoki added the comment:

valgrind output is here.
https://gist.github.com/methane/3c010daba71a374fd0b6a41a0d98e3ff

It seems another bug relating to key-sharing dict...

--
nosy: +inada.naoki

___
Python tracker 

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



[issue13196] subprocess: undocumented if shell=True is necessary to find executable in Windows PATH

2017-02-03 Thread Martin Panter

Martin Panter added the comment:

It is hard to make sense of this without decoding your URLs, downloading the 
repository and finding the relevant commit. Anyway, what you have posted sounds 
like a duplicate of Issue 8557.

--
nosy: +martin.panter
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> subprocess PATH semantics and portability

___
Python tracker 

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



[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-03 Thread Xiang Zhang

Changes by Xiang Zhang :


--
stage: patch review -> commit review

___
Python tracker 

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



[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-03 Thread Milt Epstein

Milt Epstein added the comment:

That's right, with 11 lines in the sample data, total will become 20 on the 
second iteration.  And that throws off some of the computations done in that 
function.

Your patch looks good, in that it will achieve what I'm requesting.  But :-), 
your pointing out that other redundant min() made me take a closer look at the 
code, and led me to produce the attached patch as an alternate suggestion.  I 
think it makes the code a bit more sensible and cleaner.  Please review, and go 
with what you think best.

Thanks.

--
Added file: http://bugs.python.org/file46512/csv.py.patch

___
Python tracker 

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



[issue29442] Use argparse and drop dirty optparse hacks in setup.py

2017-02-03 Thread Chi Hsuan Yen

New submission from Chi Hsuan Yen:

The change is clear and self-explained. See the patch.

Motivations:

1. The hack "To prevent optparse from raising an exception..." works for single 
letter flags (-I, -L, etc.) only. I plan to add --sysroot related codes for 
Android builds and I don't want more hacks. Apparently argparse does not need 
this hack as it can parse all known flags before throwing an error
2. optparse is deprecated

Add the developer that introduced this hack. Also Serhiy, who sseems interested 
in removing optparse from the code base. (issue18973, issue18971)

--
components: Build
files: setup-argparse.patch
keywords: patch
messages: 286922
nosy: Chi Hsuan Yen, brett.cannon, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Use argparse and drop dirty optparse hacks in setup.py
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file46511/setup-argparse.patch

___
Python tracker 

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



[issue18069] Subprocess searches special directories before PATH on Windows

2017-02-03 Thread Martin Panter

Changes by Martin Panter :


--
title: Subprocess picks the wrong executable on Windows -> Subprocess searches 
special directories before PATH on Windows

___
Python tracker 

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



[issue29411] Option --executable for entry_points

2017-02-03 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report, Michal. Note that both [1] and [2] point to the same 
patch. Perhaps you meant to paste a link to a separate patch for distutils?

(I removed 3.3 and 3.4 from the versions field since they are in 
security-fix-only mode now. I don't know whether this can be applied as a 
bugfix or not without reading the pypa-dev thread and the patch for distutils 
so I left rest of it selected.)

--
nosy: +berker.peksag
versions:  -Python 3.3, Python 3.4

___
Python tracker 

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



Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Ben Finney
Steve D'Aprano  writes:

> On Sat, 4 Feb 2017 10:13 am, Ben Finney wrote:
> > See , in particular
> > .
>
> I think you are conflating the package directory and . the current
> working directory.

I was careful not to say “current working directory”, for that reason.

I didn't want to open the more complex topic of Python packages, so I
let “current directory” stand in for “directory where the current module
is located”.

I'm glad that distinction did get mentioned, though.

-- 
 \ “Capitalism has destroyed our belief in any effective power but |
  `\  that of self interest backed by force.” —George Bernard Shaw |
_o__)  |
Ben Finney

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


[issue29198] AsyncGenerator is missing from typing

2017-02-03 Thread Roundup Robot

Roundup Robot added the comment:


New changeset 7fd9559c9c97fcf0519ace33b9d76a81ae156523 by Berker Peksag in 
branch '3.5':
Issue #29198: Document typing.AsyncGenerator
https://github.com/python/cpython/commit/7fd9559c9c97fcf0519ace33b9d76a81ae156523

New changeset 2c6ff7794c1b1af545d8ff17f54acef41cab089e by Berker Peksag in 
branch '3.5':
Issue #29198: Fix indentation and markup in typing.rst
https://github.com/python/cpython/commit/2c6ff7794c1b1af545d8ff17f54acef41cab089e


--

___
Python tracker 

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



[issue29311] Argument Clinic: convert dict methods

2017-02-03 Thread Roundup Robot

Roundup Robot added the comment:


New changeset 7baf0a0b90da5bb0b1ed5d27374f5a6b1c7b5dae by Serhiy Storchaka in 
branch 'master':
Issue #29311: Regenerate Argument Clinic.
https://github.com/python/cpython/commit/7baf0a0b90da5bb0b1ed5d27374f5a6b1c7b5dae


--

___
Python tracker 

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



[issue29198] AsyncGenerator is missing from typing

2017-02-03 Thread Roundup Robot

Roundup Robot added the comment:


New changeset 7fd9559c9c97fcf0519ace33b9d76a81ae156523 by Berker Peksag in 
branch '3.6':
Issue #29198: Document typing.AsyncGenerator
https://github.com/python/cpython/commit/7fd9559c9c97fcf0519ace33b9d76a81ae156523

New changeset 34c0c17d5774524dae63d9e2e693ad4b97386bbe by Berker Peksag in 
branch '3.6':
Issue #29198: Merge from 3.5
https://github.com/python/cpython/commit/34c0c17d5774524dae63d9e2e693ad4b97386bbe

New changeset 2c6ff7794c1b1af545d8ff17f54acef41cab089e by Berker Peksag in 
branch '3.6':
Issue #29198: Fix indentation and markup in typing.rst
https://github.com/python/cpython/commit/2c6ff7794c1b1af545d8ff17f54acef41cab089e

New changeset 9ea15544818e9186277efda1ce9da3a5e48ff1c7 by Berker Peksag in 
branch '3.6':
Issue #29198: Merge from 3.5
https://github.com/python/cpython/commit/9ea15544818e9186277efda1ce9da3a5e48ff1c7


--

___
Python tracker 

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



[issue29198] AsyncGenerator is missing from typing

2017-02-03 Thread Roundup Robot

Roundup Robot added the comment:


New changeset 7fd9559c9c97fcf0519ace33b9d76a81ae156523 by Berker Peksag in 
branch 'master':
Issue #29198: Document typing.AsyncGenerator
https://github.com/python/cpython/commit/7fd9559c9c97fcf0519ace33b9d76a81ae156523

New changeset 34c0c17d5774524dae63d9e2e693ad4b97386bbe by Berker Peksag in 
branch 'master':
Issue #29198: Merge from 3.5
https://github.com/python/cpython/commit/34c0c17d5774524dae63d9e2e693ad4b97386bbe

New changeset b6d785d86dbf4ea9b90da57f11da4fff1bb36c9d by Berker Peksag in 
branch 'master':
Issue #29198: Merge from 3.6
https://github.com/python/cpython/commit/b6d785d86dbf4ea9b90da57f11da4fff1bb36c9d

New changeset 2c6ff7794c1b1af545d8ff17f54acef41cab089e by Berker Peksag in 
branch 'master':
Issue #29198: Fix indentation and markup in typing.rst
https://github.com/python/cpython/commit/2c6ff7794c1b1af545d8ff17f54acef41cab089e

New changeset 9ea15544818e9186277efda1ce9da3a5e48ff1c7 by Berker Peksag in 
branch 'master':
Issue #29198: Merge from 3.5
https://github.com/python/cpython/commit/9ea15544818e9186277efda1ce9da3a5e48ff1c7

New changeset bab4b9b5a4c16298b17a77cf2aec43320f296717 by Berker Peksag in 
branch 'master':
Issue #29198: Merge from 3.6
https://github.com/python/cpython/commit/bab4b9b5a4c16298b17a77cf2aec43320f296717


--

___
Python tracker 

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



[issue29198] AsyncGenerator is missing from typing

2017-02-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d7eb9526c4f4 by Berker Peksag in branch '3.5':
Issue #29198: Fix indentation and markup in typing.rst
https://hg.python.org/cpython/rev/d7eb9526c4f4

New changeset f49b6c35d1e3 by Berker Peksag in branch '3.6':
Issue #29198: Merge from 3.5
https://hg.python.org/cpython/rev/f49b6c35d1e3

New changeset 8a898cfd089a by Berker Peksag in branch 'default':
Issue #29198: Merge from 3.6
https://hg.python.org/cpython/rev/8a898cfd089a

--

___
Python tracker 

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



[issue29198] AsyncGenerator is missing from typing

2017-02-03 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patches, Jelle :)

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> enhancement
versions: +Python 3.5

___
Python tracker 

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



[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-02-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: 
http://bugs.python.org/file46510/PySlice_GetIndicesEx-silence-warnings.patch

___
Python tracker 

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



[issue29198] AsyncGenerator is missing from typing

2017-02-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fe29826af634 by Berker Peksag in branch '3.5':
Issue #29198: Document typing.AsyncGenerator
https://hg.python.org/cpython/rev/fe29826af634

New changeset b475b076cc1f by Berker Peksag in branch '3.6':
Issue #29198: Merge from 3.5
https://hg.python.org/cpython/rev/b475b076cc1f

New changeset 2b55b18bf151 by Berker Peksag in branch 'default':
Issue #29198: Merge from 3.6
https://hg.python.org/cpython/rev/2b55b18bf151

--

___
Python tracker 

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



[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-03 Thread Xiang Zhang

Xiang Zhang added the comment:

Sounds reasonable. IIUC if the sample data gets 11 lines the total could be 20. 
I also think the second min is redundant. Would you mind review my patch Milt?

--
keywords: +patch
stage:  -> patch review
type: behavior -> enhancement
versions: +Python 3.7 -Python 3.5
Added file: http://bugs.python.org/file46509/csv_sniffer.patch

___
Python tracker 

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



[issue29311] Argument Clinic: convert dict methods

2017-02-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 222b9392a83b by Serhiy Storchaka in branch 'default':
Issue #29311: Regenerate Argument Clinic.
https://hg.python.org/cpython/rev/222b9392a83b

--

___
Python tracker 

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



[issue29441] Update examples to use async and await keywords in asyncio-task.rst

2017-02-03 Thread Berker Peksag

New submission from Berker Peksag:

Attached patch converts all examples that use @coroutine decorator in 
Doc/library/asyncio-task.rst. I also removed the generator example at 
https://docs.python.org/3/library/asyncio-task.html#example-coroutine-displaying-the-current-date

See issue 29407 for context.

--
assignee: docs@python
components: Documentation, asyncio
files: update-examples-task.diff
keywords: patch
messages: 286911
nosy: berker.peksag, docs@python, gvanrossum, yselivanov
priority: normal
severity: normal
stage: patch review
status: open
title: Update examples to use async and await keywords in asyncio-task.rst
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46508/update-examples-task.diff

___
Python tracker 

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



[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-02-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Good point Martin. I missed this because warnings are not emitted in non-debug 
build and were emitted only once in incremental debug build. Your idea about 
initializing slicelength in a macro LGTM.

--

___
Python tracker 

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



[issue29430] zipfile: invalid link

2017-02-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

https://support.pkware.com/display/PKZIP/Application+Note+Archives contains 
links to old versions of APPNOTE (the last is 6.3.3). But the actual version 
was at least 6.3.4 (I have a local copy).

All external links refer to 
http://www.pkware.com/documents/casestudies/APPNOTE.TXT. I think we should 
report a bug to PKWare.

--

___
Python tracker 

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



[issue29440] _dbm requires -lgdbm if gdbm is built as static libraries

2017-02-03 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Add the developer who wrote this line (issue15044)

--
nosy: +ncoghlan

___
Python tracker 

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



[issue29440] _dbm requires -lgdbm if gdbm is built as static libraries

2017-02-03 Thread Chi Hsuan Yen

New submission from Chi Hsuan Yen:

In setup.py, _dbm links to gdbm_compat only. If gdbm is built as dynamic 
libraries, libgdbm_compat.so has a NEEDED flag for libgdbm.so, so both symbols 
in libgdbm and libgdbm_compat can be used. However, as static libraries does 
not provide such a flag, importing _dbm raises ImportError:

shell@ASUS_Z00E_2:/data/local/tmp $ python3.7m -c 'import _dbm'
Traceback (most recent call last):
  File "", line 1, in 
ImportError: dlopen failed: cannot locate symbol "gdbm_errno" referenced by 
"/data/local/tmp/python3/usr/lib/python3.7/lib-dynload/_dbm.cpython-37m.so"...

gdbm_errno is a symbol in libgdbm.a.

gdbm manual [1] suggests linking to both libraries, too.

[1] http://www.gnu.org.ua/software/gdbm/manual/html_node/Compatibility.html

--
components: Build
files: gdbm.patch
keywords: patch
messages: 286907
nosy: Chi Hsuan Yen
priority: normal
severity: normal
status: open
title: _dbm requires -lgdbm if gdbm is built as static libraries
type: compile error
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46507/gdbm.patch

___
Python tracker 

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



[issue29439] _decimal on Android requires linking with libm

2017-02-03 Thread Chi Hsuan Yen

New submission from Chi Hsuan Yen:

Just like issue21668, _decimal requires -lm on Android. This wasn't fixed 
because _decimal didn't build before issue26846 lands. More specificially, 
log10 is called 
https://hg.python.org/cpython/file/tip/Modules/_decimal/libmpdec/mpdecimal.c#l7862

Added _decimal and Android experts

--
components: Cross-Build
files: decimal.patch
keywords: patch
messages: 286906
nosy: Alex.Willmer, Chi Hsuan Yen, skrah, xdegaye
priority: normal
severity: normal
status: open
title: _decimal on Android requires linking with libm
type: behavior
versions: Python 3.7
Added file: http://bugs.python.org/file46506/decimal.patch

___
Python tracker 

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



Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Cameron Simpson

On 04Feb2017 13:59, Steve D'Aprano  wrote:

On Sat, 4 Feb 2017 01:13 pm, Cameron Simpson wrote:


1. In your .bashrc file, or equivalent, set the environment
  variable PYTHONPATH:
export PYTHONPATH='./;$PYTHONPATH'


You want double quotes (allowing parameter substitution) instead of single
quotes here. Or, of course, no quotes at all. And the separator is ":",
not ";".


Thanks for the correction.


Personally, I'm against hacking the $PYTHONPATH this way at all.


Oh? Why's that? This is the whole purpose of PYTHONPATH.


I'm only against doing it "this way", for values of "this way" including 
"putting a ., which is totally dependent on my working directory, in my 
$PYTHONPATH".  I'm sorry I wasn't clear.



Far better to invoke the Python script via a shell script that includes
the absolute path of the current directory (or the module directory) in
the $PYTHONPATH.


For some definition of "better" -- that means you have double the cognitive
load. For every script.py you want, you need to create both script.py (what
you actually want) and script.sh (a wrapper that sets the environment).


Sure, but (I hope) Neal's need is a little special purpose.

Besides, when i do this with "installed" code, generally all the python is in a 
module in my normal $PYTHONPATH and the shell script, if it exists (eg to hack 
the $PYTHONPATH) looks a bit like this:


 #!/bin/sh
 set -ue
 PYTHONPATH=/path/to/extra/libs:$PYTHONPATH
 export PYTHONPATH
 exec python -m my.module ${1+"$@"}

So you don't really install 2 scripts. You install a python module in your 
normal place, and the invoker is a shell script which might prehack the 
environment.


My "dev" script is little different (though it mucks with $PATH and $PERL5LIB 
etc as well as $PYTHONPATH), but its whole purpose is to reduce my cognitive 
load, which just becomes "I want this directory as the basis for my dev env for 
this one command".


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


[issue29430] zipfile: invalid link

2017-02-03 Thread Berker Peksag

Berker Peksag added the comment:

>  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd;>

I think that HTML output suggests that their server configuration is broken. If 
you look at further down the page there is this error message:

Something has triggered missing webpage on your
website. This is the default 404 error page for
nginx that is distributed with
EPEL.  It is located
/usr/share/nginx/html/404.html

And:

$ curl -I https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
HTTP/1.1 404 Not Found
...

https://support.pkware.com/display/PKZIP/Application+Note+Archives might be a 
suitable alternative to the broken link. I'm adding Serhiy to nosy list since 
he knows a lot about the ZIP file format.

--
assignee:  -> docs@python
components: +Documentation
nosy: +berker.peksag, docs@python, serhiy.storchaka
resolution: not a bug -> 
stage: resolved -> needs patch
status: closed -> open
type:  -> behavior
versions: +Python 3.5, Python 3.7

___
Python tracker 

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



[issue29438] SIGSEGV in PyObject_Malloc on python 3.6 and 3.7

2017-02-03 Thread Xiang Zhang

Xiang Zhang added the comment:

I could reproduce this using Audric's command. And yes, debug build doesn't 
suffer from this crash. Nosy Victor.

DEBUG:root:Called with: ['/tmp/minimal_crash.py', '-d', 'sqlite:///crash.db', 
'-v']
INFO:__main__:Connecting to DB 'sqlite:///crash.db'
INFO:sqlalchemy.engine.base.Engine:SELECT CAST('test plain returns' AS 
VARCHAR(60)) AS anon_1
INFO:sqlalchemy.engine.base.Engine:()
INFO:sqlalchemy.engine.base.Engine:SELECT CAST('test unicode returns' AS 
VARCHAR(60)) AS anon_1
INFO:sqlalchemy.engine.base.Engine:()
INFO:sqlalchemy.engine.base.Engine:BEGIN (implicit)
INFO:sqlalchemy.engine.base.Engine:SELECT table_name.id AS table_name_id, 
table_name.att_1 AS table_name_att_1, table_name.att_2 AS table_name_att_2, 
table_name.att_3 AS table_name_att_3, table_name.date_1 AS table_name_date_1, 
table_name.date_2 AS table_name_date_2 
FROM table_name 
WHERE table_name.id = ? AND table_name.att_1 = ? AND table_name.att_2 = ? AND 
table_name.att_3 = ?
INFO:sqlalchemy.engine.base.Engine:('12345678912345', '123456789123456', 2, 4)
DEBUG:__main__:No item found, new item
DEBUG:__main__:Documents processed
INFO:sqlalchemy.engine.base.Engine:INSERT INTO table_name (id, att_1, att_2, 
att_3, date_1, date_2) VALUES (?, ?, ?, ?, ?, ?)
INFO:sqlalchemy.engine.base.Engine:('12345678912345', None, None, None, None, 
None)
INFO:sqlalchemy.engine.base.Engine:ROLLBACK

Program received signal SIGSEGV, Segmentation fault.
_PyObject_Alloc (ctx=0x0, elsize=296, nelem=1, use_calloc=0) at 
Objects/obmalloc.c:1258
1258if ((pool->freeblock = *(block **)bp) != NULL) {
(gdb) bt
#0  _PyObject_Alloc (ctx=0x0, elsize=296, nelem=1, use_calloc=0) at 
Objects/obmalloc.c:1258
#1  _PyObject_Malloc (ctx=0x0, nbytes=296) at Objects/obmalloc.c:1437
#2  0x5564082c in new_keys_object (size=) at 
Objects/dictobject.c:536
#3  dictresize (mp=mp@entry=0x77e36510, minsize=) at 
Objects/dictobject.c:1242
#4  0x5564456f in insertion_resize (mp=0x77e36510) at 
Objects/dictobject.c:1094
#5  insertdict (value=, hash=, key=, mp=) at Objects/dictobject.c:1142
#6  PyDict_SetItem (value=0x739f5d68, key=0x766f9260, 
op=0x77e36510) at Objects/dictobject.c:1564
#7  dict_ass_sub (mp=0x77e36510, v=0x766f9260, w=0x739f5d68) at 
Objects/dictobject.c:2148
#8  0x555af8d4 in _PyEval_EvalFrameDefault (f=, 
throwflag=) at Python/ceval.c:1673
#9  0x555ab211 in PyEval_EvalFrameEx (throwflag=0, f=0x73487da0) at 
Python/ceval.c:664
#10 _PyFunction_FastCall (co=, args=, nargs=2, 
globals=) at Python/ceval.c:4926
#11 0x555b30ff in call_function (kwnames=0x0, oparg=, 
pp_stack=) at Python/ceval.c:4868
#12 _PyEval_EvalFrameDefault (f=, throwflag=) at 
Python/ceval.c:3290
#13 0x556e37b0 in PyEval_EvalFrameEx (throwflag=0, f=0x55eb0ce8) at 
Python/ceval.c:664
#14 _PyEval_EvalCodeWithName (_co=0x77e34300, globals=, 
locals=locals@entry=0x0, args=, argcount=2, 
kwnames=0x77e360f0, kwargs=0x55eaf210, kwcount=3, kwstep=1, 
defs=0x0, defcount=0, kwdefs=0x77e36480, closure=0x0, 
name=0x77e30420, qualname=0x77e31f60) at Python/ceval.c:4165
#15 0x556e395b in fast_function (func=, stack=, nargs=, kwnames=) at Python/ceval.c:4987
#16 0x555b22a8 in call_function (kwnames=0x77e360d8, 
oparg=, pp_stack=) at Python/ceval.c:4868
#17 _PyEval_EvalFrameDefault (f=, throwflag=) at 
Python/ceval.c:3336

...

--
nosy: +haypo, xiang.zhang

___
Python tracker 

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



Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Steve D'Aprano
On Sat, 4 Feb 2017 10:13 am, Ben Finney wrote:

> So, for the past ten years and more, Python supports import of modules
> from the current directory with an explicit *relative* path::
> 
> # Absolute imports, searching ‘sys.path’.
> import datetime
> from collections import namedtuple
> 
> # Relative imports, starting from this module's directory.
> from . import foo
> from .bar import baz
> 
> See , in particular
> .

I think you are conflating the package directory and . the current working
directory. Relative imports do not, as far as I can see, have anything to
do with the current working directory.

I created these files in a directory under my home directory:


[steve@ando ~]$ ls test
eggs.py  spam.py
[steve@ando ~]$ cat test/eggs.py
pass
[steve@ando ~]$ cat test/spam.py
from . import eggs
print(eggs.__file__)


I cd'ed into the test folder, and tried running spam.py:

[steve@ando ~]$ cd test
[steve@ando test]$ python3.5 spam.py
Traceback (most recent call last):
  File "spam.py", line 1, in 
from . import eggs
SystemError: Parent module '' not loaded, cannot perform relative import



So relative imports using . dot have nothing to do with importing from the
current directory.




-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

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


Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Steve D'Aprano
On Sat, 4 Feb 2017 01:13 pm, Cameron Simpson wrote:

>>1. In your .bashrc file, or equivalent, set the environment
>>   variable PYTHONPATH:
>>export PYTHONPATH='./;$PYTHONPATH'
> 
> You want double quotes (allowing parameter substitution) instead of single
> quotes here. Or, of course, no quotes at all. And the separator is ":",
> not ";".

Thanks for the correction.

> Personally, I'm against hacking the $PYTHONPATH this way at all.

Oh? Why's that? This is the whole purpose of PYTHONPATH.


> Far better to invoke the Python script via a shell script that includes
> the absolute path of the current directory (or the module directory) in
> the $PYTHONPATH.

For some definition of "better" -- that means you have double the cognitive
load. For every script.py you want, you need to create both script.py (what
you actually want) and script.sh (a wrapper that sets the environment).




-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

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


Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Cameron Simpson
CCed to Neal: could you confirm or refute my suppositions below, or further 
clarify? Thanks.


On 04Feb2017 12:46, Steve D'Aprano  wrote:

On Sat, 4 Feb 2017 10:13 am, Ben Finney wrote:

Neal Becker  writes:

I want to make sure any modules I build in the current directory
overide any others. To do this, I'd like sys.path to always have './'
at the beginning.


The ‘sys.path’ list is used only for *absolute* imports. Modules in the
current directory should not be imported with an absolute path[0]. So, the
current directory should not be in ‘sys.path’.

[...]

[0]: Why not? See the rationale for forcing absolute import by default


,

 “[I]t is not clear whether ‘import foo’ refers to a top-level
 module or to another module inside the package.[…] It's a
 particularly difficult problem inside packages because [without
 explicit relative import syntax] there's no way to specify which
 module is meant.”


I'm not sure that this reasoning applies to Neal's situation. He doesn't
seem to be talking about a single package, as such, more like he has a
bunch of unrelated libraries in a single directory. My *guess* is that he
probably has something like a ~/python or ~/scripts directory, and he likes
to cd into that directory before running one of the scripts.

I don't know what problem Neal thinks he is solving by always inserting ./
at the front of sys.path. But the rationale above doesn't seem relevant to
the *pure technical question* of inserting ./ at the start of sys.path.


I think it is relevant. Why? _Because_ we don't have Neal's wider context, 
which he hasn't provided. Purely technical advice is all very well, and 
definitiely a necessary component to answers.


However, I can't count the number of times I've encountered people requesting a 
specific technical solution to a problem defined only in terms of the technical 
task. And when that particular solution is something that is _usually_ a bad 
idea, one should always accompany the techincal advice with a bit of discussion 
of related alternatives and the up and downsides. Particularly, why the 
requested technical solution is often not thought to be a good thing. And 
ideally with a request for the wider context that _causes_ the OP to request a 
particular solution.


Now, we do actually have a bit of Neal's wider context:

 I want to make sure any modules I build in the current directory
 overide any others.

His requested _particular_ technical solution is this:

 To do this, I'd like sys.path to always have './'
 at the beginning.

I think that's probably a poor technical solution for reasons I've alluded to 
in another post. Ben has provided greater context around that can be done with 
imports so that Neal can perhaps choose another method with the same outcome in 
terms of his wider objective.


From my own perspective, I often want something that feels like what I think 
Neal may want: when I'm debugging my own modules I want the "lib/python" 
subdirectory of my code repository at the start of my Python path in order that 
imports find my developement modules ahead of their installed/published copies.


Now, I have _many_ development directories because I tend to make one for each 
branch in progress, and just cd to the particular dev tree I'm working on.


In this circumstance I've got a personal script called "dev" which prepends the 
_absolute_ paths of the various lib subdirs to the relevant paths, so it sticks 
$PWD/lib/python to the front of $PYTHONPATH. And then it executes whatever 
command I supply:


 dev python -m cs.venti.store_tests

for example.

I suspect Neal could do with something like that instead.

Neal, could you confirm or refute or clarify how this all fits your situation?

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Cameron Simpson

On 04Feb2017 12:16, Steve D'Aprano  wrote:

On Sat, 4 Feb 2017 03:06 am, Neal Becker wrote:

I want to make sure any modules I build in the current directory overide
any
others.  To do this, I'd like sys.path to always have './' at the
beginning.

What's the best way to ensure this is always true whenever I run python3?


For some definition of "always"...
I don't know about "best", but you can do this:

1. In your .bashrc file, or equivalent, set the environment
  variable PYTHONPATH:
export PYTHONPATH='./;$PYTHONPATH'


You want double quotes (allowing parameter substitution) instead of single 
quotes here. Or, of course, no quotes at all. And the separator is ":", not 
";".


Personally, I'm against hacking the $PYTHONPATH this way at all.

Far better to invoke the Python script via a shell script that includes the 
absolute path of the current directory (or the module directory) in the 
$PYTHONPATH.


Cheers,
Cameron Simpson 

That article and its poster have been canceled.
   - David B. O'Donnell, Sysadmin, America OnLine
--
https://mail.python.org/mailman/listinfo/python-list


Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Steve D'Aprano
On Sat, 4 Feb 2017 10:13 am, Ben Finney wrote:

> Neal Becker  writes:
> 
>> I want to make sure any modules I build in the current directory
>> overide any others. To do this, I'd like sys.path to always have './'
>> at the beginning.
> 
> The ‘sys.path’ list is used only for *absolute* imports. Modules in the
> current directory should not be imported with an absolute path[0]. So, the
> current directory should not be in ‘sys.path’.
[...]
> [0]: Why not? See the rationale for forcing absolute import by default
> 
,
>  “[I]t is not clear whether ‘import foo’ refers to a top-level
>  module or to another module inside the package.[…] It's a
>  particularly difficult problem inside packages because [without
>  explicit relative import syntax] there's no way to specify which
>  module is meant.”


I'm not sure that this reasoning applies to Neal's situation. He doesn't
seem to be talking about a single package, as such, more like he has a
bunch of unrelated libraries in a single directory. My *guess* is that he
probably has something like a ~/python or ~/scripts directory, and he likes
to cd into that directory before running one of the scripts.

I don't know what problem Neal thinks he is solving by always inserting ./
at the front of sys.path. But the rationale above doesn't seem relevant to
the *pure technical question* of inserting ./ at the start of sys.path.

 

-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

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


Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Cameron Simpson

On 03Feb2017 17:21, Wildman  wrote:

On Sat, 04 Feb 2017 09:25:42 +1100, Cameron Simpson wrote:
Also, what you describe with rc.local wouldn't work anyway, even if it had 
ben

what was asked.


Of course, you are correct.  I don't know where my head
was.  I think my tongue got in front of my eye teeth and
I could not see what I was saying.  :-)

If anyone is interested the correct way is to add this to
/etc/profile (at the bottom):

PATH=$PATH:./
export PATH


Indeed. But this should usually be accompanied by the advice that this isn't a 
good idea. Having one's commands at the mercy of whatever directory one is 
standing in is a recipe for being subverted. While the risk is lessened by 
having "." at the end of the search path, that just means the attacker (== 
other user of this system) has to name their trojan horse commands after typing 
errors, such as the ever popular "gerp" search programme.


Even with Python I'd feel it is better to not have "." in the sys.path; I'd be 
happier with a full path to a preferred source of modules. (Yes, I know Python 
likes to search the current directory for modules, notmy favourite feature.)


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-02-03 Thread Martin Panter

Martin Panter added the comment:

Not a big deal, but the change produces compiler warnings with GCC 6.1.1:

/home/proj/python/cpython/Objects/bytesobject.c: In function ‘bytes_subscript’:
/home/proj/python/cpython/Objects/bytesobject.c:1701:13: warning: ‘slicelength’ 
may be used uninitialized in this function [-Wmaybe-uninitialized]
 for (cur = start, i = 0; i < slicelength;
 ^~~
/home/proj/python/cpython/Objects/listobject.c: In function 
‘list_ass_subscript’:
/home/proj/python/cpython/Objects/listobject.c:2602:13: warning: ‘slicelength’ 
may be used uninitialized in this function [-Wmaybe-uninitialized]
 for (i = 0; i < slicelength; i++) {
 ^~~
/home/proj/python/cpython/Objects/unicodeobject.c: In function 
‘unicode_subscript’:
/home/proj/python/cpython/Objects/unicodeobject.c:14013:16: warning: 
‘slicelength’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 result = PyUnicode_New(slicelength, max_char);
 ~~~^~
/media/disk/home/proj/python/cpython/Modules/_elementtree.c: In function 
‘element_ass_subscr’:
/media/disk/home/proj/python/cpython/Modules/_elementtree.c:1896:50: warning: 
‘slicelen’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 self->extra->children[i + newlen - slicelen] = 
self->extra->children[i];
   ~~~^~
/media/disk/home/proj/python/cpython/Modules/_ctypes/_ctypes.c: In function 
‘Array_subscript’:
/media/disk/home/proj/python/cpython/Modules/_ctypes/_ctypes.c:4327:16: 
warning: ‘slicelen’ may be used uninitialized in this function 
[-Wmaybe-uninitialized]
 np = PyUnicode_FromWideChar(dest, slicelen);
 ~~~^~~~

My build used to be free of warnings. This warning is enabled via -Wall. The 
reason is probably that the new macro skips the slicelength assignment if 
PySlice_Unpack() fails. Workarounds could be to assign or initialize 
slicelength to zero (at the call sites or inside the macro), or to compile with 
-Wno-maybe-uninitialized.

--
nosy: +martin.panter

___
Python tracker 

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



Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Steve D'Aprano
On Sat, 4 Feb 2017 03:06 am, Neal Becker wrote:

> I want to make sure any modules I build in the current directory overide
> any
> others.  To do this, I'd like sys.path to always have './' at the
> beginning.
> 
> What's the best way to ensure this is always true whenever I run python3?


For some definition of "always"... 

I don't know about "best", but you can do this:


1. In your .bashrc file, or equivalent, set the environment 
   variable PYTHONPATH:

export PYTHONPATH='./;$PYTHONPATH'

* * * 

If you need this to be site-wide, rather than per person, another
possibility, untested, would be to get your site administrator to create a
sitecustomize.py file. Suppose your Python is installed in 

/usr/local/lib/python3.5/

Get your site admin to create the following file:

/usr/local/lib/python3.5/site-packages/sitecustomize.py

containing the following code:

import sys
if './' not in sys.path:
sys.path.insert(0, './')

* * * * 

Alternatively, a per-user solution is to create your own usercustomize.py
file, containing the same code as above. 

By default, the per-user site packages directory will be:

# Unix:
~/.local/lib/pythonX.Y/site-packages

# Mac:
~/Library/Python/X.Y/lib/python/site-packages

# Windows:
%APPDATA%\Python\PythonXY\site-packages

where X Y are the major and minor version numbers, e.g. 3 5.



See the documentation for the site module for more detail:

https://docs.python.org/3/library/site.html




-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

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


Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Cameron Simpson

On 04Feb2017 10:13, Ben Finney  wrote:

Neal Becker  writes:

I want to make sure any modules I build in the current directory
overide any others. To do this, I'd like sys.path to always have './'
at the beginning.


The ‘sys.path’ list is used only for *absolute* imports. Modules in the
current directory should not be imported with an absolute path[0]. So, the
current directory should not be in ‘sys.path’.

So, for the past ten years and more, Python supports import of modules
from the current directory with an explicit *relative* path::

   # Absolute imports, searching ‘sys.path’.
   import datetime
   from collections import namedtuple

   # Relative imports, starting from this module's directory.
   from . import foo
   from .bar import baz

See , in particular
.


I wrote:

Yes, I know Python likes to search
the current directory for modules, notmy favourite feature.


I stand corrected.

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


[issue29438] SIGSEGV in PyObject_Malloc on python 3.6 and 3.7

2017-02-03 Thread Audric Schiltknecht

New submission from Audric Schiltknecht:

I've managed to create a minimal test file that causes python to crashe when 
run with python 3.6.0 (packaged in my distribution or from hg repository), 3.6 
branch from hg repository and 3.7 branch from hg repository, but works fine on 
3.5.3 and 3.5 branch.

It also does not crash when python is compiled with '--with-pydebug' option 
(3.6/3.7)

$ uname -a
Linux 4.8.13-1-ARCH #1 SMP PREEMPT Fri Dec 9 07:24:34 CET 2016 x86_64 GNU/Linux

$ python --version
Python 3.6.0

$ pip freeze
appdirs==1.4.0
packaging==16.8
pyparsing==2.1.10
python-dateutil==2.6.0
six==1.10.0
SQLAlchemy==1.1.5

To reproduce, use the attached file (minimal_crash.py):

$ virtualenv3  venv
$ source venv/bin/activate
$ pip install sqlalchemy

Run once to create DB and insert some stuff into it (no crash):
$ ./minimal_crash.py -d sqlite:///crash.db -v -c

Then re-run same thing WITHOUT re-creating the base:
$ ./minimal_crash.py -d sqlite:///crash.db -v
INFO:__main__:Connecting to DB 'sqlite:///crash.db'
Segmentation fault (core dumped)


Runing with GDB: 
https://gist.github.com/audricschiltknecht/5564034c5aac78d881e03f29e069a8f5

--
files: minimal_crash.py
messages: 286902
nosy: audric
priority: normal
severity: normal
status: open
title: SIGSEGV in PyObject_Malloc on python 3.6 and 3.7
type: crash
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46505/minimal_crash.py

___
Python tracker 

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



[issue15451] PATH is not honored in subprocess.Popen in win32

2017-02-03 Thread Eryk Sun

Eryk Sun added the comment:

> difference from the behaviour of Posix's execvpe() was deliberate

POSIX doesn't define execvpe [1]. GNU glibc implemented it in 2009 [2]. On 
Windows, MSC has had execvpe and spawnvpe since at least 5.0 [3], and I think 
it arrived in 4.0 in 1986. Guido added os._execvpe in 1.2b4 [4] in 1995. I 
think it's the only implementation of execvpe that searches the passed 
environment. 

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/execvp.html
[2]: https://sourceware.org/ml/libc-alpha/2009-10/msg00063.html
[3]: https://openlibrary.org/works/OL2028669W
[4]: https://hg.python.org/cpython/file/534a97c400cc/Lib/os.py

--
nosy: +eryksun

___
Python tracker 

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



Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Wildman via Python-list
On Sat, 04 Feb 2017 09:25:42 +1100, Cameron Simpson wrote:

> On 03Feb2017 14:55, Wildman  wrote:
>>On Fri, 03 Feb 2017 13:19:30 -0700, Michael Torrie wrote:
>>
>>> On 02/03/2017 12:07 PM, Wildman via Python-list wrote:
 Sorry, I forgot something important.  If you use
 /etc/rc.local, the execute bit must be set.
>>>
>>> I don't think this is what Neal Becker was asking about.  He's talking
>>> about the Python module search path (sys.path) not the operating system
>>> PATH variable.  Correct me if I'm wrong.
>>
>>After re-reading the post I see you are correct.
>>I will endeavor to read a little closer and a
>>little slower in the future.
> 
> Also, what you describe with rc.local wouldn't work anyway, even if it had 
> ben 
> what was asked.
> 
> Cheers,
> Cameron Simpson 

Of course, you are correct.  I don't know where my head
was.  I think my tongue got in front of my eye teeth and
I could not see what I was saying.  :-)

If anyone is interested the correct way is to add this to
/etc/profile (at the bottom):

PATH=$PATH:./
export PATH

-- 
 GNU/Linux user #557453
The cow died so I don't need your bull!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Ben Finney
Neal Becker  writes:

> I want to make sure any modules I build in the current directory
> overide any others. To do this, I'd like sys.path to always have './'
> at the beginning.

The ‘sys.path’ list is used only for *absolute* imports. Modules in the
current directory should not be imported with an absolute path[0]. So, the
current directory should not be in ‘sys.path’.

So, for the past ten years and more, Python supports import of modules
from the current directory with an explicit *relative* path::

# Absolute imports, searching ‘sys.path’.
import datetime
from collections import namedtuple

# Relative imports, starting from this module's directory.
from . import foo
from .bar import baz

See , in particular
.


[0]: Why not? See the rationale for forcing absolute import by default
 
,
 “[I]t is not clear whether ‘import foo’ refers to a top-level
 module or to another module inside the package.[…] It's a
 particularly difficult problem inside packages because [without
 explicit relative import syntax] there's no way to specify which
 module is meant.”

-- 
 \ “True greatness is measured by how much freedom you give to |
  `\  others, not by how much you can coerce others to do what you |
_o__)   want.” —Larry Wall |
Ben Finney

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


[issue29430] zipfile: invalid link

2017-02-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The Applicaton Note link in both the doc and here work for me with Firefox and 
Edge.
'''
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd;>

http://www.w3.org/1999/xhtml; xml:lang="en">

...'''
You must have been hit by a temporary glitch.

--
nosy: +terry.reedy
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



[issue29414] Change 'the for statement is such an iterator' in Tutorial

2017-02-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The preceding sentences are also off.  "In many ways the object returned by 
range() behaves as if it is a list, but in fact it isn’t. It is an object which 
returns the successive items of the desired sequence when you iterate over it, 
but it doesn’t really make the list, thus saving space."

A range object is more like a tuple than a list.  Ranges and tuples are 
immutable sequences and the only non-dunder methods of both are count and 
index.  Lists, on the other hand, are mutable and several other exposed 
methods.  The difference between range and tuple is that ranges generate items 
as requested while tuples can be added and multiplied.

"Ranges are similar to tuples in being sequences with count and index methods.  
Both can be indexed, sliced, and iterated.  However, ranges cannot be added or 
multiplied.  They generate their items on request, thus saving space"

I am still thinking about the next two sentences, discussed above.  I do not 
like 'construct' to mean 'statement' (or callable).

--
nosy: +terry.reedy
versions:  -Python 3.3, Python 3.4

___
Python tracker 

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



[issue27051] Create PIP gui

2017-02-03 Thread Upendra Kumar

Upendra Kumar added the comment:

I have tried to inquire about the possibility of a pip API, however currently 
it doesn't seem that it is top priority for pip organisation as per these issue 
threads :

1. https://github.com/pypa/pip/issues/924
2. https://github.com/pypa/pip/issues/3999

Currently pip list has --format option to give output as json format.

--

___
Python tracker 

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



ANN: Wing Python IDE version 6.0.2 released

2017-02-03 Thread Wingware

Hi,

We've just released Wing version 6.0.2 which expands and improves 
support for remote development, adds a drop down of found Python 
installations, introduces symbol name style refactoring operations, 
improves multi-selection with the mouse, fixes debugging Jupyter 
notebooks, and makes many other minor improvements.  For details, see 
the change log at http://wingware.com/pub/wingide/6.0.2/CHANGELOG.txt


Wing 6 is the latest major release in Wingware's family of Python IDEs, 
including Wing Pro, Wing Personal, and Wing 101.  Wing 6 adds many new 
features, introduces a new annual license option, and makes some changes 
to the product line.


New Features

 * Improved Multiple Selections:  Quickly add selections and edit them
   all at once
 * Easy Remote Development:  Work seamlessly on remote Linux, OS X, and
   Raspberry Pi systems
 * Debugging in the Python Shell:  Reach breakpoints and exceptions in
   (and from) the Python Shell
 * Recursive Debugging:  Debug code invoked in the context of stack
   frames that are already being debugged
 * PEP 484 and PEP 526 Type Hinting:  Inform Wing's static analysis
   engine of types it cannot infer
 * Support for Python 3.6 and Stackless 3.4:  Use async and other new
   language features
 * Optimized debugger:  Run faster, particularly in multi-process and
   multi-threaded code
 * Support for OS X full screen mode:  Zoom to a virtual screen, with
   auto-hiding menu bar
 * Added a new One Dark color palette:  Enjoy the best dark display
   style yet
 * Updated French and German localizations:  Thanks to Jean Sanchez,
   Laurent Fasnacht, and Christoph Heitkamp

For a much more detailed overview of new features see the release notice 
at http://wingware.com/news/2017-02-02


Annual Use License Option

Wing 6 adds the option of purchasing a lower-cost expiring annual 
license for Wing Pro.  An annual license includes access to all 
available Wing Pro versions while it is valid, and then ceases to 
function if it is now renewed.  Pricing for annual licenses is US$ 
179/user for Commercial Use and US$ 69/user for Non-Commercial Use.


Perpetual licenses for Wing Pro will continue to be available at the 
same pricing.


The cost of extending Support+Upgrades subscriptions on Non-Commercial 
Use perpetual licenses for Wing Pro has also been dropped from US$ 89 to 
US$ 39 per user.


For details, see https://wingware.com/store/purchase

Wing Personal is Free

Wing Personal is now free and no longer requires a license to run.  It 
now also includes the Source Browser, PyLint, and OS Commands tools, and 
supports the scripting API and Perspectives.


However, Wing Personal does not include Wing Pro's advanced editing, 
debugging, testing and code management features, such as remote host 
access, refactoring, find uses, version control, unit testing, 
interactive debug probe, multi-process and child process debugging, move 
program counter, conditional breakpoints, debug watch, 
framework-specific support (for matplotlib, Django, and others), find 
symbol in project, and other features.


Links

Release notice: http://wingware.com/news/2017-02-02
Free trial: http://wingware.com/wingide/trial
Downloads: http://wingware.com/downloads
Feature list: http://wingware.com/wingide/features
Buy: http://wingware.com/store/purchase
Upgrade: https://wingware.com/store/upgrade

Questions?  Don't hesitate to email us at supp...@wingware.com.

Thanks,

--

Stephan Deibel
Wingware | Python IDE

The Intelligent Development Environment for Python Programmers

wingware.com

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


[issue29400] Add instruction level tracing via sys.settrace

2017-02-03 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
stage:  -> test needed
title: Instruction level tracing via sys.settrace -> Add instruction level 
tracing via sys.settrace
versions: +Python 3.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



[issue29394] Cannot tunnel TLS connection through TLS connection

2017-02-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Maximilian, I could not tell if you are still requesting that something be 
changed, or if this should be closed.

--
nosy: +terry.reedy

___
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-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I agree with Marco in that I do not understand the 'should'.  Py 3 has a 
definite rule for when it raises.  (I don't remember the exact details as I 
don't use tabs.)  "Python raises xxxError if one mixes tabs and spaces in the 
same file." (Or whatever the rule is.)

--
nosy: +terry.reedy

___
Python tracker 

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



[issue27051] Create PIP gui

2017-02-03 Thread Upendra Kumar

Upendra Kumar added the comment:

@Terry, I believe pip package doesn't solve the core purpose of GUI. Instead of 
that I should make a .deb, .rpm or .exe package so that beginners can directly 
install it. However, I will create the PyPI package by 10th Feb.

--

___
Python tracker 

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



Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Cameron Simpson

On 03Feb2017 14:55, Wildman  wrote:

On Fri, 03 Feb 2017 13:19:30 -0700, Michael Torrie wrote:


On 02/03/2017 12:07 PM, Wildman via Python-list wrote:

Sorry, I forgot something important.  If you use
/etc/rc.local, the execute bit must be set.


I don't think this is what Neal Becker was asking about.  He's talking
about the Python module search path (sys.path) not the operating system
PATH variable.  Correct me if I'm wrong.


After re-reading the post I see you are correct.
I will endeavor to read a little closer and a
little slower in the future.


Also, what you describe with rc.local wouldn't work anyway, even if it had ben 
what was asked.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


[issue27051] Create PIP gui

2017-02-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

As far as I am concerned, this upload fulfills your obligation to CPython and 
PSF with respect to sponsoring your GSOC project.  I wanted to get at least 
this loose end completed.

I have no further expectation of you.  I would *like* for you to make this pip 
installable by listing it on PyPI, so it can get some field testing. If you do, 
we can think about what to do from the pydev/cpython side. This was the meaning 
of Nick's last sentence above.

If you want to do this, I am sure you can get help, maybe from Nick, certainly 
from others.  I have never done a PyPI project, but I suppose I should learn 
how.

I do not remember *any* json output from pip.  Is this something new?  the 
beginning of an API?  Any coordination with pip people depends on them, of 
course.

--

___
Python tracker 

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



[issue29395] Edit with IDLE 3.6 don´t work if Name of File "code.py"

2017-02-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Steve is correct.  lib/code.py is used for IDLE's Shell.

One should generally avoid naming files the same as stdlib files.  To do so, 
one can either look in the module index of the docs or try 'import somename'.

When Python starts, it imports the modules it uses *before* it adds '' or 
 to the front of sys.path.  Applications that both import modules and 
run user code need to at least temporarily remove the addition to do imports.  
Having IDLE fix sys.path is #25488.

Duplicate names can also sabotage user code.  More than one person has written, 
for instance, a random.py, forgotten about it, and later written a mystuff.py 
in the same directory.  If mystuff has 'import random' with the intent to use 
the stdlib module, mystuff usually fails, often mysteriously.

When IDLE fails, make sure you run it from a console with 'python -m idlelib' 
(python3 on some systems, idlelib.idle on 2.7).  There will usually be an error 
message, which may or may not help.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> IDLE: Remove '', user_dir, and idlelib from sys.path when added

___
Python tracker 

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



[issue25488] IDLE: Remove '', user_dir, and idlelib from sys.path when added

2017-02-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The sys.pyth manipulation will be different in the idle and user processes.  If 
IDLE is started with -n, so both processes are the same, even more care is 
needed.

--

___
Python tracker 

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



[issue25488] IDLE: Remove '', user_dir, and idlelib from sys.path when added

2017-02-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I should have said that the problem with having '' at the beginning of the path 
is that when IDLE tries to import an stdlib module and '' (usually a user 
directory) contain a file with the same name, IDLE will import the user file 
instead and at some point likely exit.  For example, a user file named code.py 
masks the stdlib code.py, which is essential to Shell operation (#29395).

--

___
Python tracker 

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



Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Wildman via Python-list
On Fri, 03 Feb 2017 13:19:30 -0700, Michael Torrie wrote:

> On 02/03/2017 12:07 PM, Wildman via Python-list wrote:
>> Sorry, I forgot something important.  If you use
>> /etc/rc.local, the execute bit must be set.
> 
> I don't think this is what Neal Becker was asking about.  He's talking
> about the Python module search path (sys.path) not the operating system
> PATH variable.  Correct me if I'm wrong.

After re-reading the post I see you are correct.
I will endeavor to read a little closer and a
little slower in the future.

-- 
 GNU/Linux user #557453
"Well, that's quite different. Never mind."
  -Emily Litella
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29428] Doctest documentation unclear about multi-line fixtures

2017-02-03 Thread Jim DeLaHunt

Jim DeLaHunt added the comment:

Marco and David, thank you again for your prompt replies. 

Let me respond to both of your comments on the doctest module documentation 
itself.


[Marco] > The example in section 26.3.3.2 [1], before the compound statement 
(the if/else), contains two simple statements. I also think the example is 
complete and straightforward for its purpose, and it does not have to be 
complicated adding avanced features.

You are correct, it contain two simple statements. I missed this when I first 
read the example.  Part of the problem is that the example is contrived. It is 
an actual test. I think it would be better to replace these two lines by a 
two-line test, one which sets up state and another which exercises the module 
under test.

You believe "the example is complete and straightforward for its purpose, and 
it does not have to be complicated adding avanced features." I am giving you 
feedback that it was not complete and straightforward for me, as an ordinary 
software developer trying to use the documentation. 


[Marco] > If you want a more complex control over your tests, for instance 
adding fixtures, you can find how to do it later...

No, control over tests is not what I am bringing up in this issue. I an 
concerned with documentation of doctest "Examples".


[Marco] > I am -1 on this [changing 26.3.3.2]. IMHO there is no need to add 
extra description to a such self-explaining, clear and concise example. But 
this I think is also clear from the beginning. Infact, the first line of the 
doc says: "The doctest module searches for pieces of text that look like 
interactive Python sessions"

[David] > As for the prompts, I agree with Marco: I don't think there is any 
need to add words, since it clearly says it is supposed to look like an 
interactive session and the reader gets reminded of the rules for that by the 
example provided.  IMO it is not appropriate to re-document those rules here.


My feedback to you is that for me, as an ordinary software developer trying to 
use the doctest module, this section is not "self-explaining, clear and 
concise", and that "How Docstring examples are recognised" is not "clear from 
the beginning". 

Perhaps we have a difference of opinion on how clear and effective this 
documentation is.  The best way to resolve that would be to gather data: having 
several ordinary software developers reading the document, then measuring their 
comprehension. That would be hard to arrange. At least this bug report will 
serve as a data point.

I believe that a library module documentation should at some point clearly 
specify how the module works. I believe section Section "26.3.3.2. How are 
Docstring Examples Recognized?" does poorly at that. To say, "In most cases a 
copy-and-paste of an interactive console session works fine, but doctest isn’t 
trying to do an exact emulation of any specific Python shell." is not a 
specification. It's a blurry generalisation. The list of "fine print" is at a 
better level of detail, but still doesn't mention how the parser treats 
statements, nor how prefixes relate to statement boundaries.

I am giving you feedback that for me, as a developer trying to use the doctest 
module, this documentation failed to give me the comprehension I needed to be 
effective.


[Marco] >Also this section [26.3.3.3, execution context] IMO is well written 
and clear. I do not know what to say... If someone else thinks it is not enough 
understandable, maybe the better think to do is to add a very small example, 
with two functions, that shows their docstrings have independent globals.

[David] > It does appear that "test" is being used ambiguously in the docs.  In 
most places it means a single statement, but in execution context it appears to 
be being used as a synonym for "docstring".  In that section it should be 
replaced by "docstring".  It would probably be worth checking the rest of the 
doc to make sure it is used consistently elsewhere as well.

[David] > The execution context section makes it clear that you can use names 
defined earlier, as does the fact that doctests emulate interactive sessions.  
Both of these make it clear you can do multi line examples that use shared 
state. 

Again, I am giving you feedback that this document was not "clear" for me. I am 
taking the time to write this issue because I think the documentation has 
weaknesses, and would like to help improve it.

I agree with David, that one problem in this section is that the word "test" is 
used with three different meanings. Some instances of the word "test" should be 
changed to "docstring" or similar. That would help. 


[David] > So in summary, I think we *need* a one word change in the execution 
context section, and we'll consider any other enhancements you want to propose.

All right, I'll work on a patch that makes that one-word change, and offers 
some other concise improvements. I expect it will be more that you think 
necessary, 

[issue27435] ctypes library loading and AIX - also for 2.7.X (and later)

2017-02-03 Thread Michael Felt

Michael Felt added the comment:

On 31/01/2017 20:22, Michael Haubenwallner wrote:
> Michael Haubenwallner added the comment:
>
> Feels like it is up to me to shed some light on various topics here:
Many thanks!
>
> AIX defines (static) "Object" files and "Shared Object" files. Both can (but 
> do not need to) be members of an "Archive Library".
>
> When talking about (dynamically loading) a "shared library" on non-AIX 
> systems, the correct wording for AIX is (dynamically loading) a "Shared 
> Object" - independent of whether it is a standalone file or an archive member.
>
> As you already agreed on, ctypes.util.find_library() indeed should return the 
> location of the Shared Object - as either "/path/to/file" or 
> "/path/to/file(member)". And ctypes.CDLL() should add the RTLD_MEMBER flag to 
> _ctypes.dlopen() if there is the "(member)" part.
>
> However, that does not necessarily mean the RTLD_MEMBER value needs to be 
> available through the ctypes API. Instead, RTLD_MEMBER feels more appropriate 
> for the _ctypes API - and on AIX only.
>
> Anyway:
> Unfortunately, there is no concept of embedding something like ELF's 
> DT_SONAME tag into the Shared Object. The very (PATH,BASE,MEMBER) value as 
> (specified to and) discovered by the linker is recorded into the just-linked 
> executable (or Shared Object). This implies that the runtime loader does 
> search for the very same filename (and member eventually) as the linker (at 
> linktime).
I assume this is why there are many systems besides AIX that do not 
support/use DT_SONAME. At least I see many references to "Shared 
Objects" libFOO.so.X.Y.Z, libFOO.so.X.Y, libFOO.so.X and libFOO.so (with 
the latter three being symbolic links to the first).
>
> However, to still get some kind of shared library versioning, multiple 
> versions of one Shared Object are put into one single Archive Library, where 
> the "old" versions get the LOADONLY flag set (via 'strip -e') - so 
> executables linked against an old version still can load their "old" Shared 
> Object, while the linker discovers the "current" version only.
>
> But this "single-filename" based shared library versioning is a huge burden 
> for packages managers - either human or software, even when they maintain 
> their packages in a private prefix (like /opt/freeware, /usr/local and 
> similar). Neither can they put their "current" Shared Object's version into 
> the single (system's) Archive Library, nor can they mark existing Shared 
> Objects as LOADONLY.
> On the other hand, they also do not want to pull all the system versions into 
> their own Archive Library.
Another issue is support for what I believe MacOS calls "fat" objects - 
that support both 32-bit and 64-bit applications - rather than /XXX/lib 
for 32-bit objects and /XXX/lib/lib64 or /XXX/lib64 for 64-bit objects.
>
> So for package managers it is crucial to have "multi-filename" based shared 
> library versioning instead.
>
> But there is help:
> AIX also provides (plain text) "Import Files": They contain a list of symbols 
> for the linker, and a (PATH,BASE,MEMBER) tuple naming the Shared Object that 
> provides these symbols at runtime.
a) Yes to above
b) One of the difficulties I faced is trying to guess what version -lFOO 
should find when there is more than one version available. Applications 
that are already linked do not look for a latest version - they know the 
member name that the linker found initially. ctypes.utils.find_library() 
does not provide a way to say which version should be found. Each 
implementation has it's way to find a version (e.g., a search of 
ldconfig -p output for a best guess)
> So yes, Import Files can be used for "multi-filename" based shared library 
> versioning.
>
> Thus, libtool now offers the "--with-aix-soname=svr4" configure flag, where 
> "libNAME.so.X" really is created as an Archive Library, containing the Shared 
> Object "shr.o" with the LOADONLY flag set, and the Import File "shr.imp" 
> referring to "libNAME.so.X(shr.o)" for runtime. Combined with the symlink 
> "libNAME.so", for the "-lNAME" argument the linker discovers the Import File 
> "libNAME.so(shr.imp)" now, while recording "libNAME.so.X(shr.o)" into the 
> executable for the runtime loader.
> Note that for 64bit the Shared Object and Import File is named "shr_64.o" and 
> "shr_64.imp", respectively.
>
> While libtool's "--with-aix-soname=svr4" variant creates "libNAME.a" from 
> static Objects only, both libtool's "--with-aix-soname=aix" and 
> "--with-aix-soname=both" - for backwards compatibility - create "libNAME.a" 
> for traditional "single-filename" based versioning: Without any static Object 
> - as even Shared Objects can be linked statically(!). But to statically link 
> the Shared Object (as an archive member), neither the LOADONLY flag must be 
> set, nor an Import File must be found (as Import Files cannot serve for 
> static linking).
>
> And "--with-aix-soname=aix", libtool still creates standalone 
> 

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-03 Thread R. David Murray

R. David Murray added the comment:

But that reliance/reproducibility-error would be an issue only on interpreters 
that don't preserve insertion order, and we're expecting we'll make that a 
language requirement.  So for now, or for as long as you think it is warranted, 
just test against interpreters that randomize the order.

Note that this is different from the pre-randomization dict behavior, where 
lots of programs depended on the accident-of-the-implementation order in which 
keys were returned.  What we think is coming is a guaranteed ordering, which 
is, thus, reproducible.

--

___
Python tracker 

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



[issue18859] README.valgrind should mention --with-valgrind

2017-02-03 Thread Łukasz Langa

Changes by Łukasz Langa :


--
assignee:  -> lukasz.langa
nosy: +lukasz.langa

___
Python tracker 

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



[issue26876] Extend MSVCCompiler class to respect environment variables

2017-02-03 Thread Rohit Jamuar

Rohit Jamuar added the comment:

Steve, I've limited the changes to _msvccompiler for the master-branch's patch. 
Is it alright?

--

___
Python tracker 

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



Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Michael Torrie
On 02/03/2017 12:07 PM, Wildman via Python-list wrote:
> Sorry, I forgot something important.  If you use
> /etc/rc.local, the execute bit must be set.

I don't think this is what Neal Becker was asking about.  He's talking
about the Python module search path (sys.path) not the operating system
PATH variable.  Correct me if I'm wrong.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-03 Thread lamby

lamby added the comment:

I think we are misunderstanding each other regarding our goals here :)

I'm not trying to test against other Python implementations or versions of 
CPython itself but rather "flush out" reproducibility issues in third-party 
Python code that (incorrectly) relies on dict ordering being relatively stable 
and/or in insertion order, etc. etc.

(The only reason I mention 3.6 is because the insertion-order behaviour there 
simply makes it easier to have a 'reverse' order)

--

___
Python tracker 

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



[issue29428] Doctest documentation unclear about multi-line fixtures

2017-02-03 Thread Jim DeLaHunt

Jim DeLaHunt added the comment:

Marco, thank you for the suggestion to watch Raymond Hettinger's talk. 

> I suggest you to watch this talk of Raymond Hettinger, before going on:
>
> https://www.youtube.com/watch?v=voXVTjwnn-U

That video is 63 minutes long, and a lot of those minutes are taken up by 
stories. I will watch the rest when I get time. I wish his insights were 
summarised in writing; I'll bet that would take much less than 63 minutes to 
read. I find that written text is a much faster way to deliver information, 
though maybe it takes the teacher more time to write well than to give a talk.

I understand your point about the need for a review, and reviews being the 
bottleneck. The "Lifecycle of a Patch" document[1] is clear about that.

[1] https://docs.python.org/devguide/patch.html#reviewing

--

___
Python tracker 

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



[issue29428] Doctest documentation unclear about multi-line fixtures

2017-02-03 Thread Jim DeLaHunt

Jim DeLaHunt added the comment:

Marco, thank you for your prompt comment. 

However, 
> Maybe you are running the doctest with Python 3. The StringIO module is no 
> more available in Python 3, so your doctest will fail on Python 3 

Please let me be clear. This issue is not about the StringIO module or about 
any of my doctests. It is about the documentation of the doctests module, and 
the ways in which that documentation is less helpful than it could be.

--

___
Python tracker 

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



ANN: psutil 5.1.2 released

2017-02-03 Thread Giampaolo Rodola'
Hello all,
I'm glad to announce the release of psutil 5.1.2:
https://github.com/giampaolo/psutil

About
=

psutil (process and system utilities) is a cross-platform library for
retrieving information on running processes and system utilization (CPU,
memory, disks, network) in Python. It is useful mainly for system
monitoring, profiling and limiting process resources and management of
running processes. It implements many functionalities offered by command
line tools such as: ps, top, lsof, netstat, ifconfig, who, df, kill, free,
nice, ionice, iostat, iotop, uptime, pidof, tty, taskset, pmap. It
currently supports Linux, Windows, OSX, Sun Solaris, FreeBSD, OpenBSD and
NetBSD, both 32-bit and 64-bit architectures, with Python versions from 2.6
to 3.5 (users of Python 2.4 and 2.5 may use 2.1.3 version). PyPy is also
known to work.

What's new
==

*2017-02-03*

**Bug fixes**

- #966: [Linux] sensors_battery().power_plugged may erroneously return None
on
  Python 3.
- #968: [Linux] disk_io_counters() raises TypeError on python 3.
- #970: [Linux] sensors_battery()'s name and label fields on Python 3 are
bytes
  instead of str.

Links
=

- Home page: https://github.com/giampaolo/psutil
- Download: https://pypi.python.org/pypi/psutil
- Documentation: http://pythonhosted.org/psutil
- What's new: https://github.com/giampaolo/psutil/blob/master/HISTORY.rst

--

Giampaolo - http://grodola.blogspot.com
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Wildman via Python-list
On Fri, 03 Feb 2017 12:58:15 -0600, Wildman wrote:

> On Fri, 03 Feb 2017 11:06:00 -0500, Neal Becker wrote:
> 
>> I want to make sure any modules I build in the current directory overide any 
>> others.  To do this, I'd like sys.path to always have './' at the beginning.
>> 
>> What's the best way to ensure this is always true whenever I run python3?
> 
> In python, this method will work but it is only in effect
> for the running process that calls it while it is running.
> It is not system wide and it is not permanent.
> 
> import os
> os.environ["PATH"] = os.environ["PATH"] + ":./"
>   or
> os.environ["PATH"] = "./:" + os.environ["PATH"]
> 
> (assuming Linux platform)
> To make it permanent for a certain user, add one of
> these lines to /home/user/.profile and log out/in:
> 
> PATH="$PATH:./"
>   or
> PATH="./:$PATH"
> 
> To make it permanent for all users, add one of
> these pairs of lines to /etc/rc.local and reboot:
> 
> export PATH=$PATH:./
> exit 0
>   or
> export PATH=./:$PATH
> exit 0
> 
> Add 'exit 0' only if it doesn't exist already and it
> must be the last line.  If /etc/rc.local does not
> exist, create it.

Sorry, I forgot something important.  If you use
/etc/rc.local, the execute bit must be set.

-- 
 GNU/Linux user #557453
The cow died so I don't need your bull!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Wildman via Python-list
On Fri, 03 Feb 2017 11:06:00 -0500, Neal Becker wrote:

> I want to make sure any modules I build in the current directory overide any 
> others.  To do this, I'd like sys.path to always have './' at the beginning.
> 
> What's the best way to ensure this is always true whenever I run python3?

In python, this method will work but it is only in effect
for the running process that calls it while it is running.
It is not system wide and it is not permanent.

import os
os.environ["PATH"] = os.environ["PATH"] + ":./"
  or
os.environ["PATH"] = "./:" + os.environ["PATH"]

(assuming Linux platform)
To make it permanent for a certain user, add one of
these lines to /home/user/.profile and log out/in:

PATH="$PATH:./"
  or
PATH="./:$PATH"

To make it permanent for all users, add one of
these pairs of lines to /etc/rc.local and reboot:

export PATH=$PATH:./
exit 0
  or
export PATH=./:$PATH
exit 0

Add 'exit 0' only if it doesn't exist already and it
must be the last line.  If /etc/rc.local does not
exist, create it.

-- 
 GNU/Linux user #557453
The cow died so I don't need your bull!
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29395] Edit with IDLE 3.6 don´t work if Name of File "code.py"

2017-02-03 Thread Steve Dower

Steve Dower added the comment:

I assume this is because Idle is doing "import code" somewhere and picking up 
your file instead of the real one.

Renaming the file to not conflict with the standard library is an immediate 
workaround, but perhaps Idle should do some sys.path protection around wherever 
it's importing that module.

--
nosy: +steve.dower

___
Python tracker 

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



[issue26855] android: add platform.android_ver()

2017-02-03 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
assignee: xdegaye -> 

___
Python tracker 

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



[issue27640] add the '--disable-test-suite' option to configure

2017-02-03 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
assignee: xdegaye -> 

___
Python tracker 

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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-03 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
assignee: xdegaye -> 

___
Python tracker 

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



[issue29185] test_distutils fails on Android API level 24

2017-02-03 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
assignee: xdegaye -> 

___
Python tracker 

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



[issue29184] skip tests of test_socketserver when bind() raises PermissionError (non-root user on Android)

2017-02-03 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
assignee: xdegaye -> 

___
Python tracker 

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



[issue29181] skip tests that raise PermissionError in test_tarfile (non-root user on Android)

2017-02-03 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
assignee: xdegaye -> 

___
Python tracker 

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



[issue29180] skip tests that raise PermissionError in test_os (non-root user on Android)

2017-02-03 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
assignee: xdegaye -> 

___
Python tracker 

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



[issue28833] cross compilation of third-party extension modules

2017-02-03 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
assignee: xdegaye -> 

___
Python tracker 

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



[issue29437] installation not listed for all users

2017-02-03 Thread Steve Dower

Steve Dower added the comment:

Thanks, this is the same as issue25166.

In short, we need a significant update to the WiX framework before this can be 
enabled, and so far the core WiX developers are not interested in doing it. 
I've been working on a patch, but it's actually fairly complicated to get right 
and I haven't managed it yet.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Windows AllUsers installation places uninstaller in user profile

___
Python tracker 

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



Re: Meta: mailing list, bounces, and SPF?

2017-02-03 Thread Tim Golden

On 03/02/2017 18:15, Tim Chase wrote:

However, despite seeing messages appearing in the online archives,
I'm not receiving anything via email.  When I send a "subscribe"
message to mailman, it responds telling me that I'm already
subscribed (and checking the settings on the web interface confirm
that everything should be flowing).


Your email address had been tagged to receive no mail because of the 
bounces mailman was getting. (At least, I think that's what it was). 
I've cleared that now so you should be getting new emails via the list 
-- including this one!


TJG

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


Meta: mailing list, bounces, and SPF?

2017-02-03 Thread Tim Chase
Thanks to an abysmal failure of my hosting service (Site5), I was
without email for multiple days, and when it came back up, the SPF
record was pointed at the wrong place.  I normally get a steady
stream of comp.lang.python/python-list@ messages at my email address,
so when they/I finally got things sorted out, I expected a backlog of
a week's worth of c.l.p email, or at least for the mail to resume
flowing.

However, despite seeing messages appearing in the online archives,
I'm not receiving anything via email.  When I send a "subscribe"
message to mailman, it responds telling me that I'm already
subscribed (and checking the settings on the web interface confirm
that everything should be flowing).

Is there something I've missed to get the messages flowing again?

Thanks,

-tkc

PS: for obvious reasons, please CC me.







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


[issue29434] tuple.__repr__ may segv when it contains NULL

2017-02-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This looks similar to issue26811.

I think that if the reproducer is found it would be better to fix the case of 
leaking a tuple containing NULL rather than making repr() be aware of NULLs. 
repr() is not the only way to crash with such tuples.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29437] installation not listed for all users

2017-02-03 Thread Mike

New submission from Mike:

When installing Python 3.6 using the official installer and selecting "install 
for all users" from an account with admin privileges, the installation 
completes successfully and it shows in the list of installed programs for that 
user. However, because it's installation key is written into HKEY_CURRENT_USER, 
it is listed as installed program only for the user that ran the installation.

While Python still seems to run from another account, it is not listed as an 
installed program for the other user.

In the "install for all users" case, it should be registered in 
HKEY_LOCAL_MACHINE, instead of HKEY_CURRENT_USER.

--
components: Installation, Windows
messages: 286880
nosy: mray, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: installation not listed for all users
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



[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-03 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I concur with David and Inada on this one (it is likely to become a wasted 
effort and it impacts maintainability to try to support this even for the short 
run).

--
nosy: +rhettinger
resolution:  -> rejected
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



[issue29436] Compilation failure against Android NDK r14 beta 2

2017-02-03 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Here's a copy of $ANDROID_NDK/sysroot/usr/include/langinfo.h. (/sysroot/ stores 
unified headers [1]) To use those headers correctly, packagers have to add 
-D__ANDROID_API__=XY to CPPFLAGS. On the other hand, __ANDROID_API_FUTURE__ is 
defined in $ANDROID_NDK/sysroot/usr/include/android/api-level.h:

/*
 * Magic version number for a current development build, which has
 * not yet turned into an official release.
 */
#ifndef __ANDROID_API_FUTURE__
#define __ANDROID_API_FUTURE__ 1
#endif

As a result nl_langinfo() does not exist in all real API versions.

[1] 
https://android.googlesource.com/platform/ndk.git/+/master/docs/UnifiedHeaders.md

--
Added file: http://bugs.python.org/file46504/langinfo.h

___
Python tracker 

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



[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-03 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue29436] Compilation failure against Android NDK r14 beta 2

2017-02-03 Thread Chi Hsuan Yen

New submission from Chi Hsuan Yen:

Since Android NDK r14 beta 2, unified headers provide langinfo.h but there's no 
nl_langinfo() in it, causing linking failures:

libpython3.7m.a(pylifecycle.o): In function `get_locale_encoding':
/home/yen/Projects/python3-android/src/cpython/Python/pylifecycle.c:234: 
undefined reference to `nl_langinfo'
libpython3.7m.a(fileutils.o): In function `_Py_device_encoding':
/home/yen/Projects/python3-android/src/cpython/Python/fileutils.c:65: undefined 
reference to `nl_langinfo'
libpython3.7m.a(_localemodule.o): In function `PyLocale_nl_langinfo':
/home/yen/Projects/python3-android/src/cpython/./Modules/_localemodule.c:447: 
undefined reference to `nl_langinfo'

Or compiler errors due to implicit function declarations if the patch at 
issue22747 is applied.

nl_langinfo.patch fixes it by adding some extra guarding macros.

Added some people from issue22747 to the nosy list, where the last change about 
langinfo.h and Android occurred.

--
components: Build
files: nl_langinfo.patch
keywords: patch
messages: 286877
nosy: Chi Hsuan Yen, haypo, skrah, xdegaye
priority: normal
severity: normal
status: open
title: Compilation failure against Android NDK r14 beta 2
type: compile error
versions: Python 3.7
Added file: http://bugs.python.org/file46503/nl_langinfo.patch

___
Python tracker 

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



[issue29433] any, all and sum should accept variadic args

2017-02-03 Thread Steven D'Aprano

Steven D'Aprano added the comment:

> Do you think I should send a mail to the ideas list?

Personally, I don't think so. You want to write any(a, b, c, d), 
but you can get the same effect now by writing any([a, b, c, d]).
There is unlikely to be any significant performance difference.

--

___
Python tracker 

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



best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Neal Becker
I want to make sure any modules I build in the current directory overide any 
others.  To do this, I'd like sys.path to always have './' at the beginning.

What's the best way to ensure this is always true whenever I run python3?

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


Re: Fw: Context

2017-02-03 Thread Terry Reedy

On 2/3/2017 8:10 AM, Antonio wrote:


I have python version 3.6.0 installed into my desktop)windows 7) but the 
menu/context (file,edit..etc) is missing.


Run IDLE (there should be a Start menu icon) or install or run another IDE.

--
Terry Jan Reedy

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


[issue29423] using concurrent.futures.ProcessPoolExecutor in class giving 'TypeError: can't pickle _thread.RLock objects' in 3.6, but not 3.5

2017-02-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue29423] using concurrent.futures.ProcessPoolExecutor in class giving 'TypeError: can't pickle _thread.RLock objects' in 3.6, but not 3.5

2017-02-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Josh> There is nothing to fix behaviorally on Python's side ...
Serhiy> I concur with Josh

This implies to me that we should close this as 'not a bug', with possibly a 
new issue for better error reporting.

--

___
Python tracker 

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



Re: Context

2017-02-03 Thread William Ray Wing

> On Feb 3, 2017, at 8:10 AM, Antonio  wrote:
> 
> From: Antonio
> Sent: Friday, February 3, 2017 1:02 PM
> To: python-list@python.org
> Subject: Context
> 
> I have python version 3.6.0 installed into my desktop)windows 7) but the 
> menu/context (file,edit..etc) is missing.
> 
> How to fix this problem?
> 

python, is not a GUI program, it doesn’t have a menu of actions.  If you want 
to surround python with a GUI you would have to install any of several IDEs 
(Integrated Development Environments) which will let you create python 
programs, edit them, and test them interactively.  Not being a Windows user, I 
shouldn't recommend any particular one.

Bill

> 
> Thanks
> 
> 
> Antonio
> 
> 
>  
> [cid:36574bcd-0958-41f0-a1b3-2c34586b236a]
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


[issue29433] any, all and sum should accept variadic args

2017-02-03 Thread sedrubal

sedrubal added the comment:

Thanks for your answers and for showing the issue with sum.

I think this would make python just a bit more sexier as it already is ;) Are 
there any other disadvantages (performance, ...)?

Do you think I should send a mail to the ideas list?

--

___
Python tracker 

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



[issue29347] Python 2.7.8 is crashing while creating weakref for a given object.

2017-02-03 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang
versions:  -Python 3.3, Python 3.4

___
Python tracker 

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



[issue29376] threading._DummyThread.__repr__ raises AssertionError

2017-02-03 Thread Xiang Zhang

Xiang Zhang added the comment:

This seems an regression from #18808, so nosy Tim and Antoine. Since 
_DummyThread is always alive and daemonic, I think the solution could be 
overriding is_alive in _DummyThread and always returning True.

--
keywords: +patch
nosy: +xiang.zhang
stage:  -> patch review
type:  -> behavior
versions: +Python 3.5, Python 3.6, Python 3.7 -Python 3.4
Added file: http://bugs.python.org/file46502/issue29376.patch

___
Python tracker 

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



[issue29376] threading._DummyThread.__repr__ raises AssertionError

2017-02-03 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +pitrou, tim.peters

___
Python tracker 

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



[issue15451] PATH is not honored in subprocess.Popen in win32

2017-02-03 Thread Anthony Scopatz

Changes by Anthony Scopatz :


--
nosy: +Anthony Scopatz
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



[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-03 Thread R. David Murray

R. David Murray added the comment:

Inada: we haven't 100% decided that this is going to become a language feature. 
 However it is likely to become so, so adding such a flag is probably wasted 
effort.  Further, if the goal is to test compatibility with other python 
implementations, shouldn't you actually be testing against those other 
implementations?  You are likely to catch more problems than just dict order 
that way.  So I vote -1 on this.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue29428] Doctest documentation unclear about multi-line fixtures

2017-02-03 Thread R. David Murray

R. David Murray added the comment:

And thanks for wanting to improve the docs!

--

___
Python tracker 

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



[issue29428] Doctest documentation unclear about multi-line fixtures

2017-02-03 Thread R. David Murray

R. David Murray added the comment:

It does appear that "test" is being used ambiguously in the docs.  In most 
places it means a single statement, but in execution context it appears to be 
being used as a synonym for "docstring".  In that section it should be replaced 
by "docstring".  It would probably be worth checking the rest of the doc to 
make sure it is used consistently elsewhere as well.

As for the prompts, I agree with Marco: I don't think there is any need to add 
words, since it clearly says it is supposed to look like an interactive session 
and the reader gets reminded of the rules for that by the example provided.  
IMO it is not appropriate to re-document those rules here.  However, if you 
come up with a really concise addition that clarifies it, we'll consider it.

I don't think an additional example of using previous state is required, and 
certainly not an additional section.  The execution context section makes it 
clear that you can use names defined earlier, as does the fact that doctests 
emulate interactive sessions.  Both of these make it clear you can do multi 
line examples that use shared state.  However, if you come up with an example 
that adds value to the documentation, we'll certainly consider it.

So in summary, I think we *need* a one word change in the execution context 
section, and we'll consider any other enhancements you want to propose.

--
nosy: +r.david.murray
versions: +Python 2.7, 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



[issue29435] Allow to pass fileobj to is_tarfile

2017-02-03 Thread Thom Wiggers

New submission from Thom Wiggers:

The tarfile.is_tarfile() function only supports opening from paths. However, 
the `Tarfile` class also supports opening from `fileobj`s. It would be useful 
if the is_tarfile function would also accept those.

For reference, this is the current implementation: 
https://github.com/python/cpython/blob/fcc3915a266b6cd220483c7020de0d71e293b2cb/Lib/tarfile.py#L2432

--
components: Library (Lib)
messages: 286869
nosy: twiggers
priority: normal
severity: normal
status: open
title: Allow to pass fileobj to is_tarfile
type: enhancement

___
Python tracker 

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



[issue29423] using concurrent.futures.ProcessPoolExecutor in class giving 'TypeError: can't pickle _thread.RLock objects' in 3.6, but not 3.5

2017-02-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It was backported but later reverted (54dd5c105334).

I concur with Josh. Thank you for good analysis Josh.

As for your idea about more detailed error reporting, I think it can be 
implemented. Separate exception can be raised for every object in the chain, 
with chaining one exception to other. This is separate issue.

--

___
Python tracker 

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



  1   2   >