[issue25870] textwrap is very slow on long words without spaces

2015-12-15 Thread Bernhard M. Wiedemann

Bernhard M. Wiedemann added the comment:

should probably be

   lines = [x[n*64:(n+1)*64] for n in range(((len(x)-1)//64)+1)]

to avoid an empty line added when the last line is full
which once again shows why people prefer to use standard libraries
for this kind of work

--

___
Python tracker 

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



[issue25871] textwrap.dedent doesn't find common substring when spaces and tabs are mixed

2015-12-15 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> duplicate
stage:  -> resolved
superseder:  -> textwrap.dedent() fails when largest common whitespace is a 
substring of smallest leading whitespace

___
Python tracker 

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



[issue25859] EOFError in test_nntplib.NetworkedNNTPTests.test_starttls()

2015-12-15 Thread Berker Peksag

Berker Peksag added the comment:

> Would it be appropriate to change this test so that instead of connecting to 
> a remote server, we connect to a local server running in a background thread?

+1. We can host it at pythontest.net if needed. The repo is here: 
https://hg.python.org/pythontestdotnet/

--
nosy: +berker.peksag
stage:  -> needs patch

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2015-12-15 Thread Michael Allen

New submission from Michael Allen:

Modifying a file while getting a stacktrace across multiple threads causes 
linecache's cache to bust and del to be called on the global cache variable. 
This is not thread safe and raises a KeyError.

Reproducible with,

import threading
import traceback

def main():
with open(__file__, 'a') as fp:
fp.write(' ')
traceback.format_stack()

threads = [
threading.Thread(target=main)
for i in range(100)
]
map(lambda t: t.start(), threads)
map(lambda t: t.join(), threads)

I see the following error,

Exception in thread Thread-56:
Traceback (most recent call last):
  File "/Users/me/.pyenv/versions/2.7.10/lib/python2.7/threading.py", line 810, 
in __bootstrap_inner
self.run()
  File "/Users/me/.pyenv/versions/2.7.10/lib/python2.7/threading.py", line 763, 
in run
self.__target(*self.__args, **self.__kwargs)
  File "test.py", line 7, in main
traceback.format_stack()
  File "/Users/me/.pyenv/versions/2.7.10/lib/python2.7/traceback.py", line 279, 
in format_stack
return format_list(extract_stack(f, limit))
  File "/Users/me/.pyenv/versions/2.7.10/lib/python2.7/traceback.py", line 305, 
in extract_stack
linecache.checkcache(filename)
  File "/Users/me/.pyenv/versions/2.7.10/lib/python2.7/linecache.py", line 69, 
in checkcache
del cache[filename]
KeyError: 'test.py'

Possible solution is to ignore KeyError on del cache[filename].

--
components: Library (Lib)
messages: 256469
nosy: Michael Allen
priority: normal
severity: normal
status: open
title: multithreading traceback KeyError when modifying file
type: crash
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




[issue11220] https sslv3 error 14077417: illegal parameter

2015-12-15 Thread Hari Krishna Dara

Hari Krishna Dara added the comment:

Interesting... the posted Python code for 2.x didn't work for me on 2.6.9 on 
Mac OS X (10.10.5). The code in catch block further generates the below 
exception:

Traceback (most recent call last):
  File "/tmp/t.py", line 17, in connect
self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file, 
ssl_version=ssl.PROTOCOL_SSLv23)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ssl.py",
 line 338, in wrap_socket
suppress_ragged_eofs=suppress_ragged_eofs)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ssl.py",
 line 120, in __init__
self.do_handshake()
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ssl.py",
 line 279, in do_handshake
self._sslobj.do_handshake()
SSLError: [Errno 1] _ssl.c:493: error:140770FC:SSL 
routines:SSL23_GET_SERVER_HELLO:unknown protocol

Is there another workaround that is known to work with this version of Python?

--
nosy: +haridsv

___
Python tracker 

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



[issue25871] textwrap.dedent doesn't find common substring when spaces and tabs are mixed

2015-12-15 Thread Chris Tozer

Chris Tozer added the comment:

Yeah sorry - I am stuck on a baked-at-2.7.5 version thanks to CentOS.  I was 
misled by the banner telling me it was more recent than the fix.

I'll just close, I'm sure the fix in 2.7.11 is good, per issue 21827.

--
status: open -> closed

___
Python tracker 

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



[issue25871] textwrap.dedent doesn't find common substring when spaces and tabs are mixed

2015-12-15 Thread Chris Tozer

New submission from Chris Tozer:

Two lines, one has three spaces, one has two spaces then a tab - dedent doesn't 
take the two spaces away...

Python 2.7.5 (default, Nov 20 2015, 02:00:19) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from textwrap import dedent
>>> dedent("   some\n  \tthing")
'   some\n  \tthing'
>>> dedent("   some\n   \tthing")
'some\n\tthing'

Looks very similar to issue 21827, but having upgraded to a newer build of 2.7 
(Nov 2015, as above), I still see the same behaviour.  I assume the November 
build would have a fix made in October, but I don't know how the process 
actually works...

--
components: Library (Lib)
messages: 256463
nosy: Chris Tozer
priority: normal
severity: normal
status: open
title: textwrap.dedent doesn't find common substring when spaces and tabs are 
mixed
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



[issue25870] textwrap is very slow on long words without spaces

2015-12-15 Thread R. David Murray

R. David Murray added the comment:

This has already been fixed in issue 22687.  It was deemed a performance 
improvement for an edge case and was not backported.

I don't see the advantage of using textwrap to split up base64 encoded strings, 
by the way.  The module isn't designed for doing line splitting, it designed 
for doing text wrapping where blanks matter.  For your application I would just 
do:

   lines = [x[n*64:(n+1)*64] for n in range((len(x)//64)+1)]

--
components:  -Benchmarks, Extension Modules, Regular Expressions
nosy: +r.david.murray
resolution:  -> duplicate
status: open -> closed
superseder:  -> horrible performance of textwrap.wrap() with a long word

___
Python tracker 

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



[issue25871] textwrap.dedent doesn't find common substring when spaces and tabs are mixed

2015-12-15 Thread R. David Murray

R. David Murray added the comment:

Your banner says 2.7.5, so you aren't even running the most recent 2.7 release. 
 This fix should appear in that most recent release, 2.7.11.  Can you test with 
2.7.11 and report if that fixes your problem?

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



[issue17055] ftplib.ftpcp test

2015-12-15 Thread Berker Peksag

Berker Peksag added the comment:

ftpcp is undocumented and not part of the public API. It was added(changeset 
https://hg.python.org/cpython/rev/63cdfbb4a2bb#l1.433) in 1996 and it looks 
like its code was only touched for whitespace and PEP 8 fixes.

I think we need to decide whether we want this to be documented or not. I'm not 
familiar with the FTP spec, but some people might find it useful: 
http://ftputil.sschwarzer.net/trac/ticket/15#comment:5

--
nosy: +berker.peksag

___
Python tracker 

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



[issue25874] Add notice that XP is not supported on Python 3.5+

2015-12-15 Thread Chris Wilcox

New submission from Chris Wilcox:

This is a documentation change to make it easier to discover that XP is not a 
supported OS.  Content was taken from the 'whats new' section and added to the 
top of the main article.

--
assignee: docs@python
components: Documentation
files: add-supported-versions-section-windows.diff
keywords: patch
messages: 256473
nosy: crwilcox, docs@python
priority: normal
severity: normal
status: open
title: Add notice that XP is not supported on Python 3.5+
type: enhancement
versions: Python 3.5, Python 3.6
Added file: 
http://bugs.python.org/file41319/add-supported-versions-section-windows.diff

___
Python tracker 

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



[issue25874] Add notice that XP is not supported on Python 3.5+

2015-12-15 Thread SilentGhost

SilentGhost added the comment:

This seems fully covered in the What's new for 3.5: 
https://docs.python.org/3/whatsnew/3.5.html#unsupported-operating-systems

--
nosy: +SilentGhost
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-15 Thread Guido van Rossum

Guido van Rossum added the comment:

I like the idea. I have one suggestion: can we add 'milliseconds' as an option 
too? And might a well add 'nanoseconds' too, for future-proofing. I suppose 
there isn't a real use case for 'hours' but it seems silly to  leave it out. I 
expect that 'minutes' will be the most popular option, since HH:MM is the 
precision that most people care about for meetings and stuff.

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-15 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

It looks like issue19475_v3.patch uses some fancy Unicode quotes in the 
docstrings and .rst docs.  Please change them to ASCII.

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-15 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

GvR> I suppose there isn't a real use case for 'hours' but it seems silly to  
leave it out.

Shouldn't we also have 'none' to leave out the time component entirely?

--

___
Python tracker 

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



[issue25873] Faster ElementTree iterating

2015-12-15 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch refactors and optimize the code for iterating ElementTree. 
Refactoring and minor optimization makes the code about 30 lines smaller and 
2-3% faster. Using a continuous array instead of linked list makes the code up 
to 40% faster (lxml benchmark was used to measurement).

In addition the patch fixes possible issue with owning references.

--
components: Extension Modules
files: etree_iter.patch
keywords: patch
messages: 256472
nosy: brett.cannon, scoder, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Faster ElementTree iterating
type: performance
versions: Python 3.6
Added file: http://bugs.python.org/file41318/etree_iter.patch

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-15 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> The problem here is that millisecond and nanosecond seems not to be 
> attributes of the datetime object.

millisecond = dt.microsecond // 1000

nanosecond = 0  # until we add it to datetime.

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-15 Thread Guido van Rossum

Guido van Rossum added the comment:

Actually, nanosecond = dt.microsecond*1000.

I don't think we need 'none' -- you should just extract the date component
and call its isoformat() method if that's what you want.

On Tue, Dec 15, 2015 at 12:01 PM, Alexander Belopolsky <
rep...@bugs.python.org> wrote:

>
> Alexander Belopolsky added the comment:
>
> > The problem here is that millisecond and nanosecond seems not to be
> attributes of the datetime object.
>
> millisecond = dt.microsecond // 1000
>
> nanosecond = 0  # until we add it to datetime.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-15 Thread Alessandro Cucci

Alessandro Cucci added the comment:

I can work on that, although I'll need help from some senior dev. The problem 
here is that millisecond and nanosecond seems not to be attributes of the 
datetime object. What about open a new issue if we have to add them? Is not 
about adding an optional flag anymore...
Anyway, as I said, any help is appreciated!

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-15 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> Actually, nanosecond = dt.microsecond*1000.

I was thinking in terms breaking the fractional part of say

00:00:00.123456789

into

mili = 123
micro = 456
nano = 789

but you are right, a correct analogy for dt.microsecond in this case will be 
nanosecond=123456789 or 123456000 until we start storing enough precision.

--

___
Python tracker 

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



[issue25866] Reference 3. Data Model: miscellaneous minor cleanups on the word "sequence".

2015-12-15 Thread Andrew Barnert

New submission from Andrew Barnert:

None of the below are very serious or likely to mislead anyone using or 
implementing Python, but...

---

3.3.2. Customizing attribute access

The docs for `__dir__` say:

> A sequence must be returned. dir() converts the returned sequence to a list 
> and sorts it.

At least in CPython and PyPy, this isn't enforced; any iterable can be returned 
(and it's then converted to a list and sorted). You can even make `__dir__` a 
generator function. (I've never seen that in the wild--but I have seen code 
that returns a `map` iterator.)

I think it would be better to say "An iterable must be returned. dir() converts 
the returned iterable to a list and sorts it."

---

3.3.2.3. __slots__

> This class variable can be assigned a string, iterable, or sequence of 
> strings...

While it's true that you can assign any iterable, it's at best misleading to 
assign an iterator. For example, if you use `__slots__ = iter('abc')`, you will 
get a class with descriptors named `a`, `b`, and `c`, but with an empty 
iterator in `__slots__`. There's probably no reason to actually outlaw that, 
but it might be worth noting in 3.3.2.3.1 along with the other weird 
possibilities like assigning a mapping.

---

3.3.6. Emulating container types

The docs still say that the ABCs are in `collections` rather than 
`collections.abc`.

> ... for mappings, __iter__() should be the same as keys()

No; `__iter__()` should be an iterator over the keys; `keys()` _can_ be an 
iterator, but generally should be a view instead.

> The membership test operators (in and not in) are normally implemented as an 
> iteration through a sequence. However, container objects can supply the 
> following special method with a more efficient implementation, which also 
> does not require the object be a sequence.

I don't think this should say "through a sequence". They're implemented as 
iteration through whatever the container is, whether it's a sequence, a set, a 
linked list, or anything else. The documentation on `__contains__` immediately 
below clarifies this, but it's probably better to be clear from the start.

--
assignee: docs@python
components: Documentation
messages: 256445
nosy: abarnert, docs@python
priority: normal
severity: normal
status: open
title: Reference 3. Data Model: miscellaneous minor cleanups on the word 
"sequence".
type: enhancement

___
Python tracker 

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



[issue25849] files, opened in unicode (text): write() returns symbols count, but seek() expect offset in bytes

2015-12-15 Thread STINNER Victor

STINNER Victor added the comment:

> If the “slow reconstruction algorithm” was clarified or removed, ...

I wrote this algorithm, or I helpd to write it, I don't recall.

The problem is readahead: TextIOWrapper read more bytes than requested for 
performances. But when tell() is called, the user expects to get the current 
file position, not the "read ahead" file position. So we have to go backward. 
Problem: TextIOWrapper uses text (Unicode) whereas all files are bytes on the 
disk. We need to compute the size of the readahead buffer in bytes from a 
buffer in characters.

The bad performances comes from multibyte codecs which requires heuristic to 
first guess the number of bytes and then really encode back bytes to find the 
exact size.

See _pyio.TextIOWrapper.tell() for the Python implementation.

# Fast search for an acceptable start point, close to our
# current pos.
# Rationale: calling decoder.decode() has a large overhead
# regardless of chunk size; we want the number of such calls to
# be O(1) in most situations (common decoders, non-crazy input).
# Actually, it will be exactly 1 for fixed-size codecs (all
# 8-bit codecs, also UTF-16 and UTF-32).

(Incomplete) history of the Python implementation of the tell() method:

* changeset 7c6972f37fe3 (2007)
* changeset 28bc7ed26574: More efficient implementation
* changeset b5a2e753b682: use the new getstate/setstate decoder API
* changeset 04050373d799 (2008): fix for stateful decoders
* changeset 39a4f4393ef1: additional fixes to the handling of 'limit'
* (Lib/io.py moved to Lib/_pyio.py)
* changeset 4b6052320e98 (Issue #4): optimization

--

___
Python tracker 

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



[issue25849] files, opened in unicode (text): write() returns symbols count, but seek() expect offset in bytes

2015-12-15 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I don't understand what the complaint is. If you think seek()/tell() are not 
useful, just don't use them.

--

___
Python tracker 

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



[issue25867] os.stat raises exception when using unicode and no locale is set

2015-12-15 Thread Ondrej Sejvl

New submission from Ondrej Sejvl:

os.stat() raises exception UnicodeEncodeError when path is unicode and no 
locale is set in envinronment (this occures when running app with daemon tools 
-> LC_ALL=)

How to simulate:
$ env -i python
>>> import os
>>> os.stat(u"\xf0")
Traceback (most recent call last):
  File "", line 1, in 
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf0' in position 0: 
ordinal not in range(128)

Is this a valid behaviour? Then maybe some notification in documentation would 
be nice (I am using os.path.isfile and now UnicodeEncodeError raised...)

Thanks
Ondra

--
messages: 256446
nosy: sejvlond
priority: normal
severity: normal
status: open
title: os.stat raises exception when using unicode and no locale is set

___
Python tracker 

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



[issue25868] test_eintr.test_sigwaitinfo() hangs on "AMD64 FreeBSD CURRENT 3.x" buildbot

2015-12-15 Thread STINNER Victor

STINNER Victor added the comment:

> With the pipe, there is still a potential race after the parent writes to the 
> pipe and before sigwaitinfo() is invoked, versus the child sleep() call.

Yeah, I know, that's why I kept the ugly 100 ms sleep.

> What do you think of my suggestion to block the signal? Then (in theory) it 
> should be robust, rather than relying on timing.
> https://bugs.python.org/issue25277#msg256278

I read your comment, but with this change, I'm not sure anymore that we test 
that sigwaitinfo() retries when it's interrupted by a signal (EINTR).

--

___
Python tracker 

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



[issue25868] test_eintr.test_sigwaitinfo() hangs on "AMD64 FreeBSD CURRENT 3.x" buildbot

2015-12-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7f49af7046e4 by Victor Stinner in branch 'default':
Issue #25868: Try to make test_eintr.test_sigwaitinfo() more reliable
https://hg.python.org/cpython/rev/7f49af7046e4

--
nosy: +python-dev

___
Python tracker 

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



[issue25868] test_eintr.test_sigwaitinfo() hangs on "AMD64 FreeBSD CURRENT 3.x" buildbot

2015-12-15 Thread STINNER Victor

New submission from STINNER Victor:

Re-running test 'test_eintr' in verbose mode
test_all (test.test_eintr.EINTRTests) ... test test_eintr failed
FAIL

==
FAIL: test_all (test.test_eintr.EINTRTests)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_eintr.py",
 line 20, in test_all
script_helper.assert_python_ok("-u", tester)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/support/script_helper.py",
 line 135, in assert_python_ok
return _assert_python(True, *args, **env_vars)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/support/script_helper.py",
 line 121, in _assert_python
err))
AssertionError: Process return code is 1
command line: 
['/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/python', '-X', 
'faulthandler', '-I', '-u', 
'/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/eintrdata/eintr_tester.py']

stdout:
---
test_read (__main__.OSEINTRTest) ... ok
test_wait (__main__.OSEINTRTest) ... ok
test_wait3 (__main__.OSEINTRTest) ... ok
test_wait4 (__main__.OSEINTRTest) ... ok
test_waitpid (__main__.OSEINTRTest) ... ok
test_write (__main__.OSEINTRTest) ... ok
test_accept (__main__.SocketEINTRTest) ... ok
test_open (__main__.SocketEINTRTest) ... ok
test_os_open (__main__.SocketEINTRTest) ... ok
test_recv (__main__.SocketEINTRTest) ... ok
test_recvmsg (__main__.SocketEINTRTest) ... ok
test_send (__main__.SocketEINTRTest) ... ok
test_sendall (__main__.SocketEINTRTest) ... ok
test_sendmsg (__main__.SocketEINTRTest) ... ok
test_sleep (__main__.TimeEINTRTest) ... ok
test_sigtimedwait (__main__.SignalEINTRTest) ... ok
test_sigwaitinfo (__main__.SignalEINTRTest) ...
---

stderr:
---
Timeout (0:10:00)!
Thread 0x000801815000 (most recent call first):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/eintrdata/eintr_tester.py",
 line 404 in test_sigwaitinfo
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/case.py",
 line 600 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/case.py",
 line 648 in __call__
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/runner.py",
 line 176 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/support/__init__.py",
 line 1780 in _run_suite
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/support/__init__.py",
 line 1814 in run_unittest
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/eintrdata/eintr_tester.py",
 line 472 in test_main
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/eintrdata/eintr_tester.py",
 line 476 in 
---

--
Ran 1 test in 607.737s

FAILED (failures=1)
1 test failed again:
test_eintr
*** Error code 1

--
messages: 256449
nosy: bapt, haypo, koobs
priority: normal
severity: normal
status: open
title: test_eintr.test_sigwaitinfo() hangs on "AMD64 FreeBSD CURRENT 3.x" 
buildbot
versions: Python 3.6

___
Python tracker 

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



[issue25868] test_eintr.test_sigwaitinfo() hangs on "AMD64 FreeBSD CURRENT 3.x" buildbot

2015-12-15 Thread Martin Panter

Martin Panter added the comment:

With the pipe, there is still a potential race after the parent writes to the 
pipe and before sigwaitinfo() is invoked, versus the child sleep() call.

What do you think of my suggestion to block the signal? Then (in theory) it 
should be robust, rather than relying on timing.

https://bugs.python.org/issue25277#msg256278

--
nosy: +martin.panter

___
Python tracker 

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



[issue25868] test_eintr.test_sigwaitinfo() hangs on "AMD64 FreeBSD CURRENT 3.x" buildbot

2015-12-15 Thread Martin Panter

Martin Panter added the comment:

You would only block SIGUSR1 (the signal being waited for). SIGALRM would 
remain unblocked, so the syscall should be interrupted by it.

If everything is working smoothly, you should generally see two SIGALRM 
interrupts per sleep time, so I don’t think it is worth changing to three.

I guess you could increment a counter in the SIGALRM handler to verify that it 
gets called multiple times in the vicinity of the sigwaitinfo() call.

--

___
Python tracker 

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



[issue25869] Faster ElementTree deepcopying

2015-12-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file41314/etree_deepcopy.patch

___
Python tracker 

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



[issue25868] test_eintr.test_sigwaitinfo() hangs on "AMD64 FreeBSD CURRENT 3.x" buildbot

2015-12-15 Thread STINNER Victor

STINNER Victor added the comment:

I used a short sleep of 100 ms to test if the pipe is enough to synchronize the 
parent and the child, but this delay is too short to test that sigwaitinfo() is 
interrupted by EINTR.

"self.sleep_time = 0.100" must be removed to use the default sleep time 
(currently 200 ms, signal_period *  2).

By the way, we should maybe use sleep_time = signal_period * 3 to test more 
signals?

--

___
Python tracker 

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



[issue25865] 7.2 Assignment statements documentation is vague and slightly misleading

2015-12-15 Thread Martin Panter

Martin Panter added the comment:

Regarding assigning to (), see Issue 23275. Looks like there is a patch to 
enable it.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25868] test_eintr.test_sigwaitinfo() hangs on "AMD64 FreeBSD CURRENT 3.x" buildbot

2015-12-15 Thread Martin Panter

Martin Panter added the comment:

BTW I definitely think your pipe solution is better than before, which was 
relying on the whole Python process startup time being fast. The race window 
should be much smaller now.

--

___
Python tracker 

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



[issue25869] Faster ElementTree deepcopying

2015-12-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file41316/etree_deepcopy.patch

___
Python tracker 

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



[issue25869] Faster ElementTree deepcopying

2015-12-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file41315/bench_etree_deepcopy.log

___
Python tracker 

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



[issue25869] Faster ElementTree deepcopying

2015-12-15 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

According to lxml benchmark [1], deepcopying a tree in ElementTree is about 20 
times slower than in lxml. Proposed patch optimizes deepcopying C 
implementation of ElementTree about 20 times. It is now 5% to 3 times faster 
than in lxml.

[1] http://lxml.de/performance.html

--
components: Extension Modules
files: etree_deepcopy.patch
keywords: patch
messages: 256455
nosy: brett.cannon, scoder, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Faster ElementTree deepcopying
type: performance
versions: Python 3.6
Added file: http://bugs.python.org/file41314/etree_deepcopy.patch

___
Python tracker 

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



[issue25875] PYODBC talk to Oracle under Windows 10.

2015-12-15 Thread R. David Murray

R. David Murray added the comment:

pyodbc is not a part of the Python standard library.  You'll need to seek 
support from the pyodbc community for your problem.  If you don't know how to 
find them, I'd suggest posting to the python-list mailing list for help.  (You 
might want to do that anyway, since the issue sounds like it might not be a bug 
but rather some piece of knowledge you are missing).

--
nosy: +r.david.murray
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue25876] test_gdb: use subprocess._args_from_interpreter_flags() to test Python with more options

2015-12-15 Thread STINNER Victor

New submission from STINNER Victor:

Attached patch pass Python options to the Python program run in gdb, so it 
allows to test more cases.

What do you think?

I don't think that it's worth to apply the patch to Python < 3.6.

--
components: Tests
files: test_gdb.patch
keywords: patch
messages: 256484
nosy: haypo
priority: normal
severity: normal
status: open
title: test_gdb: use subprocess._args_from_interpreter_flags() to test Python 
with more options
versions: Python 3.6
Added file: http://bugs.python.org/file41320/test_gdb.patch

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-15 Thread Martin Panter

Martin Panter added the comment:

Alessandro, did you try running the test suite? It is broken for me. One of the 
bugs is that it now omits zero hours, minutes, and seconds in addition to 
microseconds. (Kind of the reverse of what the bug was originally about :).

Other failures look like this:

==
ERROR: test_isoformat (test.datetimetester.TestDateTime)
--
Traceback (most recent call last):
  File "/media/disk/home/proj/python/cpython/Lib/test/datetimetester.py", line 
1560, in test_isoformat
timespec_error = self.time()
AttributeError: 'TestDateTime_Pure' object has no attribute 'time'

I will leave some review comments.

--
nosy: +martin.panter

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-15 Thread Martin Panter

Martin Panter added the comment:

The doc string in the C module needs updating.

--

___
Python tracker 

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



[issue21765] Idle: make 3.x HyperParser work with non-ascii identifiers.

2015-12-15 Thread Tal Einat

Tal Einat added the comment:

It turns out that staying with str.translate in PyParse payed off! An 
optimization in 3.5 (issue21118) has made it much much faster on ASCII-only 
inputs, which are the vast majority in this case.

--

___
Python tracker 

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



[issue25877] python av docs has broken links

2015-12-15 Thread Thomas Latimer

New submission from Thomas Latimer:

https://www.python.org/doc/av/

I was looking for an audio lecture on python to listen to on my drive. I found 
this page, which looked promising, except...

both 'python411' and 'a little bit of python' are broken links.

--
assignee: docs@python
components: Documentation
messages: 256489
nosy: Thomas Latimer, docs@python
priority: normal
severity: normal
status: open
title: python av docs has broken links
type: behavior

___
Python tracker 

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



[issue25847] CPython not using Visual Studio code analysis!

2015-12-15 Thread Alexander Riccio

Alexander Riccio added the comment:

I'll open up a new issue for /W4, and deal with that first.

--

___
Python tracker 

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



[issue25874] Add notice that XP is not supported on Python 3.5+

2015-12-15 Thread Brett Cannon

Brett Cannon added the comment:

Chris' patch, though, fixes a doc that fails to mention our support policy for 
Windows: https://www.python.org/dev/peps/pep-0011/#microsoft-windows . There 
should at least be a sentence saying that once Microsoft no longer supports an 
operating system release then Python also drops support and link to PEP 11 to 
the full explanation.

--
nosy: +brett.cannon
resolution: not a bug -> 
status: closed -> open

___
Python tracker 

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



[issue25610] Add typing.Awaitable

2015-12-15 Thread Guido van Rossum

Guido van Rossum added the comment:

Yes. (There's a corresponding issue for the typehinting repo that's still open 
because the tests need to be segregated into Python-3.5-only tests and tests 
for Python 3.3-3.4).

--
assignee:  -> gvanrossum
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



[issue25878] CPython on Windows builds with /W3, not /W4

2015-12-15 Thread Alexander Riccio

New submission from Alexander Riccio:

This issue is related to Issue25847.

Compiling at /W4 is generally a good idea. It's an industry best practice, and 
even though I don't expect disagreement, I'll throw in a few coding standard 
links:

https://www.securecoding.cert.org/confluence/display/c/MSC00-C.+Compile+cleanly+at+high+warning+levels

https://books.google.com/books?id=pDsFCAAAQBAJ=PA557=PA557=compile+at+highest+warning+level=bl=RlKoHFuuWW=mcz-wqdpf3MhiyGZSYKFvpTmd9A=en=X=0ahUKEwjkhN2Rh9_JAhXIth4KHTTbCiMQ6AEIgwEwEQ#v=onepage=compile%20at%20highest%20warning%20level=false

http://programmers.stackexchange.com/questions/232626/is-it-a-good-practice-to-choose-the-highest-warning-level-in-c-programming

http://ptgmedia.pearsoncmg.com/images/0321113586/items/sutter_item1.pdf


...so I was surprised to discover that the Windows build of CPython compiles at 
/W3!

Bumping it up to /W4 produces ~9,000 warnings (up from ~20).


The patch that I'll include with this issue (first iteration) bumps the warning 
level up to /W4, and I've disabled warnings that (appear) aren't useful. That 
suppresses ~8,000 of those warnings.

The patch isn't quite yet perfect, as Visual Studio made changes that I didn't 
ask for, such as:

-
+

...but that's about it. I had to use `hg diff -w`, because Visual Studio also 
decided to change the spacing in all of the .vcxproj files.

--
messages: 256494
nosy: Alexander Riccio
priority: normal
severity: normal
status: open
title: CPython on Windows builds with /W3, not /W4

___
Python tracker 

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



[issue25873] Faster ElementTree iterating

2015-12-15 Thread Martin Panter

Martin Panter added the comment:

Looks technically correct as far as my knowledge of the malloc routines goes. 
What was the problem with references that you fixed? Maybe with 
parent_stack_push_new() failure?

The main reference counting bug that sticks out to me is with the text and tail 
elements, because element_get_text() etc return a borrowed reference. It might 
be good to fix this while you are at it:

>>> element = Element("tag")
>>> class Text:
... def __bool__(self):
... element.text = "changed"
... return True
... 
>>> element.text = Text()
>>> i = element.itertext()
>>> next(i)
Segmentation fault (core dumped)
[Exit 139]

--
components: +XML
nosy: +martin.panter

___
Python tracker 

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



[issue25610] Add typing.Awaitable

2015-12-15 Thread Berker Peksag

Berker Peksag added the comment:

Can we close this now?

--
nosy: +berker.peksag

___
Python tracker 

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



[issue25870] textwrap is very slow on long words without spaces

2015-12-15 Thread Martin Panter

Martin Panter added the comment:

There is a standard library fuction for that ;) the step argument to range():

lines = (result[n:n + 64] for n in range(0, len(result), 64))

--
nosy: +martin.panter

___
Python tracker 

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



[issue25847] CPython not using Visual Studio code analysis!

2015-12-15 Thread Alexander Riccio

Alexander Riccio added the comment:

See Issue25878.

--

___
Python tracker 

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



[issue25874] Add notice that XP is not supported on Python 3.5+

2015-12-15 Thread Brett Cannon

Changes by Brett Cannon :


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

___
Python tracker 

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



[issue25878] CPython on Windows builds with /W3, not /W4

2015-12-15 Thread Alexander Riccio

Alexander Riccio added the comment:

The warnings that I've disabled are:

C4054, "'conversion' : from function pointer 'type1' to data pointer 'type2'": 
https://msdn.microsoft.com/en-us/library/07d15ax5(v=vs.90).aspx

I disabled 4054because there are lots of void* to (somefuncptr) conversions 
in CPython. I couldn't see any problems with them, and they all seemed 
necessary.


C4100, "'identifier' : unreferenced formal parameter": 
https://msdn.microsoft.com/en-us/library/26kb9fy0.aspx

I disabled C4100 because there are thousands of places in CPython where 
function parameters aren't referenced. Some of these could actually be bugs 
(!!), but right now there are too many benign cases of this to be of use. 
Commenting out parameter names where they're intentionally not referenced is an 
elegant way of suppressing this warning while documenting intent.


C4115, "'type' : named type definition in parentheses": 
https://msdn.microsoft.com/en-us/library/hhzc0806(v=vs.90).aspx

I disabled C4115 because CPython appears to trigger it in benign 
conditions. This warning triggers when a function accepts a structure as an 
argument, and that structure type has not yet been properly declared.


C4127, "conditional expression is constant": 
https://msdn.microsoft.com/en-us/library/6t66728h(v=vs.90).aspx

I disabled C4127 because the do { } while (1) pattern is quite prevalent in 
CPython, and is unlikely to yield any useful warnings.


C4131, "'function' : uses old-style declarator": 
https://msdn.microsoft.com/en-us/library/b92s55e9(v=vs.90).aspx

I disabled C4131 because CPython includes (third party) code that uses the 
silly old style C function declaration form.


C4152, "non standard extension, function/data ptr conversion in expression": 
https://msdn.microsoft.com/en-us/library/bacb5038(v=vs.90).aspx

I disabled C4152 for the same reason that I disabled C4054.


C4200, "nonstandard extension used : zero-sized array in struct/union": 
https://msdn.microsoft.com/en-us/library/79wf64bc.aspx

I disabled C4200 in a few projects, because this is a very common way of 
reducing memory allocations. Block allocations are trickier to correctly use, 
and don't have a standardized, safe, mechanism (not until C++17, at least), but 
they're just too darn useful & common to warn about every single use.


C4204, "nonstandard extension used : non-constant aggregate initializer": 
https://msdn.microsoft.com/en-us/library/6b73z23c.aspx

I disabled C4204 because CPython frequently initializes a struct with local 
variables. This is perfectly reasonable, despite ANSI C incompatibility.


C4244, "'conversion' conversion from 'type1' to 'type2', possible loss of 
data": https://msdn.microsoft.com/en-us/library/th7a07tz.aspx

I disabled C4244, if I remember correctly, because all instances appeared 
safe. I should revisit this one.


C4267, "'var' : conversion from 'size_t' to 'type', possible loss of data": 
https://msdn.microsoft.com/en-us/library/6kck0s93.aspx

I disabled C4267, if I remember correctly, because all instances appeared 
safe. I should revisit this one.


C4706, "assignment within conditional expression": 
https://msdn.microsoft.com/en-us/library/7hw7c1he.aspx

I disabled C4706 because there's lots of code in CPython that allocates 
memory inside the conditional (i.e. `if (!(self = PyObject_New(Pdata, 
_Type)))` from Pdata_New in _pickle.c), which is perfectly valid code. 
Even if it makes me nauseous. 



Running `build.bat -d -v --no-ssl --no-tkinter -c Debug -p x64` produces 524 
warnings.

--
keywords: +patch
Added file: http://bugs.python.org/file41321/W4_v2.patch

___
Python tracker 

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



[issue25878] CPython on Windows builds with /W3, not /W4

2015-12-15 Thread Alexander Riccio

Alexander Riccio added the comment:

I've added the text build output.

--
Added file: http://bugs.python.org/file41322/W4_v2_build_output

___
Python tracker 

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



[issue25794] __setattr__ does not always overload operators

2015-12-15 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
stage:  -> patch review
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



[issue25878] CPython on Windows builds with /W3, not /W4

2015-12-15 Thread Alexander Riccio

Changes by Alexander Riccio :


--
nosy: +paul.moore, 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



[issue25879] Code objects from same line can compare equal

2015-12-15 Thread Kirk McDonald

Kirk McDonald added the comment:

This is a duplicate of http://bugs.python.org/issue25843

--
resolution:  -> duplicate
status: open -> closed

___
Python tracker 

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



[issue25870] textwrap is very slow on long words without spaces

2015-12-15 Thread Bernhard M. Wiedemann

New submission from Bernhard M. Wiedemann:

Many python scripts use textwrap to break base64-encoded strings from openssl 
into lines - e.g. https://bugs.launchpad.net/python-keystoneclient/+bug/1404402
and https://github.com/diafygi/acme-tiny/blob/master/acme_tiny.py#L166

Steps To Reproduce:
time python -c "import textwrap; textwrap.wrap('x'*9000, 64)"

This has a complexity of O(n^2), meaning wrapping 18000 chars takes 4 times as 
long as 9000.

one known workaround is to use
textwrap.wrap('x'*9000, 64, break_on_hyphens=False)

this also has O(n^2) complexity, but is around 2000 times faster.

--
components: Benchmarks, Extension Modules, Library (Lib), Regular Expressions
messages: 256461
nosy: bmwiedemann, brett.cannon, ezio.melotti, mrabarnett, pitrou
priority: normal
severity: normal
status: open
title: textwrap is very slow on long words without spaces
type: performance
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue25873] Faster ElementTree iterating

2015-12-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file41323/etree_iter2.patch

___
Python tracker 

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



[issue1753718] base64 "legacy" functions violate RFC 3548

2015-12-15 Thread R. David Murray

R. David Murray added the comment:

Updated patch that addresses most of the comments.

--
Added file: http://bugs.python.org/file41325/issue-01753718.patch

___
Python tracker 

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



[issue1753718] base64 "legacy" functions violate RFC 3548

2015-12-15 Thread R. David Murray

Changes by R. David Murray :


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



[issue25859] EOFError in test_nntplib.NetworkedNNTPTests.test_starttls()

2015-12-15 Thread Martin Panter

Changes by Martin Panter :


Added file: http://bugs.python.org/file41327/starttls-server.patch

___
Python tracker 

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



[issue25859] EOFError in test_nntplib.NetworkedNNTPTests.test_starttls()

2015-12-15 Thread Martin Panter

Changes by Martin Panter :


Removed file: http://bugs.python.org/file41326/starttls-server.patch

___
Python tracker 

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



[issue23788] test_urllib2_localnet.test_bad_address fails: OSError not raised by urlopen

2015-12-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e81189f75d04 by Martin Panter in branch '3.5':
Issue #23788: Merge redundant test_bad_address() into test_urllibnet
https://hg.python.org/cpython/rev/e81189f75d04

New changeset 16accac4b2f6 by Martin Panter in branch 'default':
Issue #23788: Merge test_bad_address() cleanup from 3.5
https://hg.python.org/cpython/rev/16accac4b2f6

--
nosy: +python-dev

___
Python tracker 

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



[issue23788] test_urllib2_localnet.test_bad_address fails: OSError not raised by urlopen

2015-12-15 Thread Martin Panter

Martin Panter added the comment:

Thanks Berker

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-15 Thread Alessandro Cucci

Alessandro Cucci added the comment:

Please can I have an update on this? It's already 4 months old, I'd like to see 
it closed. :)

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-15 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +matrixise

___
Python tracker 

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



[issue25875] PYODBC talk to Oracle under Windows 10.

2015-12-15 Thread William Abdo

New submission from William Abdo:

PYODBC  talk to Oracle under Windows 10.
I tried everything I could  however,  I was unable to make PYODBC talk to 
Oracle 11g under Windows 10.

I have recently upgraded to Windows 10 and I have an issue with PYODBC 
connecting to Oracle 11g.

It was working OK in Windows 7,  till I upgraded to Windows 10. 
I have tried setting it to Windows 7 compatibility mode .
I have updated the drivers to the latest (Which I think I already had).

Nothing works.

The actual error I get is 
 Traceback (most recent call last):
  File "oraclecountsDec1.py", line 32, in 
pconnObj =  pyodbc.connect( pconnString )
pyodbc.Error: ('NA000', "[NA000] [Microsoft][ODBC driver for 
Oracle][Oracle]Error while trying to retrieve text for error ORA-01019 (1019) 
(SQLDriverConnect); [01000] [Microsoft][ODBC Driver Manager] The driver doesn't 
support the version of ODBC behavior that the application requested (see 
SQLSetEnvAttr). (0)")

SQL Log file states:
Fatal NI connect error 12560, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=oracleORCX)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))'))(CONNECT_DATA=(SID=ORCX)(CID=(PROGRAM=D:\Python26\python.exe)(HOST=xxx-)(USER=xx

  VERSION INFORMATION:
TNS for 32-bit Windows: Version 12.1.0.2.0 - Production
Oracle Bequeath NT Protocol Adapter for 32-bit Windows: Version 
12.1.0.2.0 - Production
Windows NT TCP/IP NT Protocol Adapter for 32-bit Windows: 
Version 12.1.0.2.0 - Production
  Time: 06-AUG-2015 17:12:31
  Tracing not turned on.
  Tns error struct:
ns main err code: 12560
TNS-12560: Message 12560 not found; No message file for product=NETWORK, 
facility=TNS
ns secondary err code: 0
nt main err code: 530
TNS-00530: Message 530 not found; No message file for product=NETWORK, 
facility=TNS
nt secondary err code: 126
nt OS err code: 0

--
components: Windows
messages: 256482
nosy: paul.moore, steve.dower, tim.golden, wabdo, zach.ware
priority: normal
severity: normal
status: open
title: PYODBC  talk to Oracle under Windows 10.
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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-15 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I think timespec= option should also be added to the time.isoformat method.

--

___
Python tracker 

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



[issue25824] 32-bit 2.7.11 installer creates registry keys that are incompatible with the installed python27.dll

2015-12-15 Thread Michel Bouard

Michel Bouard added the comment:

This issue specifically talks about the 32-bit installer but the 64-bit is also 
affected by it.

It is the same workaround but with a different registry key:

  HKLM\Software\Python\PythonCore\2.7

renamed to

  HKLM\Software\Python\PythonCore\2.7-32

--
nosy: +micbou

___
Python tracker 

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



[issue25877] python av docs has broken links

2015-12-15 Thread R. David Murray

R. David Murray added the comment:

The place to report web site bugs is https://github.com/python/pythondotorg.  I 
know that's not obvious, so I don't blame you for reporting it here ;)  (As far 
as web stuff goes, we only handle docs.python.org bugs here.)

(It's kind of weird closing this as third party, but that's the closest 
resolution we have.)

--
nosy: +r.david.murray
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue25873] Faster ElementTree iterating

2015-12-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file41324/etree_iter2.patch

___
Python tracker 

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



[issue25873] Faster ElementTree iterating

2015-12-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Good catch Martin. I missed this case. Following patch fixes it.

Other bugs look similar. They presumably can be triggered when remove the 
element itself during executing the __next__() method. I have no a reproducer 
though.

I don't know wherever it is worth to fix these bugs in maintained releases.

--
Added file: http://bugs.python.org/file41323/etree_iter2.patch

___
Python tracker 

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



[issue25824] 32-bit 2.7.11 installer creates registry keys that are incompatible with the installed python27.dll

2015-12-15 Thread Steve Dower

Steve Dower added the comment:

64-bit Python shouldn't have the -32 in sys.winver, so it isn't affected. (If 
it does have the suffix, we have a second issue, but since it'd also be fixed 
by removing the code Eryk quoted there's no need for another issue.)

--

___
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-12-15 Thread Mihai Capotă

Changes by Mihai Capotă :


--
nosy: +mihaic

___
Python tracker 

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



[issue23788] test_urllib2_localnet.test_bad_address fails: OSError not raised by urlopen

2015-12-15 Thread Berker Peksag

Berker Peksag added the comment:

bad_address.patch looks good to me.

--
nosy: +berker.peksag
stage: patch review -> commit review

___
Python tracker 

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



[issue25879] Code objects from same line can compare equal

2015-12-15 Thread Kirk McDonald

New submission from Kirk McDonald:

The following code gives an unexpected result:

>>> a, b = lambda: 1, lambda: 1.0
>>> a()
1
>>> b()
1
>>> type(b())

>>> a.__code__ is b.__code__
True

The cause boils down to this line of code:

https://hg.python.org/cpython/file/33ff335da34c/Objects/codeobject.c#l442

When it compiles the two lambdas, their code objects compare equal. They have 
the same name, the same bytecode, and start on the same line. And, because 1 == 
1.0, their constants compare equal. This then prompts the compiler to combine 
the two code objects into a single constant in the enclosing code object, 
discarding the second one.

I think the solution is to have code_richcompare also check whether the types 
of the constants are equal, in addition to the constants themselves.

--
messages: 256508
nosy: KirkMcDonald
priority: normal
severity: normal
status: open
title: Code objects from same line can compare equal

___
Python tracker 

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



[issue25879] Code objects from same line can compare equal

2015-12-15 Thread Kirk McDonald

Changes by Kirk McDonald :


--
components: +Interpreter Core
type:  -> behavior
versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 
3.6

___
Python tracker 

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



[issue25869] Faster ElementTree deepcopying

2015-12-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch correctly handles rare cases when different elements share the 
same attrib dict and when the same Element is occurred on different places in 
ElementTree (that is no longer a tree, but a directed graph).

--
Added file: http://bugs.python.org/file41317/etree_deepcopy2.patch

___
Python tracker 

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



[issue25867] os.stat raises exception when using unicode and no locale is set

2015-12-15 Thread R. David Murray

R. David Murray added the comment:

I don't think this is "intentional", but instead is a consequence of how things 
used to work before we started to try to handle empty/C locale better.  It 
applies to python3 as well.  Since we only started trying to handle this in 
python3, I'm not sure that it can be fixed in python2.

--
nosy: +haypo, ncoghlan, r.david.murray
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue25878] CPython on Windows builds with /W3, not /W4

2015-12-15 Thread Alexander Riccio

Changes by Alexander Riccio :


--
components: +Windows

___
Python tracker 

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



[issue25870] textwrap is very slow on long words without spaces

2015-12-15 Thread R. David Murray

R. David Murray added the comment:

Oh, good call.  I forgot about step.

--

___
Python tracker 

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



[issue25859] EOFError in test_nntplib.NetworkedNNTPTests.test_starttls()

2015-12-15 Thread Martin Panter

Martin Panter added the comment:

I don’t think there is much advantage hosting it on pythontest, but thanks for 
letting me know of the possibility. Here is a patch which runs it in a 
background localhost thread.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file41326/starttls-server.patch

___
Python tracker 

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



[issue25873] Faster ElementTree iterating

2015-12-15 Thread Martin Panter

Martin Panter added the comment:

The new changes look good.

I see these kind of reference counting bugs as fairly low priority. I suspect 
there are plenty more in this module, at least Issue 24103 and Issue 24104.

--

___
Python tracker 

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



[issue25824] 32-bit 2.7.11 installer creates registry keys that are incompatible with the installed python27.dll

2015-12-15 Thread Michel Bouard

Michel Bouard added the comment:

In a interactive shell:

$ python
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:40:30) [MSC v.1500 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.winver
'2.7-32'
>>>

I agree that this is the same fix but I think the title should be updated.

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-15 Thread Alessandro Cucci

Alessandro Cucci added the comment:

Thanks for all the comments, here and on Rietveld. I'll keep working on it. 
Hope to upload a new patch soon.

--

___
Python tracker 

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