[issue25783] test_traceback.test_walk_stack() fails when run directly (without regrtest)

2015-12-03 Thread Nan Wu

Nan Wu added the comment:

Put in a fix. Let me know if it looks ok.

--
nosy: +Nan Wu
Added file: 
http://bugs.python.org/file41232/fix_test_walk_stack_failed_as_script_patch

___
Python tracker 

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



[issue25755] Test test_property failed if run twice

2015-12-03 Thread Nan Wu

Nan Wu added the comment:

Thanks for catching this failure. In the patch, property doc is restore after 
write operation.

--
nosy: +Nan Wu
Added file: 
http://bugs.python.org/file41233/fix_test_property_doc_writable_patch

___
Python tracker 

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



[issue14285] Traceback wrong on ImportError while executing a package

2015-12-03 Thread Nick Coghlan

Nick Coghlan added the comment:

I'm wondering if there might be a simpler option: use rpartition() to strip off 
any trailing segment (whether that's "__main__" or not), and then always do a 
plain dynamic import of that package (if any). Something like the following at 
the start of _get_module_details():

pkg_name, is_submodule, submodule = mod_name.rpartition(".")
if is_submodule:
__import__(pkg_name)

The key is that we *don't* want to be relying on the fact find_spec() will 
import parent packages implicitly.

--

___
Python tracker 

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



[issue15068] fileinput requires two EOF when reading stdin

2015-12-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions: +Python 2.7
Added file: http://bugs.python.org/file41226/fileinput_no_buffer-2.7.patch

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-12-03 Thread Florin Papa

Florin Papa added the comment:

Hi Antoine,
 
The Py_INIT_BOUNDS calls were used because MPX generated a very large number of 
error messages about pointer bounds violations at compile or run time, that 
made Python unusable. The approach was to analyze the errors and ignore 
checking if no obvious violation took place, in the hope to find the root cause.
 
The problem is that the errors can come from an actual bug or from a false 
positive that can be propagated throughout the code. While we could not find 
evidence of actual bugs, we found 2 examples of the latter, in listobject.c 
(line 1100, in the binarysort function) and dictobject.c (line 1797 in 
dict_keys function and line 1892 in dict_items).
 
The problem is caused by this coding pattern that is used in the two instances 
mentioned above: a pointer to an allocated memory zone is used to access a 
different allocated memory zone by adding the difference between their start 
addresses to that pointer. Although this newly formed address is valid, in the 
context of the pointer used for this operation it is outside its bounds so it’s 
signaled as a bounds violation.
 
p **  q *---*
   <-->
 offset

p and q point to valid memory zones, being separated by an offset. If we do 
something like 
   new_pointer = q – offset; // which is actually equal to p
   value = *new_pointer;  // dereferencing will generate an MPX 
bounds violation, because
  // new_pointer will keep q’s original 
bounds
 
I will rewrite the code for these cases and provide the new patch as soon as I 
have it.

Regards,
Florin

--

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-12-03 Thread Florin Papa

Florin Papa added the comment:

Hi Stefan,

> Yes, I dislike that, too.  The question is why gcc has supported
> the "struct hack" for more than 20 years but needs an annotation
> just for MPX.
The "struct hack" represents a problem for MPX because it intentionally exceeds 
the bounds of the array declared inside in order to support a variable sized 
structure. Without the Py_VARIABLE_SIZE annotation, MPX will generate a bounds 
violation when accessing outside the declared size of the array.

> Is the annotation also needed for the C99 version (ob_array[])?
I tested and for the C99 version the annotation is not needed. Apparently 
ob_array inherits the bounds of the structure in this case.

Regards,
Florin

--

___
Python tracker 

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



[issue15068] fileinput requires two EOF when reading stdin

2015-12-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue24934] django_v2 benchmark not working in Python 3.6

2015-12-03 Thread Florin Papa

Florin Papa added the comment:

I have adapted the existent patch to the new benchmarks codebase. Please see 
the new patch (django_v3_2.patch) in the files section. The benchmark expects 
to have django in lib/Django-1.9 folder. The Django-1.9 sources are attached 
separately because of their size.

hg clone https://hg.python.org/benchmarks
cd benchmarks/
copy django_v3_2.patch to the current directory and Django-1.9.tar.gz to the 
lib/ directory
hg import --no-commit django_v3_2.patch
cd lib/
tar -xvf Django-1.9.tar.gz

--
Added file: http://bugs.python.org/file41221/django_v3_2.patch

___
Python tracker 

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



[issue24934] django_v2 benchmark not working in Python 3.6

2015-12-03 Thread Florin Papa

Changes by Florin Papa :


Added file: http://bugs.python.org/file41222/Django-1.9.tar.gz

___
Python tracker 

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



[issue15068] fileinput requires two EOF when reading stdin

2015-12-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file41224/fileinput_no_buffer.patch

___
Python tracker 

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



[issue15068] fileinput requires two EOF when reading stdin

2015-12-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file41225/fileinput_no_buffer.patch

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-03 Thread Eryk Sun

Eryk Sun added the comment:

REG_SZ and REG_EXPAND_SZ are documented as null-terminated strings [1], which 
shouldn't have an embedded null character. As such, the default result in the 
high-level environment of Python shouldn't have embedded nulls. However, since 
the buffer is sized, I think setting a REG_SZ or REG_EXPAND_SZ value with 
embedded nulls should be allowed. (My test function relies on this. :)

winreg could add a QueryRawValue[Ex] function that always returns the data as 
bytes. It just has to pass the type as REG_BINARY to Reg2PY:

case REG_BINARY:
/* ALSO handle ALL unknown data types here.  Even if we can't
   support it natively, we should handle the bits. */
default:
if (retDataSize == 0) {
Py_INCREF(Py_None);
obData = Py_None;
}
else
obData = PyBytes_FromStringAndSize(
 (char *)retDataBuf, retDataSize);

The problem with REG_SZ also exists in Python 2, but I didn't backport the 
patch. However, Anshul's error occurs in os.path.abspath, which doesn't mind 
nulls in Python 2:

>>> os.path.abspath(u'a string\x00 with a null')
u'Z:\\Temp\\a string'

whereas Python 3's implementation calls the built-in function 
os.path._getfullpathname. This uses the path_converter function defined in 
Modules/posixmodule.c, which rejects paths that have an embedded null:

>>> os.path.abspath('a string\x00 with a null')
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Program Files\Python 3.5\lib\ntpath.py", line 535, in abspath
path = _getfullpathname(path)
ValueError: _getfullpathname: embedded null character


[1]: https://msdn.microsoft.com/en-us/library/ms724884

--

___
Python tracker 

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



[issue24934] django_v2 benchmark not working in Python 3.6

2015-12-03 Thread Florin Papa

Florin Papa added the comment:

I have attached django_v3_3.patch, as the previous one did not include the 
added file (performance/bm_django_v3.py).

--
Added file: http://bugs.python.org/file41223/django_v3_3.patch

___
Python tracker 

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



[issue15068] fileinput requires two EOF when reading stdin

2015-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Using readlines() instead of readline() was added in 4dbbf322a9df for 
performance. But it looks that now this is not needed. Naive implementation 
with readline() is about 2 times slower, but with careful optimization we can 
achieve the same performance (or better).

Here are results of benchmarks.

Unpatched:

$ mkdir testdir
$ for i in `seq 10`; do for j in `seq 1000`; do echo "$j"; done 
>"testdir/file$i"; done
$ ./python -m timeit -s "import fileinput, glob; files = 
glob.glob('testdir/*')" -- "f = fileinput.input(files)" "while f.readline(): 
pass"
10 loops, best of 3: 56.4 msec per loop
$ ./python -m timeit -s "import fileinput, glob; files = 
glob.glob('testdir/*')" -- "list(fileinput.input(files))"10 loops, best of 3: 
68.4 msec per loop

Patched:

$ ./python -m timeit -s "import fileinput, glob; files = 
glob.glob('testdir/*')" -- "f = fileinput.input(files)" "while f.readline(): 
pass"
10 loops, best of 3: 47.4 msec per loop
$ ./python -m timeit -s "import fileinput, glob; files = 
glob.glob('testdir/*')" -- "list(fileinput.input(files))"
10 loops, best of 3: 63.1 msec per loop

The patch also fixes original issue.

It also fixes yet one issue. Currently lines are buffered and you need to enter 
many lines first then get first line:

>>> import fileinput
>>> fi = fileinput.input()
>>> line = fi.readline()
qwerty
asdfgh
zxcvbn
^D
>>> line
'qwerty\n'

With the patch you get the line just as it entered.

--
assignee: docs@python -> serhiy.storchaka
stage: needs patch -> patch review
versions: +Python 3.4, Python 3.5, Python 3.6 -Python 2.7, Python 3.2, Python 
3.3
Added file: http://bugs.python.org/file41224/fileinput_no_buffer.patch

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-03 Thread Eryk Sun

Eryk Sun added the comment:

> add a QueryRawValue[Ex] function 

Or QueryValueEx and EnumValue could take a boolean argument named "raw" or 
"binary", which if True forces the data to be returned as REG_BINARY regardless 
of its assigned type.

--

___
Python tracker 

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



[issue25144] 3.5 Win install fails with "TARGETDIR"

2015-12-03 Thread Ben

Ben added the comment:

Still a problem with python-2.7.10.amd64.msi. A bit surprising that this has 
not been addressed since 2015.05.23...

--
nosy: +cbj4074

___
Python tracker 

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



[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2015-12-03 Thread Laura Creighton

New submission from Laura Creighton:

Right now there is no way, aside from writing your own openhook, to
get around the limitation that openhook=fileinput.hook_encoded("utf")
will open things with the default option for codecs.open()
of errors=strict.  Adding a way to pass the errors argument seems
both easy to do and useful.

--
components: IO
messages: 255818
nosy: lac, serhiy.storchaka
priority: normal
severity: normal
status: open
title: fileinput.hook_encoded has no way to pass arguments to codecs
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, 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



[issue23936] Wrong references to deprecated find_module instead of find_spec

2015-12-03 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee: docs@python -> brett.cannon

___
Python tracker 

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



[issue25709] Problem with string concatenation and utf-8 cache.

2015-12-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions:  -Python 3.4, 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



[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2015-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It would be easy to add the errors parameter to fileinput.hook_encoded().

Do you want to provide a patch Laura?

--
components: +Library (Lib)
keywords: +easy
stage:  -> needs patch
type:  -> enhancement
versions:  -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue11822] Improve disassembly to show embedded code objects

2015-12-03 Thread Todd Dembrey

Changes by Todd Dembrey :


--
nosy: +Todd Dembrey

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-03 Thread Anshul Agrawal

Anshul Agrawal added the comment:

Thanks David, and yes I had guessed as much.  Will continue to monitor these 
emails for a while, in case action is needed from my side.

>From an end user perspective, it was discouraging to encounter a bug like this 
>at such an early stage of using Python3 (and associated packages) as a tool 
>for Data Analysis, especially since it's been around for a few years.  Glad to 
>see such a spirited debugging effort.  Hoping for a successful outcome.  :-)

--

___
Python tracker 

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



[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2015-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

https://docs.python.org/devguide/#contributing

--
components: +Library (Lib)
type:  -> enhancement
versions:  -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-03 Thread R. David Murray

R. David Murray added the comment:

Anshul: you don't need to worry about this technical discussion unless our 
windows experts decide this is in fact a bug in matplotlib and/or your 
machine's registry :)

--

___
Python tracker 

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



[issue23936] Wrong references to deprecated find_module instead of find_spec

2015-12-03 Thread Thomas Kluyver

Thomas Kluyver added the comment:

I also ran into confusion with this while trying to write an import hook.

Attached is my shot at a docs patch. I've done a slightly larger rewording, 
trying to make it easier to understand, and added more links between parts of 
the docs.

I left mentions of the deprecated find_module and find_loader methods in the 
'finder' glossary entry, but for sys.meta_path I have only described 
find_spec() - it does still fall back to the deprecated methods, but I thought 
that trying to explain that would make the description of meta_path harder to 
follow.

--
nosy: +takluyver
Added file: http://bugs.python.org/file41227/finders_and_specs.patch

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-03 Thread Zachary Ware

Zachary Ware added the comment:

There's also backward compatibility to consider here; someone somewhere is 
depending on getting back \0 in his REG_SZes.  If we were to make a change, it 
could only go in 3.6.  With that restriction, I don't see a particularly nice 
way to get the same behavior from 3.6+ and 3.5-.

Also, I don't like the idea of having a mismatch between what we set and what 
we get, even if what we're setting technically shouldn't be allowed.

I'm more inclined to just document that REG_SZ and REG_EXPAND_SZ values may 
contain nulls if the key was added improperly.

--
versions:  -Python 2.7, Python 3.5

___
Python tracker 

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



[issue25789] py launcher stderr is not piped to subprocess.Popen.stderr

2015-12-03 Thread Wolfgang Maier

New submission from Wolfgang Maier:

from the console:

> py -3.7

or any other not installed Python version gives:
Requested Python version (3.7) not installed


However, when the launcher is executed from python via subprocess.Popen:

>>>import subprocess
>>>p=subprocess.Popen(['py', '-3.7'], stdout=subprocess.PIPE, 
>>>stderr=subprocess.PIPE)
>>>p.communicate()
(b'', b'')

the error message is not accessible. (Error messages from any successfully 
launched Python interpreter are available through p.stderr though.)

--
components: Windows
messages: 255822
nosy: paul.moore, steve.dower, tim.golden, wolma, zach.ware
priority: normal
severity: normal
status: open
title: py launcher stderr is not piped to subprocess.Popen.stderr
type: behavior
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



[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2015-12-03 Thread Laura Creighton

Laura Creighton added the comment:

I haven't made a patch to Python for over 10 years. Before mercurial. :) Where 
do you start in terms of 'how to submit a patch'?

--
components:  -Library (Lib)
type: enhancement -> 
versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2015-12-03 Thread R. David Murray

R. David Murray added the comment:

Mercurial didn't change the patch submission process (we're talking about 
making such changes on python-workflow now...or rather enhancements as the 
current process should continue to work).  The only thing that mercurial 
changed is how you get a copy of the current repo.  After that (which is 
explained in the devguide), just make your changes, do 'hg diff', and attach 
the diff file to the issue as usual.

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-03 Thread random832

random832 added the comment:

Your "backward compatibility" argument makes me think of https://xkcd.com/1172/

99% of programs written in C or other languages will cut the value off at the 
first null. One consequence of which is that no-one (except an unfortunate 
Python program) will _notice_ that one "was added improperly", which makes 
Python the squeaky wheel for breaking when encountering a value nothing else 
had any problem with.

This behavior is "out-there" enough that I think the claim that someone is 
relying on it should be justified with a concrete example.

--

___
Python tracker 

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



[issue12923] test_urllib fails in refleak mode

2015-12-03 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +martin.panter

___
Python tracker 

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



[issue24903] Do not verify destdir argument to compileall

2015-12-03 Thread R. David Murray

Changes by R. David Murray :


--
stage: needs patch -> commit review

___
Python tracker 

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



[issue25790] shutil.chown function enhancement

2015-12-03 Thread YoSTEALTH

New submission from YoSTEALTH:

A very simple but useful enhancement for shutil.chown function

Currently "shutil.chown" function effects only one directory or file user/group 
permission by adding "recursive" parameter it can easily effect all 
sub-directories/files

Source: https://hg.python.org/cpython/file/3.5/Lib/shutil.py#l1007


# Current:
def chown(path, user=None, group=None):

"""Change owner user and group of the given path.


user and group can be the uid/gid or the user/group names, and in that case,

they are converted to their respective uid/gid.

"""


if user is None and group is None:

raise ValueError("user and/or group must be set")


_user = user

_group = group


# -1 means don't change it

if user is None:

_user = -1

# user can either be an int (the uid) or a string (the system username)

elif isinstance(user, str):

_user = _get_uid(user)

if _user is None:

raise LookupError("no such user: {!r}".format(user))


if group is None:

_group = -1

elif not isinstance(group, int):

_group = _get_gid(group)

if _group is None:

raise LookupError("no such group: {!r}".format(group))


os.chown(path, _user, _group)


# Enhanced:

import os.path


# Internal Function
def _dir_walk(path):
''' Get All Directories & Files'''

for dir_path, dir_names, file_names in os.walk(path):

# Directories
for dir_name in dir_names:
yield os.path.join(dir_path, dir_name)

# Files
for file_name in file_names:
yield os.path.join(dir_path, file_name)

def chown(path, user=None, group=None, recursive=False):

"""Change owner user and group of the given path.


user and group can be the uid/gid or the user/group names, and in that case,

they are converted to their respective uid/gid.

"""


if user is None and group is None:

raise ValueError("user and/or group must be set")


_user = user

_group = group


# -1 means don't change it

if user is None:

_user = -1

# user can either be an int (the uid) or a string (the system username)

elif isinstance(user, str):

_user = _get_uid(user)

if _user is None:

raise LookupError("no such user: {!r}".format(user))


if group is None:

_group = -1

elif not isinstance(group, int):

_group = _get_gid(group)

if _group is None:

raise LookupError("no such group: {!r}".format(group))

# Default Do First
if not recursive:
os.chown(path, _user, _group)
else:
for recursive_path in _dir_walk(path):
os.chown(recursive_path, _user, _group)


hope this helps :)

--
hgrepos: 324
messages: 255834
nosy: YoSTEALTH
priority: normal
severity: normal
status: open
title: shutil.chown function enhancement
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



[issue22709] restore accepting detached stdin in fileinput binary mode

2015-12-03 Thread R. David Murray

Changes by R. David Murray :


--
stage:  -> commit review

___
Python tracker 

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



[issue20954] Bug in subprocess._args_from_interpreter_flags causes MemoryError

2015-12-03 Thread R. David Murray

Changes by R. David Murray :


--
stage:  -> commit review

___
Python tracker 

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



[issue25793] ">""

2015-12-03 Thread R. David Murray

Changes by R. David Murray :


Removed file: http://bugs.python.org/file41229/s.php

___
Python tracker 

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



[issue25787] Add an explanation what happens with subprocess parent and child processes when signals are sent

2015-12-03 Thread Martin Panter

Martin Panter added the comment:

These are mainly questions of the OS, not really of Python or the subprocess 
module. I’m not sure the Python documentation is the right place for this 
information, unless it gives a misleading impression.

At least in Unix, signals may be sent to the child process only, or to a 
process group including the parent and the child. Processes can run 
concurrently, in which case the order is meaningless.

Signal handlers are inherited when os.fork() or similar copies a process, but 
cannot be inherited when a process is replaced or spawned, because the child is 
not a copy of the parent.

I think the “restore_signals” flag is an unnecessary and could be deprecated. 
The purpose of Python ignoring some signals is so that things like writing to a 
disconnected pipe or socket does not trigger the default signal handling.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25790] shutil.chown function enhancement

2015-12-03 Thread YoSTEALTH

YoSTEALTH added the comment:

Thanks David.

I hope this is what a patch file should be! Attached.

--
keywords: +patch
Added file: http://bugs.python.org/file41230/shutil.patch

___
Python tracker 

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



[issue25793] spam

2015-12-03 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
title: ">"" spam

___
Python tracker 

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



[issue25790] shutil.chown function enhancement

2015-12-03 Thread R. David Murray

R. David Murray added the comment:

You still didn't describe in prose what your proposed enhancement is, but 
looking at the patch I can now see you are proposing to add a recursive flag.

This has already been proposed and discussed, and the conclusion was a separate 
function would be better (like remove versus rmtree).  The proposed chowntree 
patch appears to be in limbo; perhaps you could pick it up and move it forward. 
 See issue 13033 for details.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Add shutil.chowntree

___
Python tracker 

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



[issue23936] Wrong references to deprecated find_module instead of find_spec

2015-12-03 Thread Martin Panter

Martin Panter added the comment:

Thanks for adding that link to ModuleSpec, it is definitely needed to make 
sense of a lot of stuff.

I left some review comments and questions.

If the behaviour of sys.meta_path has changed, I think it needs a “New/changed 
in version X” notice. If it makes the modern description hard to follow, maybe 
keep it in a separate paragraph.

--
nosy: +martin.panter
stage:  -> patch review

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-03 Thread Eryk Sun

Eryk Sun added the comment:

> I don't like the idea of having a mismatch between what we set and
> what we get, even if what we're setting technically shouldn't be 
> allowed.

Currently if you set a string with null, you won't see it using either 
regedit.exe or reg.exe:

>>> import os, winreg
>>> data = "a string\x00 with a null"
>>> HKCU = winreg.HKEY_CURRENT_USER
>>> winreg.SetValueEx(HKCU, "test", 0, winreg.REG_SZ, data)
>>> winreg.QueryValueEx(HKCU, "test")
('a string\x00 with a null', 1)

>>> os.system('reg query HKCU /v test')

HKEY_CURRENT_USER
testREG_SZa string

0

The registry saves the whole buffer, agnostic to the type, but clearly 
Microsoft has documented and treats REG_SZ as a null-terminated string. We 
should follow suit.

--

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-03 Thread Zachary Ware

Zachary Ware added the comment:

Ok, that example is an argument I'll accept.

I'll give the patch another couple of days for others to review, and commit if 
nobody beats me to it.  It's too late for 3.5.1, but it can probably make 3.4.4.

--
stage: patch review -> commit review
versions: +Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue14285] Traceback wrong on ImportError while executing a package

2015-12-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c4e950338e79 by Martin Panter in branch '2.7':
Issue #14285: Do not catch ImportError from __init__.py in runpy
https://hg.python.org/cpython/rev/c4e950338e79

--

___
Python tracker 

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



[issue14285] Traceback wrong on ImportError while executing a package

2015-12-03 Thread Martin Panter

Martin Panter added the comment:

Even with my committed fix, tracebacks triggered by initializing a parent 
package are still suppressed:

$ ./python -m hello
Traceback (most recent call last):
  File "/media/disk/home/proj/python/cpython/Lib/runpy.py", line 158, in 
_run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/media/disk/home/proj/python/cpython/Lib/runpy.py", line 116, in 
_get_module_details
__import__(mod_name)  # Do not catch exceptions initializing package
  File "/media/disk/home/proj/python/cpython/hello/__init__.py", line 1, in 

import random; random.dsgjdgj
AttributeError: module 'random' has no attribute 'dsgjdgj'
[Exit 1]
$ ./python -m hello.submodule
/media/disk/home/proj/python/cpython/python: Error while finding spec for 
'hello.submodule' (: module 'random' has no attribute 
'dsgjdgj')
[Exit 1]

Fixing this in general might require a loop around the find_spec() call as in 
init-ancestor.patch. But I’m unsure if it is worth the extra complication.

--
Added file: http://bugs.python.org/file41231/init-ancestor.patch

___
Python tracker 

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



[issue23220] Documents input/output effects of how IDLE runs user code

2015-12-03 Thread irdb

Changes by irdb :


--
nosy: +irdb

___
Python tracker 

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



[issue25787] Add an explanation what happens with subprocess parent and child processes when signals are sent

2015-12-03 Thread Karl Richter

Karl Richter added the comment:

Please also explain how to deal with process replacement in child processes 
(assuming that 
http://stackoverflow.com/questions/34059576/how-to-register-a-signal-handler-for-a-subprocess/34065587#34065587
 is correct).

--

___
Python tracker 

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



[issue19543] Add -3 warnings for codec convenience method changes

2015-12-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c89a0f24d5f6 by Serhiy Storchaka in branch '2.7':
Issue #19543: Added Py3k warning for decoding unicode.
https://hg.python.org/cpython/rev/c89a0f24d5f6

--

___
Python tracker 

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



[issue25789] py launcher stderr is not piped to subprocess.Popen.stderr

2015-12-03 Thread Eryk Sun

Eryk Sun added the comment:

The error() function in PC/launcher.c should call exit(rc) instead of 
ExitProcess(rc). This allows the CRT to terminate properly and flush the stderr 
FILE stream. With this change it works as expected:

>>> import subprocess
>>> p = subprocess.Popen(r'amd64\py_d -3.7', stderr=subprocess.PIPE)
>>> p.stderr.read()
b'Requested Python version (3.7) not installed\r\n'

--
keywords: +patch
nosy: +eryksun
stage:  -> patch review
Added file: http://bugs.python.org/file41228/issue25789_1.patch

___
Python tracker 

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