[issue10395] new os.path function to extract common prefix based on path components

2015-03-20 Thread Paddy McCarthy

Paddy McCarthy added the comment:

Can we now:
 1. Move os.path.commonprefix to str.commonprefix or string.commonprefix
 2. Deprecate the use of os.path.commonprefix
 3. Add os.path.commonpath
 4. Update the documentation.

This seems to have lingered for too long and yet people have been willing to do 
the work it seems (from 1999).

--
nosy: +Paddy McCarthy

___
Python tracker 

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



[issue23704] Make deques a full MutableSequence by adding index(), insert(), and copy()

2015-03-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

When appending fails, the deque is left in changed state. I would do it in 
different way. First append new item (can fail), and then make circular shift 
(never fail). This also should be faster (up to 2 times). Most code can be 
shared between rotate() and circular shift operation.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue15011] Change Scripts to bin on Windows

2015-03-20 Thread Steve Dower

Steve Dower added the comment:

Right now I'm inclined to reject it completely, if only for backwards 
compatibility (there was certainly strong opposition on python-dev recently).

That said, there's some ongoing discussion about what a python.org installation 
is meant to look like, which may lead to an opportunity to change this as part 
of wider changes. If something comes of that, the install location may be able 
to (or need to) change, but until then this seems like a change for change's 
sake and is not compelling.

If that means we should close this now and reopen later, happy to do that. But 
without a plan to implement it, we should definitely close this rather than 
reassign it to 3.6.

--

___
Python tracker 

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



[issue9445] Fix undefined symbol errors on VS8.0 build

2015-03-20 Thread Steve Dower

Steve Dower added the comment:

The patch is obsolete, but Martin is correct - we can drop the detection 
completely. Any concerns?

(Reading through the issue, there may be some value in a more general 
GetFinalPathNameByHandle wrapper that can get VOLUME_NAME_DOS if available and 
VOLUME_NAME_NT as a fallback, but presumably we'd have heard someone ask in the 
last five years if this was really needed.)

--
Added file: http://bugs.python.org/file38618/9445.patch

___
Python tracker 

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



[issue22832] Tweak parameter names for fcntl module

2015-03-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is worth a discussion on Python-Dev.
http://comments.gmane.org/gmane.comp.python.devel/152025

--

___
Python tracker 

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



[issue23704] Make deques a full MutableSequence by adding index(), insert(), and copy()

2015-03-20 Thread Raymond Hettinger

New submission from Raymond Hettinger:

Attaching an updated patch with documentation updates and tests.

--
Added file: http://bugs.python.org/file38617/deque_insert_index_copy4.diff

___
Python tracker 

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



[issue23727] rfc2231 line continuations result in an additional newline

2015-03-20 Thread Steve Dower

Changes by Steve Dower :


--
nosy:  -steve.dower

___
Python tracker 

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



[issue23687] Stacktrace identifies wrong line in multiline list comprehension

2015-03-20 Thread R. David Murray

Changes by R. David Murray :


Removed file: http://bugs.python.org/file38612/py2.JPG

___
Python tracker 

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



[issue23687] Stacktrace identifies wrong line in multiline list comprehension

2015-03-20 Thread R. David Murray

Changes by R. David Murray :


--
Removed message: http://bugs.python.org/msg238746

___
Python tracker 

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



[issue23727] rfc2231 line continuations result in an additional newline

2015-03-20 Thread R. David Murray

R. David Murray added the comment:

Can you provide an example email in a simple reproducer script?

--

___
Python tracker 

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



[issue23725] update tempfile docs to say that TemporaryFile is secure

2015-03-20 Thread R. David Murray

R. David Murray added the comment:

It would also be helpful to have a patch with minimum changes (that is, do not 
reflow the lines).

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



[issue22936] traceback module has no way to show locals

2015-03-20 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +n

___
Python tracker 

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



[issue23724] Stack Trace should show argument value passed into a function, not just the keyword

2015-03-20 Thread R. David Murray

R. David Murray added the comment:

Duplicate of issue 22936.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> traceback module has no way to show locals
versions:  -Python 2.7, Python 3.4, Python 3.6

___
Python tracker 

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



[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread R. David Murray

R. David Murray added the comment:

There's actually an issue about exactly that broken-per-docs issue for io.  IMO 
if the goal of calling close is to close only things that are generator objects 
or pretending to be one, the method should have been named close_generator or 
something.

--

___
Python tracker 

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



[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-20 Thread Steve Dower

Steve Dower added the comment:

I think my patch queue went bad somewhere - a few lines disappeared. New patch.

--
Added file: http://bugs.python.org/file38616/23524_5.patch

___
Python tracker 

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



[issue9445] Fix undefined symbol errors on VS8.0 build

2015-03-20 Thread Mark Lawrence

Mark Lawrence added the comment:

I believe that this can be closed as fixed, would someone like to do the 
honours please.

--
nosy: +steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue15011] Change Scripts to bin on Windows

2015-03-20 Thread Mark Lawrence

Mark Lawrence added the comment:

Should we try to implement this in 3.5, hold it until 3.6, reject it completely 
or what?

--
nosy: +BreamoreBoy, tim.golden

___
Python tracker 

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



[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-20 Thread Steve Dower

Steve Dower added the comment:

Updated the patch, mainly because of the changes that have gone in over the 
last week (especially _Py_read and _Py_write).

--
Added file: http://bugs.python.org/file38615/23524_4.patch

___
Python tracker 

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



[issue23668] Support os.[f]truncate on Windows

2015-03-20 Thread Steve Dower

Steve Dower added the comment:

Updated the patch, since there's been a lot of checkins.

I also removed the pyconfig.h changes and updated the #ifdef in posixmodule.c 
to enable truncate/ftruncate and define PATH_HAVE_FTRUNCATE.

And I know in the last review I said I'd switch to _Py_wopen(), but if I do 
that there's no way to avoid passing _O_CREAT, so I opted to stick with 
_wopen() and pass _O_NOINHERIT instead.

Hopefully Reitveld handles this patch file. I'm sure I'm not doing anything 
differently from normal...

--
Added file: http://bugs.python.org/file38614/23668_3.patch

___
Python tracker 

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



[issue2292] Missing *-unpacking generalizations

2015-03-20 Thread Neil Girdhar

Neil Girdhar added the comment:

Removed a confusing and outdated comment in Lib/importlib/_bootstrap.py

--
Added file: http://bugs.python.org/file38613/starunpack39.diff

___
Python tracker 

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



[issue23674] super() documentation isn't very clear

2015-03-20 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

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



[issue23725] update tempfile docs to say that TemporaryFile is secure

2015-03-20 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Zbyszek. For future reference, please send patches from 
the Mercurial repository. It will make the patch review process easier. See 
also devguide.

+:func:`TemporaryDirectory`, :func:`SpooledTemporaryFile`, which can be

Both TemporaryDirectory and SpooledTemporaryFile are actually a class. See 
https://hg.python.org/cpython/file/3.4/Lib/tempfile.py#l510

+   :ref:`context-managers`).  On completion of the context or

:ref:`context-managers` link is unnecessary in my opinion. It would be better 
to link https://docs.python.org/3/library/tempfile.html#examples

(Please update tempfile.TemporaryDirectory docs too.)

--
nosy: +berker.peksag
title: [PATCH] update tempfile docs to say that TemporaryFile is secure -> 
update tempfile docs to say that TemporaryFile is secure
type:  -> enhancement
versions: +Python 3.4

___
Python tracker 

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



[issue23571] Raise SystemError if a function returns a result with an exception set

2015-03-20 Thread Berker Peksag

Berker Peksag added the comment:

Can we add a note (probably with an example) to the Porting to Python 3.5 
section of https://docs.python.org/3.5/whatsnew/3.5.html#porting-to-python-3-5

I believe that this patch exposes some subtle bugs in Django (see 
https://gist.github.com/berkerpeksag/8b8dbe594eb1a1c51275) and it would be 
great to add a note for third party libraries.

--
nosy: +berker.peksag
status: closed -> open

___
Python tracker 

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



[issue23042] ctypes module doesn't build on FreeBSD, RHEL (x86) - Undefined symbol "ffi_call_win32"

2015-03-20 Thread koobs

koobs added the comment:

@Marc, if upstream 3.2.1 also has the issue, then that would mean the current 
FreeBSD Python ports, which use --use-system-ffi and the security/libffi port, 
currently at version 3.2.1 [1], can reproduce the issue. 

I'm not aware of reports that they fail in this manner though.

[1] http://www.freshports.org/devel/libffi/

--
title: ctypes module doesn't build on FreeBSD x86 -> ctypes module doesn't 
build on FreeBSD, RHEL (x86) - Undefined symbol "ffi_call_win32"

___
Python tracker 

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



[issue22832] Tweak parameter names for fcntl module

2015-03-20 Thread Berker Peksag

Berker Peksag added the comment:

> I object to dropping the brackets from the function signatures. Now it gives 
> the impression that the functions accept keyword arguments:

See issue 21488 for a similar confusion.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue23687] Stacktrace identifies wrong line in multiline list comprehension

2015-03-20 Thread SMRUTI RANJAN SAHOO

SMRUTI RANJAN SAHOO added the comment:

the "y" should be replaced by "none". so that will not show any error.
i attached the image of my shell.

--
nosy: +SMRUTI RANJAN SAHOO
Added file: http://bugs.python.org/file38612/py2.JPG

___
Python tracker 

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



[issue23666] Add shell session logging option to IDLE

2015-03-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Do you know if, when a process is killed, date written to open files gets 
flushed to disk?

--

___
Python tracker 

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-03-20 Thread Ryan Gonzalez

Ryan Gonzalez added the comment:

...except for the pyconfig.h changes. Need to do something with autoconf for 
that.

--

___
Python tracker 

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



[issue23698] Multiprocessing.Manager: fix behavior and doc inconsistencies

2015-03-20 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
title: Fix inconsistencies in behaviour and document it correctly for 
multiprocessing.Manager facade -> Multiprocessing.Manager: fix behavior and doc 
inconsistencies

___
Python tracker 

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



[issue23666] Add shell session logging option to IDLE

2015-03-20 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Autosave would suffice.  :-)

The "restart" issue wasn't the usual restart you get by pressing F5.  What is 
happening is that someone does an action that kills or hangs the IDLE app, then 
they have to force close and restart IDLE itself.

--

___
Python tracker 

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



[issue2292] Missing *-unpacking generalizations

2015-03-20 Thread Neil Girdhar

Changes by Neil Girdhar :


Added file: http://bugs.python.org/file38611/starunpack38.diff

___
Python tracker 

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



[issue23529] Limit decompressed data when reading from LZMAFile and BZ2File

2015-03-20 Thread Martin Panter

Martin Panter added the comment:

Wolfgang: Unfortunately, I think that block of changes is largely unavoidable. 
The write() method should not have changed in reality, but all the init and 
read methods around it have been split into two classes, and the diff has 
decided to compare the old GzipFile methods to the new _DecompressReader 
methods. If you like I could try preparing a pseudo diff files that forces it 
to compare old GzipFile to new GzipFile to highlight the changes there.

Nikolaus: I will try to split my buffer_size parameter changes out and post 
them in a separate issue that can be enhanced further.

--

___
Python tracker 

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



[issue23667] IDLE to provide option for making trailing whitespace visible

2015-03-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I agree that this area needs improvement.  'Strip trailing whitespace' should 
strip trailing blank lines at the end of a file, as well as trailing blank 
spaces at the end of each line.  Both are required to commit to our repository.

I would like to have a configuration option to always strip trailing blanks, at 
least for .py files.

I believe the cursor moving from one line to another is an event that is or 
could be caugth and acted on. If so, trailing spaces could be removed 
immediately from the line left, and Save would only have to check the current 
line and the end of the file.  I would rather remove blanks than mark them for 
later removal.

--
nosy: +terry.reedy
stage:  -> needs patch
versions: +Python 2.7, Python 3.4

___
Python tracker 

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



[issue23666] Add shell session logging option to IDLE

2015-03-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I do not see how Restart (as opposed to a proposed Clear option) loses 
anything.  However, closing without saving definitely anything since a save.  
Moreover, even after saving Shell once, there is no Save on Close box displayed 
(as for editor windows) when closing Shell without saving.  This has been 
discussed somewhere (maybe StackOverflow) but I do not find an issue.

Raymond, would it be sufficient if saving once would mean that one could not 
close (or clear the window) without being prompted to save again?  What if we 
add timed autosaves #21152 (based on your comment on #21140, msg215485), or 
autosave (or autoappend) with each prompt?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue21152] Idle: timed autosave for shell (and maybe editor) window

2015-03-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

For Shell, autoappend would do the same, and saving on each >>> rather than by 
time might be more appropriate.

--

___
Python tracker 

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



[issue23705] Speed-up deque.__contains__

2015-03-20 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thanks guys.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue23705] Speed-up deque.__contains__

2015-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 99eb196fb345 by Raymond Hettinger in branch 'default':
Issue 23705:  Improve the performance of __contains__ checks for deques.
https://hg.python.org/cpython/rev/99eb196fb345

--
nosy: +python-dev

___
Python tracker 

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



[issue22832] Tweak parameter names for fcntl module

2015-03-20 Thread Martin Panter

Martin Panter added the comment:

I object to dropping the brackets from the function signatures. Now it gives 
the impression that the functions accept keyword arguments:

ioctl(fd, request, arg=0, mutate_flag=True)

but:

>>> ioctl(0, 0, bytearray(), mutate_flag=False)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: ioctl() takes no keyword arguments

There is already a little bit of precedent for this, e.g. the built-in eval() 
function, but I would prefer using square brackets, or some other non-Python 
syntax indicator.

--

___
Python tracker 

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



[issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument

2015-03-20 Thread Nicholas Chammas

Changes by Nicholas Chammas :


--
nosy: +Nicholas Chammas

___
Python tracker 

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



[issue22341] Python 3 crc32 documentation clarifications

2015-03-20 Thread Martin Panter

Martin Panter added the comment:

Hi Gregory, I think the three functions have been fixed since Python 3.0. It 
looks like you changed them in revisions 6a7fa8421902 (zlib module) and 
132cf3a79126 (crc32 functions). Looking at the 3.0 branch, all three functions 
use PyLong_FromUnsignedLong(), but in the 2.7 branch, they use 
PyInt_FromLong(). This is tested in 
test_zlib.ChecksumTestCase.test_crc32_adler32_unsigned(). See also my changes 
to test_penguins() in the patch here for further testing. There is no explicit 
testing of binascii.crc32() unsignedness, but it is implicitly tested by 
test_same_as_binascii_crc32(), because the expected CRC is beyond the positive 
32 bit signed limit.

I am happy to put back the suggestion of masking for backwards compatibility if 
you really think it is necessary. But since it only involves Python < 3.0 
compatibility, I thought it would be okay to remove it; see my original post. 
The documentation is often pretty good about noting when Python 3 behaviours 
changed, but you usually have to look elsewhere to see the differences from 
Python 2.

--

___
Python tracker 

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



[issue23726] Don't enable GC for classes that don't add new fields

2015-03-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue5680] Command-line arguments when running in IDLE

2015-03-20 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Here's my comment from the duplicate tracker item:
--

A number of IDEs support menu options to set the execution environment for 
programs under development and testing.  In particular, it would be nice if 
IDLE let the user set command line arguments to be passed into sys.argv when 
running a script by pressing F5.

Here are some existing implementations for reference:
* Wing-IDE: https://wingware.com/doc/intro/tutorial-debugging-launch
* Visual Studio: https://www.youtube.com/watch?v=IgbQCRHKV-Y
* PyCharm: 
https://www.jetbrains.com/pycharm/help/run-debug-configuration-python.html

This feature will help users interactively develop and test command-line tools 
while retaining all the nice features of the IDE.   I would personally find it 
useful when teaching students about how sys.argv works.

I suggest adding an option under the Run menu for Set Command Line arguments.  
It would trigger a dialog box that lets a user set a string such as 
"somefile.txt -r 10".  The user string would be run through shlex to break it 
into separate fields.  When F5 is pressed, the sys.argv list would be 
repopulated to include the script name and the lexed arguments.

A little more elaborate option is to add a Run menu entry for Set Execution 
Enviroment that let's the user 1) set the command-line  2) specify the start-up 
directory (using os.chdir), 3) and edit the environment variables (from 
os.environ) or at least be able to set PYTHONPATH.

--
nosy: +rhettinger

___
Python tracker 

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



[issue23726] Don't enable GC for classes that don't add new fields

2015-03-20 Thread Eugene Toder

Eugene Toder added the comment:

Actually, this is rather new -- new in 3.5. The check was relaxed in #22986: 
https://hg.python.org/cpython/rev/c0d25de5919e
Previously only heap types allowed re-assigning __class__.

--

___
Python tracker 

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



[issue23726] Don't enable GC for classes that don't add new fields

2015-03-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

May be we should forbid assigning the __class__ attribute of basic builtin 
types (especially internable, such as int, str, bytes, tuple, bool, NoneType).

--

___
Python tracker 

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



[issue23727] rfc2231 line continuations result in an additional newline

2015-03-20 Thread Eric V. Smith

Changes by Eric V. Smith :


--
components: +email -Windows
nosy: +barry, r.david.murray

___
Python tracker 

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



[issue22516] Windows Installer won't - even when using "just for me"option

2015-03-20 Thread Steve Dower

Steve Dower added the comment:

> my guess (conceded, this is based on no actual metrics) would be that 99% of 
> Windows users use the python.org installers, certainly not the other way 
> around.

Based on numbers I've heard it's certainly a majority currently using the 
python.org installers, but that doesn't mean they should be.

I see three main use cases for the installers:

* people who need Python for themselves
* people who need to bundle Python inside their app
* admins who want to pretend/make-as-if Windows was shipped with Python

Currently, the python.org installer is partway between 1 and 3, and somewhat 
closer to 3. I've heard a lot of complaints from people in #1, who are mostly 
helped by one of the distros, and #2 who don't have a real good option right 
now. (99% in category #1 is an exaggeration, but they're still a majority.)

Being somewhere between these points is not good. Personally, I think #2 (which 
I think about as "Python-as-a-library") is something that it's really our 
responsibility to support. #3 is also something that only we [pydev] can do 
(unless MSFT starts doing it, but I'd expect a lot of the burden would be 
pushed back onto pydev in this case), while #1 is a fairly straightforward for 
anyone to do once #2 is supported.

Certainly if #2 became official, we [MSFT] would be more aggressively helping 
people get set up with the same version of Python as we install on our PaaS 
servers on Azure. Currently, we can't reliably install the python.org 
installers automatically in case it conflicts with the user's existing 
configuration.

Most of your examples use the python.org installers because they are in 
category #2 and don't have a better option. When/if we decide what category the 
python.org installer should focus on, it will make it easier to explain which 
option people should use.

--

___
Python tracker 

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



[issue23726] Don't enable GC for classes that don't add new fields

2015-03-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I wasn't aware of that :-o

--

___
Python tracker 

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



[issue5680] Command-line arguments when running in IDLE

2015-03-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I closed #23665 in favor of this one.  Raymond's take: msg238108

--

___
Python tracker 

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



[issue23665] Provide IDLE menu option to set command-line arguments

2015-03-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

#5680 has 3 different patches. I have not reviewed them yet.  I will link to 
Raymond's message there.

--
nosy: +terry.reedy
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Command-line arguments when running in IDLE

___
Python tracker 

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



[issue23726] Don't enable GC for classes that don't add new fields

2015-03-20 Thread Eugene Toder

Eugene Toder added the comment:

Agreed, but this is not new. This works without my change:

>>> class Tuple(tuple):
...   __slots__ = ()
...   def __repr__(self): return 'Imma tuple!'  
  
... 
>>> ().__class__ = Tuple
>>> ()
Imma tuple!

--

___
Python tracker 

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



[issue23728] binascii.crc_hqx() can return negative integer

2015-03-20 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

zlib.adler32(), zlib.crc32(), and binascii.crc32() always return 32-bit 
unsigned integer in Python 3. binascii.crc_hqx() almost always returns 16-bit 
unsigned integer. But there is an exception. The result can negative only when 
arguments of binascii.crc_hqx() are empty bytes and negative integer. This 
looks as a bug and should be fixed. But may be no need to apply changes to 
maintained releases.

--
components: Extension Modules
keywords: easy
messages: 238726
nosy: gregory.p.smith, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: binascii.crc_hqx() can return negative integer
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue23725] [PATCH] update tempfile docs to say that TemporaryFile is secure

2015-03-20 Thread Ned Deily

Changes by Ned Deily :


--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
stage:  -> patch review

___
Python tracker 

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



[issue23727] rfc2231 line continuations result in an additional newline

2015-03-20 Thread Brian Peterson

New submission from Brian Peterson:

Hey, 

So here we go:

When an email header goes over a line break, rfc2231 
(https://tools.ietf.org/html/rfc2231) specifies that it get formatted in such a 
way that the line break is stripped out. This formatting looks like, for 
example:

> filename*0="my long attachment"
> filename*1="name.txt"

... which should then get interpreted so that is "semantically identical" to:

> filename="my long attachment name.txt"

Here's a link to an example github repo where I see this not occurring: 
https://github.com/bepetersn/special-repo

More specifically, the behavior I AM seeing is that the formatting is handled 
just fine, but that a newline character gets added in.

(I originally thought this had to do with the requests library, so that's why 
my example repo has some stuff related to that in there too, which you can 
safely ignore.)

Also, if I am off-base, possibly if my input email's formatting is to blame, 
sorry for the trouble. :-)

Thanks for reading!

--
components: Windows
messages: 238725
nosy: Brian Peterson, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: rfc2231 line continuations result in an additional newline
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue23723] Provide a way to disable bytecode staleness checks

2015-03-20 Thread Gregory P. Smith

Gregory P. Smith added the comment:

This would avoid the need to modify an interpreter to have this optimization.  
In this mode the potentially expensive stat() call is avoided.  No need to 
ensure that the pyc file's embedded timestamp matches the py file's timestamp.  
The only use of this mode would be when that is guaranteed by a build system so 
loading modules continues to be fast without reverting to loading the py when 
the pyc is already known good.

Our specific example is a build system that generates pyc's for some py files 
at build time but timestamps of files are not maintained at all through the 
build/packaging/distribution process because they are seen an irrelevant detail 
and not even kept track of by the build.  Python is fairly unique in wanting to 
depend upon file timestamp metadata as a form of input data going from py -> 
pyc.

Right now we work around the problem by not having py files available at all in 
this situation.  Using .pycs greatly speeds up the program's load time, but not 
having source code around makes for worse tracebacks and causes problems with 
other tools which need to use the source.

--

___
Python tracker 

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



[issue22341] Python 3 crc32 documentation clarifications

2015-03-20 Thread Gregory P. Smith

Gregory P. Smith added the comment:

I do not object to the removal of the & 0xfff from the stdlib library code 
if these functions have actually been fixed to always return unsigned now.  
(double check the behavior, and if good, just do it!)

But I think the docs should still mention that the & 0x is a good 
practice if code needs to be compatible with Python versions prior to X.Y (list 
the last release before the behavior was corrected).  Possibly within a .. 
versionchanged: section.

People often use the latest docs when writing code in any version of Python as 
we continually improve docs and are pretty good about noting old behaviors and 
when behaviors changed.

--

___
Python tracker 

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



[issue23648] PEP 475 meta issue

2015-03-20 Thread Charles-François Natali

Charles-François Natali added the comment:

Well, all the syscalls which can blocki can fail with EINTR, so all
I:O related one.

--

___
Python tracker 

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



[issue23726] Don't enable GC for classes that don't add new fields

2015-03-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

>>> class UserIntSlots(int):
... __slots__ = ()
... def __repr__(s): return '5'
... 
>>> (4).__class__ = UserIntSlots
>>> 2+2
5
>>> type(2+2)


It looks weird.

--

___
Python tracker 

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



[issue23618] PEP 475: handle EINTR in the socket module

2015-03-20 Thread Charles-François Natali

Charles-François Natali added the comment:

Could you regenerate your latest patch?
It doesn't show properly in the review tool.

Also, what's with the assert?

--

___
Python tracker 

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



[issue23726] Don't enable GC for classes that don't add new fields

2015-03-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Interpreter Core
nosy: +serhiy.storchaka
stage:  -> patch review
versions: +Python 3.5 -Python 3.6

___
Python tracker 

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



[issue22516] Windows Installer won't - even when using "just for me"option

2015-03-20 Thread Paul Moore

Paul Moore added the comment:

> 99% of Python users should be getting a distribution rather than the 
> python.org installers

I'm not at all convinced by this logic. On Windows, as far as I'm aware, the 
only "major" Python distributions are Anaconda and Enthought, both of which are 
intended mainly for the scientific community.

What "distribution" would you suggest for a web developer? For a system admin 
who wants to write automation scripts? For a database admin doing reporting and 
automation? For an application developer planning on packaging his application 
with py2exe/cx_freeze? For a game developer embedding Python? I'd assume all of 
those target audiences would use the python.org installers.

Honestly, my guess (conceded, this is based on no actual metrics) would be that 
99% of Windows users use the python.org installers, certainly not the other way 
around.

--
nosy: +paul.moore

___
Python tracker 

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



[issue23726] Don't enable GC for classes that don't add new fields

2015-03-20 Thread Eugene Toder

New submission from Eugene Toder:

As far as I can tell, if a new class does not add any new fields, and its base 
class doesn't use GC, there's no reason to enable GC for the new class.
This is useful for creating lightweight wrappers around classes implemented in 
C.

--
files: class_gc.diff
keywords: patch
messages: 238718
nosy: eltoder, pitrou
priority: normal
severity: normal
status: open
title: Don't enable GC for classes that don't add new fields
type: performance
versions: Python 3.6
Added file: http://bugs.python.org/file38610/class_gc.diff

___
Python tracker 

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



[issue23705] Speed-up deque.__contains__

2015-03-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

It would be nice to add a test for the RuntimeError case.

--
nosy: +pitrou

___
Python tracker 

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



[issue23306] Within zipfile, use of zlib.crc32 raises OverflowError at argument-parsing time on large strings

2015-03-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue22341] Python 3 crc32 documentation clarifications

2015-03-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also issue4903.

--

___
Python tracker 

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



[issue22341] Python 3 crc32 documentation clarifications

2015-03-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

These notes was added by Gregory in r68535. Ask him if they still are needed.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue22758] Regression in Python 3.2 cookie parsing

2015-03-20 Thread Tim Graham

Tim Graham added the comment:

Patch updated to fix conflict in NEWS. Could we have it committed to ensure it 
gets fixed in the next 3.2 released?

--
Added file: http://bugs.python.org/file38609/secure-httponly-3.2-backport.diff

___
Python tracker 

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



[issue23725] [PATCH] update tempfile docs to say that TemporaryFile is secure

2015-03-20 Thread Zbyszek Jędrzejewski-Szmek

New submission from Zbyszek Jędrzejewski-Szmek:

tempfile docs can use some refreshing.

--
components: Library (Lib)
files: 0001-docs-update-description-of-TemporaryFile-and-tempfil.patch
keywords: patch
messages: 238713
nosy: zbysz
priority: normal
severity: normal
status: open
title: [PATCH] update tempfile docs to say that TemporaryFile is secure
versions: Python 3.5
Added file: 
http://bugs.python.org/file38608/0001-docs-update-description-of-TemporaryFile-and-tempfil.patch

___
Python tracker 

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



[issue22516] Windows Installer won't - even when using "just for me"option

2015-03-20 Thread Steve Dower

Steve Dower added the comment:

> My understanding is that at least some of the separate distributions are 
> separate gardens cut off from the wider pip-accessible python ecosystem.

Maybe some are, but certainly not all of them. There are sometimes 
cross-dependencies that require you to go to the same source for libraries 
(e.g. scipy and numpy need to be compatible), and if they've rebuilt Python 
itself then PyPI wheels may not work, but none of the major distros block or 
inhibit pip at all to my knowledge.

--

___
Python tracker 

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



[issue23724] Stack Trace should show argument value passed into a function, not just the keyword

2015-03-20 Thread Umank Behera

New submission from Umank Behera:

Code:
def main(foo):
raise Exception("Some Exception")

bar = 1
main(bar)


On execution:
Traceback (most recent call last):
  File "st.py", line 5, in 
main(bar)
  File "st.py", line 2, in main
raise Exception("Some Exception")
Exception: Some Exception


It should show the value of bar is 1 on the first frame printed.

--
files: st.py
messages: 238711
nosy: Umank Behera
priority: normal
severity: normal
status: open
title: Stack Trace should show argument value passed into a function, not just 
the keyword
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file38607/st.py

___
Python tracker 

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



[issue22516] Windows Installer won't - even when using "just for me"option

2015-03-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

> 99% of Python users should be getting a distribution rather than the 
> python.org installers.

I do not understand this at all.  Why?  My understanding is that at least some 
of the separate distributions are separate gardens cut off from the wider 
pip-accessible python ecosystem.

--

___
Python tracker 

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



[issue23705] Speed-up deque.__contains__

2015-03-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Except one line with dubious spacing the patch LGTM.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-20 Thread Steve Dower

Steve Dower added the comment:

Any chance of a review on the newest patch?

--

___
Python tracker 

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



[issue22832] Tweak parameter names for fcntl module

2015-03-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks you for your patch Alex.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue22832] Tweak parameter names for fcntl module

2015-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a3c9c2c92b87 by Serhiy Storchaka in branch 'default':
Issue #22832: Tweaked parameter names for fcntl module to better match
https://hg.python.org/cpython/rev/a3c9c2c92b87

--
nosy: +python-dev

___
Python tracker 

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



[issue23723] Provide a way to disable bytecode staleness checks

2015-03-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

What is the benefit?

--
nosy: +pitrou

___
Python tracker 

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



[issue23723] Provide a way to disable bytecode staleness checks

2015-03-20 Thread Brett Cannon

New submission from Brett Cannon:

In environments where bytecode generation is thoroughly controlled, it would be 
nice if there was a way to specify that the bytecode file is externally 
guaranteed to be up-to-date, and thus skip any stat call involving bytecode 
verification. Could be represented with a timestamp of either all zeroes or 
ones in the bytecode file header.

--
assignee: brett.cannon
components: Interpreter Core
messages: 238704
nosy: brett.cannon, gregory.p.smith, twouters
priority: low
severity: normal
status: open
title: Provide a way to disable bytecode staleness checks
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



[issue22832] Tweak parameter names for fcntl module

2015-03-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Except brackets the patch LGTM.

--

___
Python tracker 

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



[issue23662] Cookie.domain is undocumented

2015-03-20 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy: +demian.brecht

___
Python tracker 

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



[issue23717] strptime() with year-weekday pair can produce invalid data

2015-03-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Agree. But may be at least emit a warning?

--

___
Python tracker 

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



[issue23419] Faster default __reduce__ for classes without __init__

2015-03-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For a namedtuple such as turtle.Vec2D there is no significant difference in the 
time of unpickling. But for simpler type it is.

$ ./python -m timeit -s 'import pickle, turtle; global I' -s 'class I(int): 
pass' -s 'p = pickle.dumps([I(i) for i in range(1000)], 3)' -- 'pickle.loads(p)'

Before: 1000 loops, best of 3: 1.6 msec per loop
After:  1000 loops, best of 3: 1.82 msec per loop

So I withdraw my patch. Unpickling performance is more important than pickling 
performance, and status quo wins. Sorry for the noise.

--
assignee:  -> serhiy.storchaka
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread Wolfgang Maier

Wolfgang Maier added the comment:

OTOH, it would be very hard to change the way fileobjects compared to designing 
yield from differently so I'd still blame it partly.
Maybe it is unfortunate that generators have a close method instead of, say, 
__close__ ?

--

___
Python tracker 

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



[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread Wolfgang Maier

Wolfgang Maier added the comment:

You are probably right that the io classes are broken.

>From https://docs.python.org/3/library/stdtypes.html#iterator-types:

Once an iterator’s __next__() method raises StopIteration, it must continue to 
do so on subsequent calls. Implementations that do not obey this property are 
deemed broken.


One consequence of __iter__ returning self is that the above is not guaranteed:

>>> with open('somefile', 'w') as f:
f.write('some text')


9
>>> with open('somefile', 'r') as f:
i = iter(f)
assert f is i
for line in i:
print(line)
try:
next(i)
except StopIteration:
print('exhausted iterator')
f.seek(0)
print(next(i))


some text
exhausted iterator
0
some text

So the io classes are *officially* broken.

--

___
Python tracker 

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



[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread STINNER Victor

STINNER Victor added the comment:

> Isn't there some discussion somewhere that if iter(x) returns x you probably 
> have buggy code?

I agree that the issue comes from TextIOWrapper.__iter__(),
BufferedReader.__iter__() and FileIO.__iter__() returns simply return
self *and* have a close method. The issue is not "yield from".

--

___
Python tracker 

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



[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread R. David Murray

R. David Murray added the comment:

Isn't there some discussion somewhere that if iter(x) returns x you probably 
have buggy code?  Maybe it is io that is broken, design-wise.  I think there 
was another issue related to iter(file) recently...someone surprised by the 
fact that you can't iterate a file twice without reopening it...the source of 
that problem is similar.  Not that it necessarily soluble, but it is certainly 
*interesting* :)

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



[issue22516] Windows Installer won't - even when using "just for me"option

2015-03-20 Thread Steve Dower

Steve Dower added the comment:

@Mark: You can't - MSIs have a single flag indicating whether they should 
elevate or not. That's why I moved the 3.5 installer to a new format. 
Unfortunately, since we're in a transitional state, admin privileges are 
necessary to install the new CRT version, but the per-user is a true per-user 
for 3.5 (and when the new CRT is already installed via normal Windows Updates, 
you won't even be prompted).

@J. Morton: I appreciate the suggestion of only supporting per-user installs, 
and I'm heading towards that position. It won't be changing for 2.7 or 3.4 at 
this stage, but I do plan to discuss exactly this issue soon with the core team 
and figure out what we're actually trying to achieve with our installers.

I would never suggest that somebody build Python themselves unless they are a 
distribution, and ISTM that even on Windows, 99% of Python users should be 
getting a distribution rather than the python.org installers. (Which makes the 
python.org installers fairly redundant, hence my plans to discuss what they 
should be trying to achieve.)

The /a "install" is not a real installation, and though it "works", it isn't 
necessarily supported. (It's actually a transformation of the MSI file to 
separate the files to install from the installer - you should see the MSI file 
get considerably smaller after you run that command.) In particular, the py.exe 
launcher is not going to work, and many other programs that automatically 
detect Python will also fail.

Not sure what you mean about "compatible with PyDev/Eclipse". It's their 
responsibility to be compatible with Python (and I say this as the lead 
developer of Python Tools for Visual Studio, where we've pulled all sorts of 
tricks to remain compatible with Python :) ).

--

___
Python tracker 

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



[issue23717] strptime() with year-weekday pair can produce invalid data

2015-03-20 Thread Skip Montanaro

Skip Montanaro added the comment:

 time.strptime('2015 3 20 0', '%Y %m %d %w')
> time.struct_time(tm_year=2015, tm_mon=3, tm_mday=20, tm_hour=0, tm_min=0, 
> tm_sec=0, tm_wday=6, tm_yday=79, tm_isdst=-1)
>
> All date values are known, the problem is that they contradict.

Garbage in, garbage out. :-) Clearly today is not Sunday. I not sure
there is a correct answer in the face of contradictory inputs.

--

___
Python tracker 

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



[issue22958] Constructors of weakref mapping classes don't accept "self" and "dict" keyword arguments

2015-03-20 Thread Benjamin Peterson

Benjamin Peterson added the comment:

lgtm

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue22516] Windows Installer won't - even when using "just for me"option

2015-03-20 Thread Mark Mikofski

Mark Mikofski added the comment:

1. J morton: just install Anacondahttp://continuum.io/downloads

2. I will take a look at the msi and see if I can accommodate both installs in 
the same installer

--

___
Python tracker 

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



[issue11726] clarify that linecache only works on files that can be decoded successfully

2015-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ceb14ecc1942 by R David Murray in branch '3.4':
#11726: Make linecache docs reflect that all files are treated the same.
https://hg.python.org/cpython/rev/ceb14ecc1942

New changeset 1a5c72f9ff53 by R David Murray in branch 'default':
Merge: #11726: Make linecache docs reflect that all files are treated the same.
https://hg.python.org/cpython/rev/1a5c72f9ff53

--

___
Python tracker 

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



[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your explanation Wolfgang! Now it is clear to me. The issue is 
that the generator calls the close() method of the subgenerator, but if the 
subgenerator is a file, the close() method closes (surprise!) the file. Two 
different protocols use the same method.

Interesting, how many similar bugs was introduced by blindly replacing 
"for/yield" with "yield from"?

--

___
Python tracker 

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



[issue11726] clarify that linecache only works on files that can be decoded successfully

2015-03-20 Thread R. David Murray

R. David Murray added the comment:

OK, on further investigation I guess it wasn't intended to be so general :)  
But I still think we should make a nod to the reality that it can be used on 
other text files.  I'll re-close the issue but I may add a sentence to the docs.

--
status: open -> closed

___
Python tracker 

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



[issue11726] clarify that linecache only works on files that can be decoded successfully

2015-03-20 Thread R. David Murray

R. David Murray added the comment:

I think that that patch that Victor committed is incorrect, and that Thomas's 
patch is closer to correct.  People *do* use linecache with files other than 
python source files, and as far as I can see we are not going to stop 
supporting that.  Given the original docs the intent clearly was that the 
interface be general, not python-file-specific.

--
status: closed -> open

___
Python tracker 

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



[issue22181] os.urandom() should use Linux 3.17 getrandom() syscall

2015-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b8ceb071159f by Victor Stinner in branch 'default':
Issue #22181: Run "aclocal; autoconf; autoheader" to regenerate configure
https://hg.python.org/cpython/rev/b8ceb071159f

--

___
Python tracker 

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



[issue23681] Have -b warn when directly comparing ints and bytes

2015-03-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue23681] Have -b warn when directly comparing ints and bytes

2015-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 104c55bc2276 by Serhiy Storchaka in branch '3.4':
Issue #23681: Fixed Python 2 to 3 poring bugs.
https://hg.python.org/cpython/rev/104c55bc2276

New changeset 817f1f47824c by Serhiy Storchaka in branch 'default':
Issue #23681: Fixed Python 2 to 3 poring bugs.
https://hg.python.org/cpython/rev/817f1f47824c

New changeset 68e9cf0ae93d by Serhiy Storchaka in branch 'default':
Issue #23681: The -b option now affects comparisons of bytes with int.
https://hg.python.org/cpython/rev/68e9cf0ae93d

--
nosy: +python-dev

___
Python tracker 

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



[issue22516] Windows Installer won't - even when using "just for me"option

2015-03-20 Thread J. Morton

J. Morton added the comment:

First, thanks for the comments - perhaps there's hope. 

But from the viewpoint of a typical user (who does not care about what goes on 
in the background), some of what has been said does not match the realities of 
development in a corporate environment.

1 – Anyone who is working on a Windows box controlled by an overly 
anal-retentive IM department (i.e. no admin rights) will not be able to install 
Python.  Either make the “just for me” option unrestricted or remove it 
entirely.   Time wasted trying to install Python when it can’t be done does 
endear Python to new users and comes across as being rather unprofessional.  I 
haven’t gone to the web page lately, but as an absolute minimum the page for 
the “just for me” option needs to state that Admin rights are needed.
2 – Anyone forced to use Windows and is NOT a total python fanatic will NEVER 
go to the pain of building it.  In the corporate world - on any platform - this 
approach is generally unrealistic given the other tools already out there (not 
worth the time/effort/pain involved, especially if the boss is breathing down 
your neck about the project schedule).  And even if they want to, they may not 
be able to build/install it – no tools, as per point 1.
3 – I do not see the comments (in msg238567) “require a second MSI that is 
configured to not ask for administrative privileges” and “hosting twice of many 
files” as having much validity.   To better serve the community a better 
approach is to REPLACE the pointlessly restrictive “admin rights”  installer 
with an unrestricted version (it’s how I got Firefox on this machine) – hence 
only one set of files.  This set should be, as much as possible, completely 
independent of everything else on the system (disk space is cheap, networks are 
fast and the file sizes are, relatively speaking, small).

4 - I haven't yet tried the "MSI' workaround (in msg238560) so I don't know if 
it will work on my restricted system.  If it does, the workaround should appear 
on the web page.

Finally (as pure self-interest) I'd like a version compatible with 
Eclipse/PyDev.

I do appreciate and encourage what you guys are doing and also understand the 
realities of what you do.  But my viewpoint is, that to have closed this issue 
without properly addressing the basic problem reminds me of an ostrich with its 
head in the sand.

--
status: closed -> languishing

___
Python tracker 

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



[issue23657] Don't do isinstance checks in zipapp

2015-03-20 Thread Paul Moore

Paul Moore added the comment:

Updated patch. Added the requested test and a set of tests for the command line 
API. This also highlighted a bug in the command line --info option, which is 
also fixed.

Coverage now:

Name  Stmts   Miss  Cover   Missing
---
test_zipapp 254 1295%   252-257, 263-268
zipapp  102  298%   30, 192
---
TOTAL   356 1496%

Remaining misses are Unix-only tests (this was run on Windows) and the __main__ 
block.

--
Added file: http://bugs.python.org/file38606/duck_typed_zipapp.v3.patch

___
Python tracker 

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



[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread Wolfgang Maier

Wolfgang Maier added the comment:

so let's look at this step-by-step (and I hope I fully understood this myself):

- calling fileobj.__iter__ creates a generator because the method uses yield 
from

- that generator does not get assigned to any reference so it will be 
garbage-collected

- when the generator is garbage-collected, the subgenerator specified to the 
rigth of the yield from is finalized (that is PEP380-mandated behavior) and, in 
this case, that is iter(self.file)

- for an io module-based fileobject, iter(f) is f and finalizing it means that 
its close method will be called

So this is not about the file object getting garbage-collected, it is about it 
getting closed.

Since PEP380 explicitly mentions that problem with yield from and a shared 
subiterator, I don't think you can call it a bug, but I think it is very 
problematic behavior as illustrated by this issue because client code is 
supposed to know whether a particular generator uses yield from or not.

--

___
Python tracker 

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



[issue2211] Cookie.Morsel interface needs update

2015-03-20 Thread Demian Brecht

Demian Brecht added the comment:

> idmap was removed in 14b65de9b798, translate was removed in 99027c2b3fd2 when 
> their became unnecessary.

I'd venture to say they slipped through the cracks. Following the deprecation 
procedure here would be favourable IMHO as to give users a sufficient heads up 
that their will be a breakage upcoming, however unlikely that the parameter is 
actually in use in practice. There's nothing lost by marking it deprecated and 
removing it for 3.6(+).

--

___
Python tracker 

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



  1   2   >