[issue24305] The new import system makes it inconvenient to correctly issue a deprecation warning for a module

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

It was basically okay on the buildbots--no worse than cpython would have been 
before the checkin.  (A lot of the buildbots are... wonky.)

I checked it in to cpython350 directly.  I'll do the forward merge after 
3.5.0rc3 goes out the door.

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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread Larry Hastings

Changes by Larry Hastings :


--
priority: release blocker -> deferred blocker

___
Python tracker 

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



[issue24912] The type of cached objects is mutable

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

Marking as closed for now.  If we decide it's a problem we can reopen later.

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



[issue24305] The new import system makes it inconvenient to correctly issue a deprecation warning for a module

2015-09-06 Thread Nathaniel Smith

Nathaniel Smith added the comment:

Hooray! Thanks Larry.

Would it make sense to do a 3.4.x backport, or is that closed now with 3.5 
being imminent?

--

___
Python tracker 

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



[issue24305] The new import system makes it inconvenient to correctly issue a deprecation warning for a module

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

I don't think it'd be appropriate to backport to 3.4--that ship has sailed.  
3.4 requires a stacklevel=8 and that's that.

If we backported it and it shipped in 3.4.4, "correct" code would have to use a 
stacklevel=8 for 3.4.0 through 3.4.3, and stacklevel=2 for 3.4.4 and above.  
Ugh!

--

___
Python tracker 

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



[issue25005] webbrowser breaks on query strings with multiple fields on Windows

2015-09-06 Thread Larry Hastings

Changes by Larry Hastings :


--
priority: release blocker -> deferred blocker

___
Python tracker 

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



[issue25005] webbrowser breaks on query strings with multiple fields on Windows

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

Marking this as deferred, as I'm not convinced I should ship either of those 
patches in 3.5.0rc3.

--
nosy: +larry

___
Python tracker 

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



[issue24585] Windows installer does not detect existing installs

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

What happened with this?

--

___
Python tracker 

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



[issue24305] The new import system makes it inconvenient to correctly issue a deprecation warning for a module

2015-09-06 Thread Nathaniel Smith

Nathaniel Smith added the comment:

Some limited code search statistics posted upthread (msg28) suggest that 
~100% of real-world code is using stacklevel=2 unconditionally and thus getting 
incorrect results on 3.3 and 3.4.

--

___
Python tracker 

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



[issue24305] The new import system makes it inconvenient to correctly issue a deprecation warning for a module

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

Yes, I saw that.  That doesn't mean we should change the interface they are 
using (incorrectly) eighteen months after it shipped.  We take 
backwards-compatibility pretty seriously here in the Python world, bugs and all.

--

___
Python tracker 

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



[issue24305] The new import system makes it inconvenient to correctly issue a deprecation warning for a module

2015-09-06 Thread Nathaniel Smith

Nathaniel Smith added the comment:

Also just checked searchcode.com, which allows more fine-grained queries, and 
it reports ~6500 hits for "stacklevel=2" and exactly 0 for "stacklevel=8".



Huh. So the official word is that requiring stacklevel=8 on 3.4 is not a bug, 
rather all those modules are buggy? I've been telling people who asked to just 
leave the stacklevel=2 thing alone rather than adding version-specific 
conditionals, but I guess I can pass that on.

--

___
Python tracker 

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



[issue24305] The new import system makes it inconvenient to correctly issue a deprecation warning for a module

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

Unless I'm overruled, yes.

--

___
Python tracker 

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



[issue24305] The new import system makes it inconvenient to correctly issue a deprecation warning for a module

2015-09-06 Thread Nathaniel Smith

Nathaniel Smith added the comment:

ok

--

___
Python tracker 

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



[issue25013] run_pdb() in test_pdb.py always returns stderr as None

2015-09-06 Thread Xavier de Gaye

New submission from Xavier de Gaye:

The attached patch fixes this.

--
components: Library (Lib)
files: run_pdb.patch
keywords: patch
messages: 249989
nosy: terry.reedy, xdegaye
priority: normal
severity: normal
status: open
title: run_pdb() in test_pdb.py always returns stderr as None
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file40379/run_pdb.patch

___
Python tracker 

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



[issue24902] http.server: on startup, show host/port as URL

2015-09-06 Thread Felix Kaiser

Felix Kaiser added the comment:

So do I, but I can live with either way.

Can one of you merge one of these patches?

--

___
Python tracker 

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



[issue25014] Add contextlib.itercm()

2015-09-06 Thread Ezio Melotti

New submission from Ezio Melotti:

Add an itercm() function that receives an iterable that supports the context 
manager protocol (e.g. files) and calls enter/exit without having to use the 
with statement explicitly.

The implementation is pretty straightforward (unless I'm missing something):

def itercm(cm):
with cm:
yield from cm

Example usages:

def cat(fnames):
lines = chain.from_iterable(itercm(open(f)) for f in fnames)
for line in lines:
print(line, end='')

This will close the files as soon as the last line is read.

The __exit__ won't be called until the generator is exhausted, so the user 
should make sure that it is (if he wants __exit__ to be closed).  __exit__ is 
still called in case of exception.

Attached a clearer example of how it works.

Do you think this would be a good addition to contextlib (or perhaps itertools)?


P.S. I'm also contemplating the idea of having e.g. it = itercm(fname, 
func=open) to call func lazily once the first next(it) happens, but I haven't 
thought in detail about the implications of this.  I also haven't considered 
how this interacts with coroutines.

--
components: Library (Lib)
files: itercm-example.txt
messages: 249991
nosy: ezio.melotti, ncoghlan, rhettinger
priority: normal
severity: normal
stage: needs patch
status: open
title: Add contextlib.itercm()
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file40380/itercm-example.txt

___
Python tracker 

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



[issue25014] Add contextlib.itercm()

2015-09-06 Thread Ezio Melotti

Ezio Melotti added the comment:

FTR one of the reason that led me to itercm() is:

with open(fname) as f:
transformed = (transform(line) for line in f)
filtered = (line for line in lines if filter(line))
# ...

Now filtered must be completely consumed before leaving the body of the `with` 
otherwise this happens:

>>> with open(fname) as f:
... transformed = (transform(line) for line in f)
... filtered = (line for line in lines if filter(line))
... 
>>> # ...
>>> next(filtered)
ValueError: I/O operation on closed file.

With itercm() it's possible to do:

f = itercm(open(fname))
transformed = (transform(line) for line in f)
filtered = (line for line in lines if filter(line))
...
# someone consumes filtered down the line lazily
# and eventually the file gets closed

itercm() could also be used (abused?) where a regular `with` would do just fine 
to save one extra line and indentation level (at the cost of an extra import), 
e.g.:

def lazy_cat(fnames):
for fname in fnames:
yield from itercm(open(fname))

instead of: 

def lazy_cat(fnames):
for fname in fnames:
with open(fname) as f:
yield from f

--

___
Python tracker 

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



[issue24585] Windows installer does not detect existing installs

2015-09-06 Thread Steve Dower

Steve Dower added the comment:

Good to go!

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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread Steve Dower

Steve Dower added the comment:

Larry: agreed, no crashing. We'll get the trivial fix in that doesn't raise any 
error, and should probably stop suppressing the exception in the situation 
eryksun describes. That will correctly expose the platform's strftime semantics.

Unless you want to write more thorough validation of incoming strings, I'll 
work something up later today or tomorrow.

--

___
Python tracker 

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



[issue25005] webbrowser breaks on query strings with multiple fields on Windows

2015-09-06 Thread Steve Dower

Steve Dower added the comment:

Does that mean not shipping either of them in 3.5.0 at all? Do you need 
convincing or a simpler patch?

--

___
Python tracker 

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



[issue24982] shutil.make_archive doesn't archive empty directories

2015-09-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue24964] Add tunnel CONNECT response headers to httplib / http.client

2015-09-06 Thread Thomas Belhalfaoui

Thomas Belhalfaoui added the comment:

Martin, I went through your patch and made some simple tests, and I have a 
couple of questions.

1) When I run the following code, I get a "Bad file descriptor" :

conn = httplib.HTTPConnection("uk.proxymesh.com", 31280)
conn.set_tunnel("www.google.com", 80)
conn.request("GET", "/")
resp = conn.getresponse()
print(resp.read())

So I tweaked the "getresponse" function so that it does not call "self.close()" 
(i.e. the connection stays open after the CONNECT request) in that case, and it 
seems to works fine.

2) I added "self.sock, _ = tunnel" in HTTPConnection constructor, to try your 
use case, but I get "http.client.RemoteDisconnected: Remote end closed 
connection without response".

Do you think it makes sense or am I missing something ?

--

___
Python tracker 

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



[issue24982] shutil.make_archive doesn't archive empty directories

2015-09-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch. Should this be considered as a bug fix rather than new feature?

--
keywords: +patch
nosy: +eric.araujo, tarek
stage: needs patch -> patch review
Added file: http://bugs.python.org/file40381/make_archive_zip_dirs.patch

___
Python tracker 

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



[issue25014] Add contextlib.itercm()

2015-09-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What if the last line will be never read? We had bugs with resource leaks in 
generators, and I'm not sure that all such bugs were fixed.

--
nosy: +pitrou, serhiy.storchaka

___
Python tracker 

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



[issue22241] strftime/strptime round trip fails even for UTC datetime object

2015-09-06 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Addressed review comments.

--
Added file: http://bugs.python.org/file40382/issue22241-2.diff

___
Python tracker 

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



[issue22241] strftime/strptime round trip fails even for UTC datetime object

2015-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f904b7eb3981 by Alexander Belopolsky in branch 'default':
Closes Issue#22241: timezone.utc name is now plain 'UTC', not 'UTC-00:00'.
https://hg.python.org/cpython/rev/f904b7eb3981

--
nosy: +python-dev

___
Python tracker 

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



[issue22241] strftime/strptime round trip fails even for UTC datetime object

2015-09-06 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
resolution:  -> fixed
stage: commit review -> resolved

___
Python tracker 

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



[issue22241] strftime/strptime round trip fails even for UTC datetime object

2015-09-06 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
status: open -> closed

___
Python tracker 

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



[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)

2015-09-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Laura, could you please report a bug to Debian?

--

___
Python tracker 

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



[issue15989] Possible integer overflow of PyLong_AsLong() results

2015-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d51a82f68a70 by Serhiy Storchaka in branch 'default':
Issue #15989: Fixed some scarcely probable integer overflows.
https://hg.python.org/cpython/rev/d51a82f68a70

--

___
Python tracker 

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



[issue15989] Possible integer overflow of PyLong_AsLong() results

2015-09-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

One of changes to Modules/_io/_iomodule.c is no longer actual since issue21679.

Change to Modules/selectmodule.c is no longer actual since issue23485 
(f54bc2c52dfd).

The rest changes were committed to 3.6 only.

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-09-06 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 

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



[issue24938] Measure if _warnings.c is still worth having

2015-09-06 Thread Brett Cannon

Brett Cannon added the comment:

After thinking about it and with _warnings.c not exactly changing very much I 
think I'm going to call YAGNI on ripping out _warnings.c.

--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue24779] Python/ast.c: decode_unicode is never called with rawmode=True

2015-09-06 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> eric.smith

___
Python tracker 

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



[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2015-09-06 Thread Stefan Behnel

Stefan Behnel added the comment:

Patch and test look correct. They fix a bug that produces incorrect output, so 
I vote for backporting them. Most code won't see the difference as whitespace 
control characters are rare in attribute values. And code that uses them will 
benefit from correctness. Obviously, there might also be breakage in the rare 
case that code puts control characters into attribute values and expects them 
to disappear magically, but then it's the user code that is wrong here.

Only issue is that serialisation is slow already and this change slows it down 
a bit more. Every attribute value will now be searched 8 times instead of 5 
times. I added a minor review comment that would normally reduce it to 7. 
timeit suggests to me that the overall overhead is still tiny, though, and thus 
acceptable:

$ python3.5 -m timeit -s "s = 'askhfalsdhfashldfsadf'" "'\n' in s"
1000 loops, best of 3: 0.0383 usec per loop

$ python3.5 -m timeit -s "s = 'askhfalsdhfashldfsadf'" "s.replace('\n', 'y')"
1000 loops, best of 3: 0.151 usec per loop

$ python3.5 -m timeit -s "s = 'askhfalsdhfashldfsadf'; rep=s.replace" 
"rep('\n', 'y')"
1000 loops, best of 3: 0.12 usec per loop

--

___
Python tracker 

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



[issue23144] html.parser.HTMLParser: setting 'convert_charrefs = True' leads to dropped text

2015-09-06 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report!

--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed
versions: +Python 3.6 -Python 2.7

___
Python tracker 

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



[issue23144] html.parser.HTMLParser: setting 'convert_charrefs = True' leads to dropped text

2015-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ef82131d0c93 by Ezio Melotti in branch '3.4':
#23144: Make sure that HTMLParser.feed() returns all the data, even when 
convert_charrefs is True.
https://hg.python.org/cpython/rev/ef82131d0c93

New changeset 1f6155ffcaf6 by Ezio Melotti in branch '3.5':
#23144: merge with 3.4.
https://hg.python.org/cpython/rev/1f6155ffcaf6

New changeset 48ae9d66c720 by Ezio Melotti in branch 'default':
#23144: merge with 3.5.
https://hg.python.org/cpython/rev/48ae9d66c720

--
nosy: +python-dev

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-09-06 Thread Stefan Behnel

Stefan Behnel added the comment:

> The only thing that was a bit mystifying were the errors during the
> initial profile run. There is so much that floats by in the terminal
> window that I completely missed the warnings about errors during the
> test run not being anything to worry about.

Then wouldn't it be better to suppress (or at least reduce) the output of
the test runs in this case?

--

___
Python tracker 

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



[issue15989] Possible integer overflow of PyLong_AsLong() results

2015-09-06 Thread Eric V. Smith

Eric V. Smith added the comment:

Isn't Python-ast.c a generated file?

--
nosy: +eric.smith

___
Python tracker 

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



[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)

2015-09-06 Thread Laura Creighton

Laura Creighton added the comment:

I could.  Have you heard from doko?  If python3 on debian unstable is about to 
become python3.5 and things work fine on 3.5 I wonder if it is worth the effort.

--

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-09-06 Thread Brett Cannon

Brett Cannon added the comment:

I guess the test output -- both stdout and stderr -- could be redirected to 
/dev/null as simply using -q with regrtest will still lead to failures being 
emitted and random output which no one cares about except people inspecting the 
test output. Just need to make sure to mention that all output is suppressed so 
people don't think the process is hanging.

--

___
Python tracker 

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



[issue25014] Add contextlib.itercm()

2015-09-06 Thread Ezio Melotti

Ezio Melotti added the comment:

If you are talking about generators that never get exhausted, the fact that the 
__exit__ is never invoked is expected and something that developers should take 
into account while using itercm().
I'm not aware of other generators-related issues that might cause leaks.

--

___
Python tracker 

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



[issue25015] Idle: scroll Text faster with mouse wheel

2015-09-06 Thread Terry J. Reedy

New submission from Terry J. Reedy:

https://stackoverflow.com/questions/32414942/python-scroll-speed
At least on Win7, tk.Texts scroll, by default, at an anemic 2-3 lines per wheel 
click, ignoring the system wheel setting. What happens on other systems?  I 
consider this a probable tk bug, at least on Widows, but we can override the 
default (on Windows) with

def mousescroll(event):
   
   return 'break'
text.bind('', mousescroll)

turtledemo.__main__ has wheel code (for font resizing) for Windows, Linux, and 
Mac. Unless we can access system settings, we might add a config option.

--
messages: 250013
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: Idle: scroll Text faster with mouse wheel
type: enhancement
versions: Python 2.7, 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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread Steve Dower

Steve Dower added the comment:

New patch attached that just breaks out of the scanning loop and lets the 
system CRT handle invalid format strings. Fixes the condition that was 
suppressing some errors on Windows.

Also fixed the PEP 7 issues around the changed code (I believe). No new test 
because the crash cannot be reliably reproduced and the expected results vary 
dramatically between platforms.

The two if/break lines in the AIX branch should also be applied to 3.4 to 
prevent crashes. The rest of the fix (including the PEP 7 fixes) should not.

--
versions:  -Python 3.2, Python 3.3
Added file: http://bugs.python.org/file40383/24917_4.patch

___
Python tracker 

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



[issue25005] webbrowser breaks on query strings with multiple fields on Windows

2015-09-06 Thread R. David Murray

R. David Murray added the comment:

You have to ship one of them by ("one of them" being either the fix or the 
backout) in 3.5.0, Larry, otherwise you are introducing a security 
vulnerability into 3.5 that doesn't exist in 3.4.  If you don't ship it in rc3, 
then there's no chance that 3.5.0 will be unchanged from rc3, which is the 
ideal we should be aiming for (that's why it's called a "release *candidate*").

--

___
Python tracker 

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



[issue23406] interning and list comprehension leads to unexpected behavior

2015-09-06 Thread R. David Murray

R. David Murray added the comment:

Looks good to me.

--

___
Python tracker 

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



[issue15989] Possible integer overflow of PyLong_AsLong() results

2015-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e53df7955192 by Serhiy Storchaka in branch 'default':
Make asdl_c.py to generate Python-ast.c changed in issue #15989.
https://hg.python.org/cpython/rev/e53df7955192

--

___
Python tracker 

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



[issue15989] Possible integer overflow of PyLong_AsLong() results

2015-09-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Isn't Python-ast.c a generated file?

Good catch Eric.

--

___
Python tracker 

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



[issue25008] Deprecate smtpd

2015-09-06 Thread R. David Murray

R. David Murray added the comment:

I believe that smtpd is used for a *lot* of testing code (anyone who is writing 
smtp clients in python, pretty much, and probably some writing in other 
languages).  I really don't see the rationale for removing it, assuming we can 
rewrite it "in time".

On the other hand, are we really going to *remove* asyncore/asynchat?  Or is 
this a "deprecation in place" like optparse?  If the latter then I don't really 
care if the same is done to smtpd :)  If the former, why, if we've kept 
optparse?

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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread John Leitch

John Leitch added the comment:

First, let me begin by saying I believe this patch will fix the buffer 
over-read, which is a good step forward.

However, after giving the matter more thought, and at the risk of wearing out 
my welcome, I am of the belief that relying on the CRT to handle malformed 
format strings is the wrong approach. As per the C spec, strftime's behavior 
when handling invalid format strings is undefined:

"If a conversion specifier is not one of the above, the behavior is undefined"

Quite often, "undefined" translates to "exploitable". And at the very least, by 
not performing thorough enough validation, Python is misusing strftime(), which 
may lead to crashes or undermine memory safety. Of course, this is all 
speculation--I haven't the time or resource to learn other platforms to see 
what's possible. But, even if I could, the task would be Sisyphean because 
there's simply no way to know what the future holds when dealing with 
implementation that could change at any point.

I realize we must be pragmatic with matters such as this, and a dramatic change 
could be breaking for some Python apps. Even so, I feel it's worth vocalizing 
these concerns. As a principal, I think that "safe", well-formed Python should 
never be able to perform operations that lead to undefined behavior in the 
underlying runtime.

Alright, rant done. If at any point in time locking down Python's strftime with 
more aggressive validation is considered viable, I am more than willing to take 
a shot at submitting a patch.

--

___
Python tracker 

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



[issue24982] shutil.make_archive doesn't archive empty directories

2015-09-06 Thread R. David Murray

R. David Murray added the comment:

I think it could be considered a bug fix, given that other archive programs, 
including zipfile itself, act in this way, and it is relatively unlikely that 
anyone is *depending* on make_archive not including empty directories (ie: that 
it would break their code if these directories were included).

--

___
Python tracker 

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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Historically, time and os modules have been considered low level, thin wrappers 
over system libc functions.  Users of these modules are the proverbial 
"consenting adults" who should understand their power and the associated risks.

The place to provide a better behaved strftime function is the datetime module, 
but I would leave time.stftime pretty much the way it is and would only 
consider making *fewer* checks on Windows if _Py_BEGIN_SUPPRESS_IPH / 
_Py_END_SUPPRESS_IPH macros can indeed help to avoid crashes on illegal format 
strings.

--

___
Python tracker 

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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread Steve Dower

Steve Dower added the comment:

FWIW, those macros prevent a certain class of "undefined behavior," which in 
this case is to terminate the process rather than return an error code. They 
don't do anything to prevent crashes due to exploitation or malicious code.

The place for more robust formatting is datetime.__format__(), which from a 
quick test seems to be more strict about what is in the format string.

--

___
Python tracker 

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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

Having slept on it, I agree with Steve.  We should make the minimal change 
necessary in order to not crash.

However, it still needs a regression test.  The test can use JohnLeitch's 
proposed test as a good starting point, but it must accept either success or 
ValueError as passing the test.

I still think there's merit in detecting a trailing unquoted % at the end of 
the format string, but that would only be appropriate for 3.6 at this point.

--

___
Python tracker 

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



[issue25011] Smarter rl complete: hide private and special names

2015-09-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I like the idea, though some people may object to breaking their worflow (tm). 
Nosy'ing David just in case ;-)

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2015-09-06 Thread Jakub Wilk

Changes by Jakub Wilk :


--
nosy: +jwilk

___
Python tracker 

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



[issue25015] Idle: scroll Text faster with mouse wheel

2015-09-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

On X Window the scroll step in text widget is constant (50 pixels). On Windows 
and Mac OS it should depend on mouse settings.

Run with, execute

bind .  {puts %D}

and try to roll mouse wheel on Tk window with different speed and settings.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25014] Add contextlib.itercm()

2015-09-06 Thread Martin Panter

Martin Panter added the comment:

I had also thought of this kind of function, but I dismissed it because it 
would either have to rely on garbage collection or an explicit close() call to 
close the generator in case the iteration is aborted. I think it might need 
some kind of “with-for” combined statement added to the langauge to be 
bulletproof.

Considering the second example in your script, “exit is called in case of 
errors”: What is stopping the interpreter from storing the iterator of the 
current “for” loop in the top-level frame object? Then the iterator would be 
referenced by the exception traceback, and prevent garbage collection of its 
itercm() instance. Hypothetically:

__traceback__ → tb_frame → “for” iterator → itercm() instance

Also, I would tend to put this sort of function in “itertools”, since 
generators are not context managers by design.

--
nosy: +martin.panter

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2015-09-06 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
versions: +Python 3.6 -Python 3.4

___
Python tracker 

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



[issue25014] Add contextlib.itercm()

2015-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

__exit__ will still get invoked even if the generator is never exhausted:

>>> def itercm(cm):
... with cm:
... yield from cm
... 
>>> class TestCM:
... def __iter__(self):
... yield 6
... yield 9
... yield 42
... def __enter__(self):
... return self
... def __exit__(self, *args):
... print("Terminated CM")
... 
>>> itr = itercm(TestCM())
>>> next(itr)
6
>>> del itr
Terminated CM

We addressed the major problems with generators failing to clean up resources 
back when generator.close() was introduced in PEP 342, and then Antoine 
addressed the cyclic GC problem in PEP 442.

The key thing that itercm() adds over the status quo is that if the generator 
*is* exhausted, then the resource *will* be cleaned up immediately. If the 
generator *isn't* exhausted, then it falls back to non-deterministic GC based 
cleanup, which is what you'd get today by not using a context manager at all.

To be convinced that we need a third cleanup option beyond "always 
deterministic" and "always non-deterministic", I'd need some concrete use cases 
where the success case needs deterministic cleanup, but the error case is OK 
with non-deterministic cleanup.

--

___
Python tracker 

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



[issue25014] Add contextlib.itercm()

2015-09-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I don't think I like this idea. It's not really a common use case (I've never 
wished I had itercm()) and it will make it possible to write slightly obscure 
code. Of course you can already write obscure code using itertools :-)

--

___
Python tracker 

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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread eryksun

eryksun added the comment:

With MSVC, if errno is cleared before calling strftime, then when buflen == 0 
you know whether it's an invalid format string (EINVAL) or maxsize is too small 
(ERANGE). There's no need to guess. Oddly, only EINVAL is documented, even 
though setting ERANGE has been in the implementation for years. 

VC 10 (strftime.c):

/* error - return an empty string */
*(strstart)='\0';

/* now return our error/insufficient buffer indication */
if ( !failed && left <= 0 )
{
/* do not report this as an error to allow the caller to resize 
*/
errno=ERANGE;
}
else
{
_VALIDATE_RETURN( FALSE, EINVAL, 0);
}

VC 14 (time/wcsftime.cpp):

// Error:  return an empty string:
*string = L'\0';

// Now return our error/insufficient buffer indication:
if (!failed && remaining <= 0)
{
// Do not report this as an error to allow the caller to resize:
errno = ERANGE;
}
else
{
_VALIDATE_RETURN(false, EINVAL, 0);
}

--

___
Python tracker 

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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread Steve Dower

Steve Dower added the comment:

How's this for the test (I added an explanatory comment, since it may look like 
it isn't testing anything to someone who isn't familiar with the issue):

def test_strftime_format_check(self):
# Test that strftime does not crash on invalid format strings
# that may trigger a buffer overread. When not triggered,
# strftime may succeed or raise ValueError depending on
# the platform.
for x in [ '', 'A', '%A', '%AA' ]:
for y in range(0x0, 0x10):
for z in [ '%', 'A%', 'AA%', '%A%', 'A%A%', '%#' ]:
try:
time.strftime(x * y + z)
except ValueError:
pass

--

___
Python tracker 

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



[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3510e5d435db by Martin Panter  in branch '2.7':
Issue #17849: Raise sensible exception for invalid HTTP tunnel response
https://hg.python.org/cpython/rev/3510e5d435db

--
nosy: +python-dev

___
Python tracker 

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



[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-06 Thread Martin Panter

Martin Panter added the comment:

Thanks Cory. Error now looks like this:

$ https_proxy=http://223.19.230.181:80 ./python -c 'from urllib2 import *; 
urlopen("https://bugs.python.org/issue17849";)'
[. . .]
urllib2.URLError: 

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

___
Python tracker 

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



[issue23406] interning and list comprehension leads to unexpected behavior

2015-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6c222848badd by Martin Panter  in branch '2.7':
Issue #23406: Clarify documentation on multiplying a sequence
https://hg.python.org/cpython/rev/6c222848badd

New changeset 57f8c7ad7782 by Martin Panter  in branch '3.4':
Issue #23406: Clarify documentation on multiplying a sequence
https://hg.python.org/cpython/rev/57f8c7ad7782

New changeset f624b7fd3b83 by Martin Panter  in branch '3.5':
Issue #23406: Merge 3.4 into 3.5
https://hg.python.org/cpython/rev/f624b7fd3b83

New changeset d2b3c7c5ef02 by Martin Panter  in branch 'default':
Issue #23406: Merge 3.5 into 3.6
https://hg.python.org/cpython/rev/d2b3c7c5ef02

--
nosy: +python-dev

___
Python tracker 

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



[issue23406] interning and list comprehension leads to unexpected behavior

2015-09-06 Thread Martin Panter

Changes by Martin Panter :


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

___
Python tracker 

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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread Steve Dower

Steve Dower added the comment:

New PR: 
https://bitbucket.org/larry/cpython350/pull-requests/19/issue-24917-time_strftime-buffer-over-read

--

___
Python tracker 

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



[issue25005] webbrowser breaks on query strings with multiple fields on Windows

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

I want to ship something, but I don't think it'll be either of those patches in 
their current form.

Maybe I'm dense, but I don't feel like I understand these patches.  They have 
very different approaches.

The first one attempts to rehabilitate the patch by running the browser 
directly instead of using "start"?  Do the features added in issue 8232 still 
work?

The second one just backs out the feature completely?  The features added in 
issue 8232 are gone?

And both patches switch from using subprocess.call(shell=True) to 
os.startfile(), which is the security hole David is talking about, which isn't 
actually what this bug is about.

Do both patches fix the erroneous behavior observed by the original bug report, 
with "&" being interpreted as a shell command separator?

--

___
Python tracker 

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



[issue25014] Add contextlib.itercm()

2015-09-06 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> I don't think I like this idea. It's not really a common use
> case (I've never wished I had itercm()) and it will make it 
> possible to write slightly obscure code. Of course you can
>  already write obscure code using itertools :-)

I concur with Antoine and think the world is better off without this one.

--

___
Python tracker 

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



[issue25004] test_mmap should catch f.close() failure in LargeMmapTests._make_test_file()

2015-09-06 Thread Martin Panter

Martin Panter added the comment:

Patch looks good to me. Anything that fails flush() is likely to also fail 
close(). But I cannot reproduce the actual failure. Perhaps it requires a file 
system like FAT that doesn’t support “holes” in files.

--
nosy: +berker.peksag, martin.panter
stage:  -> commit review

___
Python tracker 

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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

Steve, did you confirm that the test triggers the array bounds bug when the 
patch *isn't* applied?  I want to confirm both that a) the test exercises the 
bug, and b) the fix fixes the bug.  I assume you ran the test suite with the 
patch applied, so that covers b).

--

___
Python tracker 

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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread Steve Dower

Steve Dower added the comment:

I wasn't able to repro the crash at all, even with the debugging flags that 
make this sort of issue more prominent. It relies on a very precise layout of 
multiple objects in memory, or possibly a specific sequence of 
allocations/deallocations, as well as a format string ending in an unescaped 
'%' or (on Windows) '%#'.

It's still obviously an issue though - we should have the check for '\0' there 
by any reasonably analysis of the code, or else should not be adding 2 to the 
pointer to start the next step of the search.

--

___
Python tracker 

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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

Okay, I think *I* reproduced it.

1) I pulled your cpython350 fork down locally.

2) I updated to your checkin that fixed the bug. (c31dad22c80d)

3) I reverted the change to Modules/timemodule.c to put the bug back:
   % hg cat -r 97393 Modules/timemodule.c > Modules/timemodule.c

4) I changed line 611 (or so) from "#if defined(MS_WINDOWS) && 
!defined(HAVE_WCSFTIME)" to "#if 1" so I'd get the code that had the bug.

5) I ran "./configure --with-valgrind && make" to make it.

6) I ran "valgrind ./python -m test test_time" and ***Valgrind complained about 
an array overrun***.

7) I restored the bugfix to Modules/timemodule.c, then reinstated the change 
from 4) above.

8) I ran make and valgrind again and didn't get the complaint about the array 
overrun.

For grins I also tried enabling the other stanza of code that has the bug (the 
AIX / sun / have_wcsftime) and observed the same thing.

Is that convincing?

--

___
Python tracker 

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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread Steve Dower

Steve Dower added the comment:

Good enough for me.

--

___
Python tracker 

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



[issue23517] datetime.utcfromtimestamp rounds results incorrectly

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

So is this considered broken enough that I need to accept a fix for 3.5.0?  And 
has a consensus been reached about exactly what that fix would be?

--

___
Python tracker 

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



[issue22970] asyncio: Cancelling wait() after notification leaves Condition in an inconsistent state

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

Reassigning to 3.6.

--
priority: deferred blocker -> release blocker
versions: +Python 3.6 -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



[issue22980] C extension naming doesn't take bitness into account

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

I'm leaving this open just because we're apparently waiting on some "What's 
New" docs.

--

___
Python tracker 

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



[issue22970] asyncio: Cancelling wait() after notification leaves Condition in an inconsistent state

2015-09-06 Thread Guido van Rossum

Guido van Rossum added the comment:

(It could be fixed in 3.5.1, since asyncio is still provisional in 3.5.)

--

___
Python tracker 

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



[issue23517] datetime.utcfromtimestamp rounds results incorrectly

2015-09-06 Thread Tim Peters

Tim Peters added the comment:

Universal consensus on ROUND_HALF_EVEN, yes.

I would like to see it repaired for 3.5.0, but that's just me saying so without 
offering to do a single damned thing to make it happen ;-)

--

___
Python tracker 

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



[issue23517] datetime.utcfromtimestamp rounds results incorrectly

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

Well, I'm already holding up rc3 on one other issue, might as well fix this 
too.  Can somebody make me a pull request?

--

___
Python tracker 

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



[issue23517] datetime.utcfromtimestamp rounds results incorrectly

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

I suspect we're not fixing this in 3.4, so I'm removing 3.4 from the version 
list.

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



[issue25005] webbrowser breaks on query strings with multiple fields on Windows

2015-09-06 Thread Steve Dower

Steve Dower added the comment:

subprocess with shell=True turns it into a "cmd.exe /C "start chrome.exe ..."" 
type command, which means the arguments will use shell parsing (e.g. > for 
redirection, & for multiple commands, etc.)

"start" in cmd.exe behaves the same as os.startfile, but can also accept 
arguments. Patch 1 lets startfile accept arguments, so we don't have to go via 
cmd.exe to launch the browser (we're still resolving it via the shell, so the 
behaviour is the same, but the arguments are never interpreted using shell 
rules). All the functionality of #8232 is still there and still works.

Patch 2 is a rollback of #8232, so we ship the same functionality as in Python 
3.4. Because this only supports the default browser and does not support 
selecting between new tab/window, it can go back to using os.startfile without 
arguments.

A third option would be to find some other way to discover the full path to 
each browser and launch it without using start/os.startfile. (This is what I 
was thinking originally when I said it would be too big a change.)

--

___
Python tracker 

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



[issue25004] test_mmap should catch f.close() failure in LargeMmapTests._make_test_file()

2015-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7a9dddc11f2e by Martin Panter  in branch '3.4':
Issue #25004: Handle out-of-disk-space error in LargeMmapTests
https://hg.python.org/cpython/rev/7a9dddc11f2e

New changeset fd4bf05b32ba by Martin Panter  in branch '3.5':
Issue #25004: Merge 3.4 into 3.5
https://hg.python.org/cpython/rev/fd4bf05b32ba

New changeset 6c9159661aa8 by Martin Panter  in branch 'default':
Issue #25004: Merge 3.5 into 3.6
https://hg.python.org/cpython/rev/6c9159661aa8

--
nosy: +python-dev

___
Python tracker 

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



[issue23406] interning and list comprehension leads to unexpected behavior

2015-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2640a4630e9e by Martin Panter  in branch '3.5':
Issue #23406: Remove specific line number from susp-ignored.csv
https://hg.python.org/cpython/rev/2640a4630e9e

New changeset 48f1e9a47301 by Martin Panter  in branch 'default':
Issue #23406: Merge 3.5 into 3.6
https://hg.python.org/cpython/rev/48f1e9a47301

--

___
Python tracker 

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



[issue25005] webbrowser breaks on query strings with multiple fields on Windows

2015-09-06 Thread Steve Dower

Steve Dower added the comment:

To be more specific, with patch 1 applied:

subprocess.call("start file a&b>x", shell=True)

is equivalent to typing the following at a command prompt:

start file a & b > x

That is, "start file a" and then do "b", redirecting the output from "b" to a 
file named "x".

With the change to os.startfile, we can write it as this:

os.startfile("file", "open", "a&b>x")

Which matches what we intended above. (startfile implies "start ", and passes the third argument to the launched program without 
modification.)

--

___
Python tracker 

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



[issue25005] webbrowser breaks on query strings with multiple fields on Windows

2015-09-06 Thread Steve Dower

Steve Dower added the comment:

Oh, and the "start" is necessary because, while the Windows kernel can only 
resolve "chrome.exe" if it appears on PATH, the Windows shell has some other 
ways to resolve it.

By using ShellExecute (via 'start' or startfile), we can let the OS find it 
rather than having to find it ourselves.

--

___
Python tracker 

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



[issue25005] webbrowser breaks on query strings with multiple fields on Windows

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

So, whatever the security hole is that subprocess.call(shell=True) leaves open, 
os.startfile() doesn't have?  os.startfile() doesn't use a shell?  (How does it 
find the full path to the executable?)

--

___
Python tracker 

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



[issue25004] test_mmap should catch f.close() failure in LargeMmapTests._make_test_file()

2015-09-06 Thread Martin Panter

Martin Panter added the comment:

Okay I was able to force the error by using all my disk space up, and confirmed 
the change works.

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



[issue25005] webbrowser breaks on query strings with multiple fields on Windows

2015-09-06 Thread Steve Dower

Steve Dower added the comment:

Correct.

os.startfile uses ShellExecute 
(https://msdn.microsoft.com/en-us/library/windows/desktop/bb762153.aspx), which 
is the same API that the shell uses for the 'start' command. So by using 
os.startfile we get the same behaviour, but we're calling in after the terminal 
would have done its own parsing (for piping/redirection/etc.).

--

___
Python tracker 

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



[issue25005] webbrowser breaks on query strings with multiple fields on Windows

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

Well, so, what do you recommend I do here?

--

___
Python tracker 

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



[issue25005] webbrowser breaks on query strings with multiple fields on Windows

2015-09-06 Thread Steve Dower

Steve Dower added the comment:

Rollback.

I'm not 100% confident in patch 1 (too many things I can't predict) and with 
only a week it probably won't get enough testing to flush out other surprises.

--

___
Python tracker 

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



[issue25005] webbrowser breaks on query strings with multiple fields on Windows

2015-09-06 Thread Steve Dower

Steve Dower added the comment:

I guess now I've been that definitive I'll go make you a PR :)

If someone (perhaps Brandon?) is willing to thoroughly validate patch 1 we 
might be able to consider it for 3.5.1 (the only API change is to startfile() - 
the webbrowser API is already there, it just doesn't report much). Otherwise, 
it'll have to be 3.6. (But will it get any more tested there? Not so sure...)

--
nosy: +jbmilam

___
Python tracker 

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



[issue25005] webbrowser breaks on query strings with multiple fields on Windows

2015-09-06 Thread Steve Dower

Steve Dower added the comment:

PR is: 
https://bitbucket.org/larry/cpython350/pull-requests/20/issue-25005-backout-fix-for-8232-because/diff

--

___
Python tracker 

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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

Backout pull request merged, please forward-merge, thanks!

--

___
Python tracker 

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



[issue25005] webbrowser breaks on query strings with multiple fields on Windows

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

Backout pull request merged, please forward-merge, thanks!

--

___
Python tracker 

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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

(I meant, just normal pull request.  I did your two pull requests right in a 
row and got my wires crossed.)

--

___
Python tracker 

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



[issue25013] run_pdb() in test_pdb.py always returns stderr as None

2015-09-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Xavier, thanks for the idea.  It seems sensible and I considered applying this, 
but since this is an internal pdb test design change rather than a pdb bug fix, 
and two other tests seem candidates for the same change, I am going to leave it 
to Gerog or someone else to review.  I do not understand the details of 
run_pdb, the reason why some tests use it and other inline a subprocess call, 
or why they all mix together stdout and stderr.

--
components: +Tests
nosy: +georg.brandl
stage:  -> patch review

___
Python tracker 

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



[issue23517] datetime.utcfromtimestamp rounds results incorrectly

2015-09-06 Thread Larry Hastings

Larry Hastings added the comment:

Okay, this is literally the only thing rc3 is waiting on now.

--

___
Python tracker 

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



[issue24917] time_strftime() Buffer Over-read

2015-09-06 Thread Larry Hastings

Changes by Larry Hastings :


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



  1   2   >