[issue22413] Bizarre StringIO(newline="\r\n") translation

2015-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I agree with you, but I think that Antoine disagrees.

My half-baked patch for issue20435 did a half of the work. It initialized the 
buffer directly in __init__. Here is the rebased version. There is a difference 
between C and Python implementations for universal newlines and 
test_newline_none fails.

--
keywords: +patch
Added file: http://bugs.python.org/file40571/stringio_newline_2.patch

___
Python tracker 

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



[issue25198] Idle: improve idle.html help viewer.

2015-09-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Had to adjust number of line by 3/4 because average 4/3 as high as in editor 
due to taller header lines and extra interline spacing.  Net result for me, 
using 12 pitch in editor also, is box size within 5%.

--

___
Python tracker 

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



[issue25198] Idle: improve idle.html help viewer.

2015-09-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c1eccae07977 by Terry Jan Reedy in branch '2.7':
Issue #25198: Idle doc viewer now uses user width and height setting.
https://hg.python.org/cpython/rev/c1eccae07977

New changeset 1c119da20663 by Terry Jan Reedy in branch '3.4':
Issue #25198: Idle doc viewer now uses user width and height setting.
https://hg.python.org/cpython/rev/1c119da20663

--

___
Python tracker 

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



[issue25194] Register of Financial Interests for core contributors

2015-09-24 Thread Nick Coghlan

Nick Coghlan added the comment:

I think the change in tone that MAL suggested will go a long way towards 
clarifying the opt-in nature of the idea - my initial draft took too much of 
its phrasing from contexts where disclosure is required rather than optional.

--

___
Python tracker 

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



[issue25198] Idle: improve idle.html help viewer.

2015-09-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Another minor glitch: in a browser, each press of up or down arrow, when there 
is no cursor (after clicking outside of an entry box like this one), moves text 
up or down.  (3 lines for me in FF, even though wheel click moved more) In an 
editor, each press moves the *cursor* up or down one line, and text only moves 
when the cursor is at the top or bottom of the window.  The read-only text has 
an invisible cursor, which one must invisibly move to top or bottom before 
anything happens.

Some of the code with #17535 might help, but not looking now.

Another enhancement: use user set Initial Window size.

--

___
Python tracker 

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



[issue22413] Bizarre StringIO(newline="\r\n") translation

2015-09-24 Thread Martin Panter

Martin Panter added the comment:

According to  Serhiy and Antoine 
both seem to agree this behaviour is a bug. The reason why newline="\r\n" and 
newline="\r" cause these funny translations is that __init__() internally 
passes the initial buffer value through write(). So I propose to set the buffer 
directly without using write().

However, doing this would have another effect. In the C implementation, write() 
also does universal newline decoding. The Python implementation had similar 
decoding added in getvalue() to compensate (Issue 20435). I propose to revert 
the getvalue() decoding, and to move the universal decoding from write() to 
read() in the C implementation.

I anticipate the combined effect of these changes would be:

1. StringIO("\n", newline="\r\n") no longer encodes the newline to CRLF in the 
internal buffer, so reading or getvalue() will return "\n" unencoded

2. StringIO("\r\n", newline=None).getvalue() returns "\r\n" undecoded, rather 
than universal decoding changing it to "\n"

3. s = StringIO(newline=None); s.write("\r\n"); s.getvalue() also returns 
"\r\n" undecoded. It is undocumented, but StringIO intentionally does not 
encode to os.linesep (yet another bug IMO).

4. StringIO.newlines would only get updated during reading, rather than during 
construction and writing, since newline decoding will only take place during 
reading.

There is another bug where the universal newline decoding does not anticipate 
split CRLF sequences. This would hopefully be fixed at the same time.

>>> s = io.StringIO(newline=None)
>>> s.write("\r\n" "\r")
3
>>> s.write("\n")  # Complete second CRLF
1
>>> s.getvalue()  # Should be "\r\n\r\n", at least when os.linesep == "\n"
'\n\n\n'

--

___
Python tracker 

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



[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread Ezio Melotti

Ezio Melotti added the comment:

TypeError: '<' not supported between instances of 'int' and 'NoneType'

--

___
Python tracker 

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



[issue25225] Idle doc: redo Syntax Colors section

2015-09-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I decided to keep a further condensed subsection.  I think there is a bit of 
extra info, and we may need or want to say more after other changes, such as 
for #7949, and the addition of a dark theme. The reference manual documents our 
current promises.

--
resolution:  -> fixed
stage: needs patch -> 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



[issue25225] Idle doc: redo Syntax Colors section

2015-09-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 36095aa6dd5e by Terry Jan Reedy in branch '2.7':
Issue #25225: add revised .html.
https://hg.python.org/cpython/rev/36095aa6dd5e

New changeset a43d79b2434c by Terry Jan Reedy in branch '3.4':
Issue #25225: add revised .html.
https://hg.python.org/cpython/rev/a43d79b2434c

--

___
Python tracker 

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



[issue25225] Idle doc: redo Syntax Colors section

2015-09-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2f6aa20c05b3 by Terry Jan Reedy in branch '2.7':
Issue #25225: Condense and rewrite Idle doc section on text colors.
https://hg.python.org/cpython/rev/2f6aa20c05b3

New changeset f5502ff7ae2d by Terry Jan Reedy in branch '3.4':
Issue #25225: Condense and rewrite Idle doc section on text colors.
https://hg.python.org/cpython/rev/f5502ff7ae2d

--
nosy: +python-dev

___
Python tracker 

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



[issue4918] Windows installer created with Python X.Y does not work with Python X.Y+1

2015-09-24 Thread eryksun

eryksun added the comment:

There haven't been any fundamental changes to bdist_wininst in years, and 
bdist_wheel has mostly replaced it nowadays. 

I'm fairly certain this issue was fixed by Mark Hammond's fix for issue 4566. 
Just to be certain, I updated the code to use print as a function and used 3.4 
to build "Simple-Python 3.4.3.win-amd64.exe". I installed this to 3.5, and the 
post-install script ran successfully. So I'm re-tagging this issue for versions 
2.7 and 3.2 and closing it as a duplicate.

In summary, Python built with VS 2008 needs an activation context for the CRT 
assembly, which is required to load msvcr90.dll. Normally this comes from the 
application executable, such as python.exe. But when Python is embedded, it may 
be the case that the application lacks the required activation context (e.g. a 
bdist_wininst installer created by Python 2.5). Mark Hammond's fix works around 
this problem by saving and reusing the activation context from when the Python 
DLL was loaded. This activation context is based on the DLL's resource #2 
manifest, which includes the CRT assembly.

One remaining problem for embedding Python 2.7 is accessing msvcr90.dll via 
ctypes. But it's ctypes! Just dynamically create an activation context.

--
nosy: +eryksun
resolution:  -> duplicate
status: open -> closed
superseder:  -> 2.6.1 breaks many applications that embed Python on Windows
versions: +Python 2.7, Python 3.2 -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



[issue9566] Compilation warnings under x64 Windows

2015-09-24 Thread Brian Curtin

Changes by Brian Curtin :


--
nosy:  -brian.curtin

___
Python tracker 

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2015-09-24 Thread Larry Hastings

Larry Hastings added the comment:

> [...] commit messages are for other developers, which news entries are
> ultimately for users.  Some developers want (insist on) the freedom to
> make the two different, with different details.

That's easy enough to accommodate.  I updated "MergeNEWS" with this feature.  
Well, a similar feature:

The file you edit at checkin time starts with "Issue #:".  You fill that out 
and that becomes your Misc/NEWS item, and the top of your checkin comment.

There's also a commented-out line of dashes below there.  Anything you put 
there is appended to *the checkin comment only*.

So, you get the user summary as per Misc/NEWS at the top, then you can 
elaborate in all the technical and flowery language you like.  Also, each 
section is optional (though obviously you have to fill out *one* of them).

It'd be easy to make the two comments completely separate.  I just figured, the 
Misc/NEWS entry is presumably a nice high-level summary of the solution, why 
not leave that there and save the developer from having to summarize it twice.

--

___
Python tracker 

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



[issue24820] IDLE themes for light on dark

2015-09-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I re-read #7949 and read the problem as mixing a hard-coded (by tk or Idle is 
not clear) background (white) with a system-default foreground, which is also 
white when the system background is black.  Hence the screenshot in duplicate 
#16984.  In any case, that issue is complementary to this one, about 
user-configured tagged text colors.

Parsing an existing format is an interesting idea.  Most of the variations seem 
pointless, but I like the cobalt one as a basis for a dark theme.  I plan to 
improve it, using current Idle (Classic and New seem the same, so why two?), 
with my changes.  I will upload when I have something I like.

The change I made is to color the backgrounds of 'shell', 'stdout', and 
'stderr' light yellow, light blue, and light red.  These changes work so well 
for me, at least, that I have thought of adding them to an 'Idle New' that is 
really new and different.  But transitions are hard.  The main other thing I 
don't like in 'Idle ???' is the orange for keywords, as too 'different' from 
the purple and blue of builtings and defined. But green is semi standard for 
strings and that does not leave room for three colors on the blue side.

--

___
Python tracker 

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



[issue7949] IDLE: problems with dark GTK or KDE color schemes

2015-09-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Problem as I understand it: various tk widgets and Idle popups and dialogs mix, 
for instance, a hard-coded background (white) with a sometimes incompatible (no 
or low contrast) system-default foreground, which is also white when the system 
background is black.  Hence the sad screenshot for #16984: 
https://bugs.python.org/file28755/snapshot-idle.png.

Some of this may be tk's fault for not anticipating reversed graphics screen, 
some may be Idle's (I doubt tkinter gets involved).  In any case, a solution is 
for Idle to set the colors for *every* widget it creates.  The colors could be 
fixed in particular cases, but we could instead use one of the currently 13 
user settings*.  #24820 is about adding a light on dark theme to Idle.  When we 
start using ttk widgets (within a month), I believe this will be possible by 
setting an explicit default color pair for each class.

* I am thinking I might try using the new dark theme on my white-background 
system, but I cannot know that I would want all the dialogs to use it.  We 
might want to allow separate tagged text themes (what the current highlights 
are for) and widget themes.  This will take some experimentation.

--
assignee:  -> terry.reedy
nosy: +markroseman
stage:  -> needs patch
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



[issue25194] Register of Financial Interests for core contributors

2015-09-24 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Please make it clear that any listings are optional.  No core developer is 
required to write anything about themselves that they don't want to make public.

--

___
Python tracker 

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



[issue8304] time.strftime() and Unicode characters on Windows

2015-09-24 Thread Eric V. Smith

Eric V. Smith added the comment:

The problem is definitely that:
format = PyUnicode_EncodeLocale(format_arg, "surrogateescape");
fails on Windows.

Windows is using strftime, not wcsftime. It's not using wcsftime because of 
issue 10653.

If I force Windows to use wcsftime, this particular example works:
>>> time.strftime("%d\u200F%A", time.gmtime())
'25\u200fFriday'

I haven't looked at issue 10653 enough to understand if it's still a problem 
with the new Visual C++. Maybe it is: I only tested with my default US locale.

--

___
Python tracker 

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



[issue21506] Windows MSI installer should mklink (symlink) python.exe to python2.7.exe

2015-09-24 Thread eryksun

eryksun added the comment:

Creating a symbolic link can't be relied on for a per-user installation. 
Administrators have to elevate to create symbolic links, and most regular users 
also lack this privilege.

--

___
Python tracker 

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



[issue8304] time.strftime() and Unicode characters on Windows

2015-09-24 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Mark, I am no expert on Windows.  I believe Victor is most knowledgable in this 
area.

--

___
Python tracker 

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



[issue9566] Compilation warnings under x64 Windows

2015-09-24 Thread Mark Lawrence

Mark Lawrence added the comment:

I've got the latest output with all of the warnings but I'm not sure where I 
should attach it as #18295 and #18407 also apply.  There are also multiple 
deprecation warnings but I'm sure they've been discussed before.  Can somebody 
please advise, thanks.

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



[issue25198] Idle: improve idle.html help viewer.

2015-09-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Fixed.  I added a light background as with Sphinx html. I am delighted with how 
well this is working so far.  I like the little always-there [TOC] button 
better than the browser sidebar.  Besides making it easy to verify the look of 
doc changes, I think it looks better. I like the appearance of the tk version, 
without the down arrow, a bit better than the ttk version with an arrow, but 
would switch, when possible, if there were functional reason (see below).

To improve the button: I want to add an activebackground (or foreground) so 
when moused over, the button is more obviously a live button to be pushed.  Any 
particular suggestion?  Is there a standard?  Or do I worry too much? Idle 
buttons don't change when moused over, but they have relief to convey 'push me'.

So that people can navigate without mouse, I tested adding takefocus=True to 
toc creation, takefocus=False to text, and toc.focus_set().  (and 
), , and  work as expected. However the tk Menubutton (but 
not ttk version) seems to have a bug (at least here, ).  After , it is 
left in a 'pressed' state, with a black outline, while the menu is displayed, 
and after.  (With  the outline and menu appear on button-press and the 
outline disappears on button-release, while the menu remains.) A click on the 
button is required to reset it and remove the outline.  Then either  or 
 work as before.  I tried an expanded command function to reset toc,
   def cmd(mark=tag):
toc['state'] = 'disabled'
toc['state'] = 'normal'
text.see(mark)
but this does not work.  If this bug windows-only or general? Do you know of 
any other workaround to make the tk version work right?  Since click-to-reset 
is not obvious, and defeats keyboard-only use, I will not enable focus when 
click-reset is needed.

--

___
Python tracker 

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



[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread Bernie Hackett

Bernie Hackett added the comment:

On second thought, _Py_CheckRecursiveCall may be being called recursively 
through Py_FatalError.

--

___
Python tracker 

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



[issue8304] time.strftime() and Unicode characters on Windows

2015-09-24 Thread Mark Lawrence

Mark Lawrence added the comment:

@Alexander what is you take on this please?  I can confirm that it is still a 
problem on Windows in 3.5.0.

--
nosy: +belopolsky

___
Python tracker 

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



[issue4918] Windows installer created with Python X.Y does not work with Python X.Y+1

2015-09-24 Thread Mark Lawrence

Mark Lawrence added the comment:

Can this be closed as history with so many changes having been made to the 
installer for 3.5?

--
nosy: +BreamoreBoy, paul.moore, steve.dower, tim.golden, zach.ware
versions: +Python 3.6 -Python 2.7, Python 3.4

___
Python tracker 

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



[issue21506] Windows MSI installer should mklink (symlink) python.exe to python2.7.exe

2015-09-24 Thread Mark Lawrence

Mark Lawrence added the comment:

I've changed the version to 3.6 only as I just can't see this happening for any 
other.  For all I know this might have been sorted in 3.5, I'll leave that 
decision to our Windows gurus.

--
nosy: +BreamoreBoy
versions: +Python 3.6 -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue25230] Unix datagram sockets not supported

2015-09-24 Thread Guido van Rossum

Guido van Rossum added the comment:

The simplest fix for this IMO is to add a sock parameter to 
create_datagram_endpoint(). I've filed an issue for this in the upstream 
asyncio project: https://github.com/python/asyncio/issues/266

--

___
Python tracker 

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



[issue24820] IDLE themes for light on dark

2015-09-24 Thread Mark Roseman

Mark Roseman added the comment:

I wrote a short utility that parses TextMate XML-based theme files (which are 
also used by Sublime) and converts them into something IDLE can use. It's not a 
perfect match, because IDLE's themes are more restrictive, but it's not bad.

I'm attaching the output of the script (config-highlight.cfg), which was able 
to translate 17 themes. A few are kind of yucky, and they all need some 
tweaking for selection and shell colors, but it's not a bad place to start...

--
Added file: http://bugs.python.org/file40570/config-highlight.cfg

___
Python tracker 

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



[issue25230] Unix datagram sockets not supported

2015-09-24 Thread rb

New submission from rb:

AF_UNIX, SOCK_DGRAM sockets are valid, but asyncio doesn't appear to support 
them.

I've tried combinations of create_connection, create_datagram_endpoint and 
create_unix_connection, creating a socket myself and passing in sock, and 
equivalent methods at the server end. There seem to be implicit assumptions 
about addresses being 2-tuples (instead of strings) and transports being 
hardcoded to be constructed as either stream or datagram transports. 
create_unix_connection makes the assumption that it will be a stream, and 
create_datagram_endpoint that it will be AF_INET or AF_INET6 with (host, port) 
addressing.

I used 3.4.3, but looking at the docs it doesn't look like this was addressed 
in 3.5 either.

I'd like this because message boundaries are preserved (unlike in SOCK_STREAM), 
which if it Just Worked would make local system IPC (eg. with JSON-RPC) 
extremely trivial to implement in asyncio.

--
components: asyncio
messages: 251549
nosy: gvanrossum, haypo, rb, yselivanov
priority: normal
severity: normal
status: open
title: Unix datagram sockets not supported
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue25229] distutils doesn't add "-Wl, " prefix to "-R" on Linux if the C compiler isn't named 'gcc'

2015-09-24 Thread Calvin Walton

Changes by Calvin Walton :


Added file: http://bugs.python.org/file40569/distutils-compiler-name.patch

___
Python tracker 

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



[issue25229] distutils doesn't add "-Wl, " prefix to "-R" on Linux if the C compiler isn't named 'gcc'

2015-09-24 Thread Calvin Walton

Changes by Calvin Walton :


--
keywords: +patch
Added file: http://bugs.python.org/file40568/distutils-compiler-name.patch

___
Python tracker 

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



[issue16701] Docs missing the behavior of += (in-place add) for lists.

2015-09-24 Thread R. David Murray

R. David Murray added the comment:

Ah, good point.  I'd say something like "for the most part" then instead of 
"usually", since what you describe always happens.

--

___
Python tracker 

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



[issue25198] Idle: improve idle.html help viewer.

2015-09-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8b3dc527a62c by Terry Jan Reedy in branch '2.7':
Issue #25198: In Idle doc viewer, fix indent of fixed-pitch  text
https://hg.python.org/cpython/rev/8b3dc527a62c

New changeset 1d0f4b94066b by Terry Jan Reedy in branch '3.4':
Issue #25198: In Idle doc viewer, fix indent of fixed-pitch  text
https://hg.python.org/cpython/rev/1d0f4b94066b

--
nosy: +python-dev

___
Python tracker 

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



[issue25229] distutils doesn't add "-Wl, " prefix to "-R" on Linux if the C compiler isn't named 'gcc'

2015-09-24 Thread Calvin Walton

New submission from Calvin Walton:

On Exherbo, the main C/C++ compilers are named e.g. "x86_64-pc-linux-gnu-cc" 
and "x86_64-pc-linux-gnu-c++", and they are symlinks to either (usually) gcc or 
(rarely) clang.

Since distutils (in unixccompiler.py) is checking for the substring "gcc" or 
"g++" in the compiler name, this does not match our compiler - and the "-Wl," 
prefix is missing, resulting in link errors in some cases.

(We are particularly noticing this when doing gobject-introspection builds via 
cmake, where giscanner uses distutils to build the link command)

As far as I know, all major compilers on Linux require the -Wl, option to pass 
through linker options - clang actually interprets -R without -Wl, to mean 
something completely different. We are planning to locally patch distutils to 
have an additional condition to the gcc check, `sys.platform[:5] == "linux" or 
self._is_gcc(compiler):` in our distribution to work around the issue.

I'll attach patches once they're prepared, but I'd appreciate feedback about 
the problem.

--
components: Distutils
messages: 251546
nosy: Calvin Walton, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: distutils doesn't add "-Wl," prefix to "-R" on Linux if the C compiler  
isn't named 'gcc'
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



[issue16701] Docs missing the behavior of += (in-place add) for lists.

2015-09-24 Thread Martin Panter

Martin Panter added the comment:

The “s += t” operation assigns the result back to s. So it could involve an 
extra __setattr__()/__setitem__() call, or an exception trying to modify a 
tuple item, etc. The extend() and slice assignment versions don’t have this 
extra stage.

--

___
Python tracker 

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



[issue18787] Misleading error from getspnam function of spwd module

2015-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

As far as this change breaks compatibility. please add a note in the "Porting 
to Python 3.6" section in What's New.

--

___
Python tracker 

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



[issue25154] Drop the pyvenv script

2015-09-24 Thread Remi Pointel

Remi Pointel added the comment:

I would prefer to keep this script with the version referring to the version of 
python used (pyvenv-3.4, pyvenv-3.5, ...).

--
nosy: +rpointel

___
Python tracker 

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



[issue18787] Misleading error from getspnam function of spwd module

2015-09-24 Thread Berker Peksag

Berker Peksag added the comment:

Here is a patch with a test.

--
nosy: +berker.peksag
stage: needs patch -> patch review
versions: +Python 3.6 -Python 3.4
Added file: http://bugs.python.org/file40567/issue18787.diff

___
Python tracker 

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



[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread Bernie Hackett

Bernie Hackett added the comment:

Here's a chunk of the call stack from the Visual Studio debugger using the 
debug build. Py_FatalError seems to be called multiple times:

>   ucrtbased.dll!72d27f30()Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for 
ucrtbased.dll] 
[External Code] 
python35_d.dll!Py_FatalError(const char * msg) Line 1375C   
python35_d.dll!_Py_CheckRecursiveCall(const char * where) Line 733  C
python35_d.dll!PyObject_Call(_object * func, _object * arg, _object * kw) 
Line 2144 C
python35_d.dll!call_function_tail(_object * callable, _object * args) Line 
2173 C
python35_d.dll!callmethod(_object * func, const char * format, char * va, 
int is_size_t) Line 2242  C 
python35_d.dll!_PyObject_CallMethodId(_object * o, _Py_Identifier * name, 
const char * format, ...) Line 2287   C
python35_d.dll!flush_std_files() Line 488   C   
python35_d.dll!Py_FatalError(const char * msg) Line 1354C   
python35_d.dll!_Py_CheckRecursiveCall(const char * where) Line 733  C
python35_d.dll!PyObject_Call(_object * func, _object * arg, _object * kw) 
Line 2144 C
python35_d.dll!do_call(_object * func, _object * * * pp_stack, int na, int 
nk) Line 4883C   python35_d.dll!call_function(_object * * * pp_stack, 
int oparg) Line 4679   C
python35_d.dll!PyEval_EvalFrameEx(_frame * f, int throwflag) Line 3183  C
python35_d.dll!fast_function(_object * func, _object * * * pp_stack, int n, 
int na, int nk) Line 4751   C
python35_d.dll!call_function(_object * * * pp_stack, int oparg) Line 4677   
C
python35_d.dll!PyEval_EvalFrameEx(_frame * f, int throwflag) Line 3183  C
python35_d.dll!fast_function(_object * func, _object * * * pp_stack, int n, 
int na, int nk) Line 4751   C
python35_d.dll!call_function(_object * * * pp_stack, int oparg) Line 4677   
C
python35_d.dll!PyEval_EvalFrameEx(_frame * f, int throwflag) Line 3183  C
python35_d.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals, 
_object * locals, _object * * args, int argcount, _object * * kws, int kwcount, 
_object * * defs, int defcount, _object * kwdefs, _object * closure, _object * 
name, _object * qualname) Line 3962C 
python35_d.dll!fast_function(_object * func, _object * * * pp_stack, int n, 
int na, int nk) Line 4760   C

--

___
Python tracker 

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



[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread Bernie Hackett

Bernie Hackett added the comment:

> Clone master from github:

You'll also have to git checkout 4bbe2133a14df716b1dffe8ab7957ed67149b2cd to 
roll back the setrecursionlimit change I added to work around this issue. 

Using 100 seems to have permanently vanquished the abort, but there's no way 
the stack is overflowing with such a low setting and Py_EnterRecursiveCall 
shouldn't cause python to abort all by itself.

--

___
Python tracker 

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



[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread Bernie Hackett

Bernie Hackett added the comment:

> File 
> "D:\buildarea\3.4.bolen-windows10\build\lib\test\test_json\test_recursion.py",
>  line 96 in test_endless_recursion

That test (and reason for existence) is almost exactly the same as the PyMongo 
test that causes abort reported in this ticket. I'm not surprised it is also 
failing. test_pickle appears to have a similar issue. For test_json see here:

https://hg.python.org/cpython/rev/a21f5af476cb

And PyMongo's equivalent test:

https://github.com/mongodb/mongo-python-driver/blob/4bbe2133a14df716b1dffe8ab7957ed67149b2cd/test/test_bson.py#L538-L543

> I'm unable to reproduce the issue on Linux.

The abort is very rare for me on Linux, so much so that I originally thought it 
only occurred on Windows. I can't reproduce it on a local Linux machine, but it 
has happened inconsistently in our Jenkins cluster. For example (note that this 
run includes a commit that uses sys.setrecursionlimit(250) and still aborts):

https://jenkins.mongodb.com/view/Python/job/mongo-python-driver/404/extensions=without-extensions,label=linux64,mongodb_configuration=single_server,mongodb_option=noauth,mongodb_server=26-release,python_language_version=3.5/console

> First I tried with no MongoDB server running. Then I tried with a MongoDB 
> server running.

The problem only occurs for me when testing with a MongoDB instance running. 
Running background threads seem to be a key requirement for reproduction. Note 
also that this problem does not reproduce when using PyMongo's C extensions, 
only when using the pure python BSON encoder. You can run the tests like this 
from a clean git checkout:

python3.5 setup.py --no_ext test

> I don't have exactly the same version (I'm reading pymongo 3.0.3 source)

Clone master from github:

https://github.com/mongodb/mongo-python-driver

> @Bernie: Would you be able to get a C backtrace using gdb on such crash?

Not likely, since I can't reproduce it under Linux locally. But I *can* 
reproduce it consistently on a Windows 7 machine that has VS2015. I'll see what 
I can get out of the Visual Studio debugger and report back.

--

___
Python tracker 

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



[issue25228] Regression in cookie parsing with brackets and quotes

2015-09-24 Thread Tim Graham

New submission from Tim Graham:

Regression in https://hg.python.org/cpython/rev/9e765e65e5cb (affects 2.7 and 
3.2+), similar to issue22931 where inserting an invalid cookie value can cause 
the rest of the cookie to be ignored. A test is attached, and here's a quick 
demo:

Old:
>>> from http.cookies import SimpleCookie
>>> SimpleCookie('a=b; messages=[\"\"]; c=d;')
{'a': 'b', 'c': 'd', 'messages': ''}

New:
>>> SimpleCookie('a=b; messages=[\"\"]; c=d;')
{'a': 'b'}

Reported in Django's tracker, but Django simply delegates to SimpleCookie: 
https://code.djangoproject.com/ticket/25458

--
components: Library (Lib)
files: cookie-bracket-quotes-test.diff
keywords: patch
messages: 251538
nosy: Tim.Graham
priority: normal
severity: normal
status: open
title: Regression in cookie parsing with brackets and quotes
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40566/cookie-bracket-quotes-test.diff

___
Python tracker 

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



[issue25223] Statically or dynamically linked to the VC++runtime ? or how Python install fails on Vista despite the VC redist packages - api-ms-win-crt-runtime-l1-1-0.dll

2015-09-24 Thread eryksun

eryksun added the comment:

Try directly installing the Universal CRT update, 
[Windows6.0-KB2999226-x86.msu][1]. Run it with the /log option, e.g.

Windows6.0-KB2999226-x86.msu /log:kb2999226.evtx

You can view this log in the Windows event viewer, or convert it to text XML on 
the command line as follows:

wevtutil qe kb2999226.evtx /lf:true /f:XML /e:MSULog > kb2999226.xml

If the update fails, please attach the XML log to this issue. 

Steve, since these updates require an up-to-date Windows installation, maybe 
you should test for SP2 on Vista, SP1 on Windows 7, and S14 on Windows 8.1. 
Display a warning if the OS is outdated, including Windows XP, but let the 
install proceed.

[1]: http://www.microsoft.com/en-us/download/details.aspx?id=48234

--
nosy: +eryksun

___
Python tracker 

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



[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread R. David Murray

R. David Murray added the comment:

That's why I said that making it like the other binary op messages might be 
better.  Currently the error message says that the error is that two types were 
compared ("unorderable types"), which as you point is not quite accurate.  It 
is, however, fairly parallel to the message used for binary operations:

   TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

I think it would be good to change the existing message to match:

   TypeError: unsupported operand type(s) for '<': 'int' and 'NoneType'

The *best* change would be something like:

   TypeError: '<' does not support comparison of operands whose types are 'int' 
and 'NoneType'
   TypeError: '+' does not support addition of operands whose types are 'int' 
and 'NoneType'

But that might be much harder to implement depending on how the binary op error 
message(s) are implemented.  Leave out "addition of" and "comparison of" in the 
above messages and they might still be better than the status quo, but probably 
not enough to warrant doing it if doing it is hard.

--

___
Python tracker 

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



[issue25225] Idle doc: redo Syntax Colors section

2015-09-24 Thread Mark Roseman

Mark Roseman added the comment:

I'd suggest that there is no reason to include the list of what elements can be 
coloured, as it's there in the dialog for anyone who wants to muck with it. 
Just the first paragraph (two sentences) would be sufficient I think. Even 
dropping it from the document entirely wouldn't be a bad thing.

--
nosy: +markroseman

___
Python tracker 

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



[issue25198] Idle: improve idle.html help viewer.

2015-09-24 Thread Mark Roseman

Mark Roseman added the comment:

Have attached help-indent-fix.patch. Basically the parser is very fragile when 
it comes to combining tags, so the handling of the 'span .pre' was stomping on 
the indent tag. Separated out handling of character level tags (e.g. italic) 
from block level tags (e.g. lists, headings).

--
keywords: +patch
Added file: http://bugs.python.org/file40565/help-indent-fix.patch

___
Python tracker 

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



[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It makes the error message just non-relevant (or misleading) to the error.
It refers to int < NoneType, but actually the exception is raised when you 
compare an int instance with a NoneType instance, not two types theirself. 
Comparing *any two types* raises an exception, but comparing instances of two 
types can return a result.

--

___
Python tracker 

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



[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread R. David Murray

R. David Murray added the comment:

Serhiy: it's not the same, but the both are correct and parallel, and int < 
NoneType is *consistent* with the rest of the message, whereas having the 
parenthesis in there is not (since in that case you are referring to instances, 
not types).

Changing the message format to be more like the other binary op messages might 
be better, though.

--

___
Python tracker 

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



[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

Stupid email interface, it restored the the previous title. I tried to change 
the title to: "Fix do_richcompare() error message: remove parenthesis from type 
names"

--

___
Python tracker 

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



[issue22032] Use __qualname__ together with __module__

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

Ok, anyway, thanks for your feedback.

--

___
Python tracker 

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



[issue24870] Optimize ascii and latin1 decoder with surrogateescape and surrogatepass error handlers

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy wrote: "All other error handlers lose information and can't be used per 
se for transcoding bytes as string or string as bytes."

Well, it was very simple to implement replace and ignore in decoders. I believe 
that the error handlers are commonly used.

"(...) adding it can slow down common case (no errors). That is why I limit my 
patch for "surrogateescape" and "surrogatepass" only."

We can start with benchmarks and see if modifying Objects/stringlib/ has a real 
impact on performances, or if modifying the "slower" decoder in 
Objects/unicodeobject.c is enough. IMHO it's fine to implement many error 
handlers in Objects/unicodeobject.c: it's the "slow" path when at least one 
error occurred, so it doesn't impact the path to decode valid UTF-8 strings.

--

___
Python tracker 

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



[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

int < NoneType is not the same as int() < None.

--
title: Fix do_richcompare() error message: remove parenthesis from type names 
-> Special-case NoneType() in do_richcompare()

___
Python tracker 

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



[issue22032] Use __qualname__ together with __module__

2015-09-24 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

I'm not expecting a change either, I was also just documenting observed 
breakages.  Given that I've ported a *ton* of code to 3.5 and only seen a 
handful of failures related to this issue, I agree that it's better just to 
provide information and let packages fix their code.

I am keeping a running document of such issues here: 
https://wiki.python.org/moin/PortingToPy3k/34to35

As for the larger question of doctests, we can discuss elsewhere.  Probably not 
appropriate for *this* issue .

--

___
Python tracker 

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



[issue25227] Optimize ASCII/latin1 encoder with surrogateescape error handlers

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

Result of a micro-benchmark with encode_ucs1_surrogateescape-2.patch.

Common platform:
Timer info: namespace(adjustable=False, 
implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, 
resolution=1e-09)
Timer: time.perf_counter
CPU model: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
Python unicode implementation: PEP 393
Platform: Linux-4.1.6-200.fc22.x86_64-x86_64-with-fedora-22-Twenty_Two
CFLAGS: -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g 
-fwrapv -O3 -Wall -Wstrict-prototypes
Bits: int=32, long=64, long long=64, size_t=64, void*=64

Platform of campaign before:
Date: 2015-09-24 16:12:35
Timer precision: 54 ns
Python version: 3.6.0a0 (default:fa65c32d7134, Sep 24 2015, 16:11:44) [GCC 
5.1.1 20150618 (Red Hat 5.1.1-4)]
SCM: hg revision=fa65c32d7134 tag=tip branch=default date="2015-09-24 14:45 
+0200"

Platform of campaign after:
Python version: 3.6.0a0 (default:fa65c32d7134+, Sep 24 2015, 16:13:20) [GCC 
5.1.1 20150618 (Red Hat 5.1.1-4)]
Timer precision: 55 ns
SCM: hg revision=fa65c32d7134+ tag=tip branch=default date="2015-09-24 14:45 
+0200"
Date: 2015-09-24 16:13:21

---+-+---
ascii  |  before |  after
---+-+---
100 x 10**1 characters | 6.65 us (*) | 1.93 us (-71%)
100 x 10**3 characters |  512 us (*) |  158 us (-69%)
100 x 10**2 characters | 52.2 us (*) | 16.2 us (-69%)
100 x 10**4 characters | 5.09 ms (*) | 1.59 ms (-69%)
---+-+---
Total  | 5.66 ms (*) | 1.77 ms (-69%)
---+-+---

---+-+---
latin1 |  before |  after
---+-+---
100 x 10**1 characters | 6.24 us (*) | 1.89 us (-70%)
100 x 10**3 characters |  500 us (*) |  160 us (-68%)
100 x 10**2 characters |   51 us (*) | 16.3 us (-68%)
100 x 10**4 characters |5 ms (*) | 1.59 ms (-68%)
---+-+---
Total  | 5.56 ms (*) | 1.77 ms (-68%)
---+-+---

+-+---
Summary |  before |  after
+-+---
ascii   | 5.66 ms (*) | 1.77 ms (-69%)
latin1  | 5.56 ms (*) | 1.77 ms (-68%)
+-+---
Total   | 11.2 ms (*) | 3.53 ms (-69%)
+-+---

--
Added file: http://bugs.python.org/file40564/bench.py

___
Python tracker 

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



[issue24870] Optimize ascii and latin1 decoder with surrogateescape and surrogatepass error handlers

2015-09-24 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Optimize coding with surrogateescape and surrogatepass error handlers -> 
Optimize ascii and latin1 decoder with surrogateescape and surrogatepass error 
handlers

___
Python tracker 

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



[issue25227] Optimize ASCII/latin1 encoder with surrogateescape error handlers

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

Updated test now with more unit tests.

--
Added file: http://bugs.python.org/file40563/encode_ucs1_surrogateescape-2.patch

___
Python tracker 

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



[issue25210] Fix do_richcompare() error message: remove parenthesis from type names

2015-09-24 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Special-case NoneType() in do_richcompare() -> Fix do_richcompare() 
error message: remove parenthesis from type names

___
Python tracker 

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



[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread R. David Murray

R. David Murray added the comment:

See issue 20077.  IMO it should still say int < NoneType, to be consistent.  I 
still don't see a reason to special case None here.

--

___
Python tracker 

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



[issue16701] Docs missing the behavior of += (in-place add) for lists.

2015-09-24 Thread R. David Murray

R. David Murray added the comment:

Something I missed on the first review: why did you change "the same as" to 
"usually the same as"?  When is it different?

--

___
Python tracker 

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



[issue21295] Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse

2015-09-24 Thread Radek Novacek

Radek Novacek added the comment:

I've ran the tests from first and second comment using python 3.5.0 and it 
seems it produces correct results:

>>> import ast
>>> tree = ast.parse("sin(0.5)")
>>> first_stmt = tree.body[0]
>>> call = first_stmt.value
>>> print("col_offset of call expression:", call.col_offset)
col_offset of call expression: 0
>>> print("col_offset of func of the call:", call.func.col_offset)
col_offset of func of the call: 0

>>> tree = ast.parse("(sin\n(0.5))")
>>> first_stmt = tree.body[0]
>>> call = first_stmt.value
>>> print("col_offset of call expression:", call.col_offset)
col_offset of call expression: 1
>>> print("col_offset of func of the call:", call.func.col_offset)
col_offset of func of the call: 1
>>> print("lineno of call expression:", call.lineno)
lineno of call expression: 1
>>> print("lineno of func of the call:", call.lineno)
lineno of func of the call: 1

--
nosy: +rnovacek

___
Python tracker 

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



[issue24870] Optimize coding with surrogateescape and surrogatepass error handlers

2015-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I worked on UTF-16 and UTF-32 encoders, but now I'm off my developing computer. 
I'll provide updated patch soon.

I think that only "surrogateescape" and "surrogatepass" error handlers have 
need in optimization, because they are used to interpolate with other programs, 
including old Python versions. "strict" stops processing, an optimization is 
not needed here. All other error handlers lose information and can't be used 
per se for transcoding bytes as string or string as bytes. They are used 
together with other slow code (for example for encoding string in XML or HTML 
you first need to escape '&', '<' and quotes). It is easy to add fast handling 
for 'ignore' and 'replace', but these error handlers are used largely for 
produce human-readable output, and adding it can slow down common case (no 
errors). That is why I limit my patch for "surrogateescape" and "surrogatepass" 
only.

--

___
Python tracker 

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



[issue25223] Statically or dynamically linked to the VC++runtime ? or how Python install fails on Vista despite the VC redist packages - api-ms-win-crt-runtime-l1-1-0.dll

2015-09-24 Thread Steve Dower

Steve Dower added the comment:

msvcr140.dll does not exist and was never released. I'm not sure what you've 
installed, but it seems to be the wrong thing.

I'm familiar with the compiler options and we are using the correct ones. If 
you want to change them, you should build your own copy.

To help me help you with your installation issue, could you attach a list of 
all the DLLs in your System32 folder?

--

___
Python tracker 

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



[issue25206] PEP 498: Minor mistakes/outdateness

2015-09-24 Thread Eric V. Smith

Changes by Eric V. Smith :


--
resolution:  -> fixed
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



[issue25206] PEP 498: Minor mistakes/outdateness

2015-09-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7e32da8da58e by Eric V. Smith in branch 'default':
Issue 25206: fix f-string exceptions to match the code.
https://hg.python.org/peps/rev/7e32da8da58e

--

___
Python tracker 

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



[issue25227] Optimize ASCII/latin1 encoder with surrogateescape error handlers

2015-09-24 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +patch
Added file: http://bugs.python.org/file40562/encode_ucs1_surrogateescape.patch

___
Python tracker 

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



[issue25227] Optimize ASCII/latin1 encoder with surrogateescape error handlers

2015-09-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fa65c32d7134 by Victor Stinner in branch 'default':
Issue #25227: Cleanup unicode_encode_ucs1() error handler
https://hg.python.org/cpython/rev/fa65c32d7134

--
nosy: +python-dev

___
Python tracker 

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



[issue24870] Optimize coding with surrogateescape and surrogatepass error handlers

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

I created the issue #25227 to optimize the ASCII and Latin1 *encoders* for 
surrogateescape.

--

___
Python tracker 

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



[issue25227] Optimize ASCII/latin1 encoder with surrogateescape error handlers

2015-09-24 Thread STINNER Victor

New submission from STINNER Victor:

Attached patch is based on faster_surrogates_hadling.patch written by Serhiy 
Storchaka for the issue #24870. It optimizes str.encode('ascii', 
'surrogateescape') and str.encode('ascii', 'latin1').

--
messages: 251516
nosy: haypo
priority: normal
severity: normal
status: open
title: Optimize ASCII/latin1 encoder with surrogateescape error handlers
type: performance
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



[issue25209] Append space after completed keywords

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

> This is definitely a new feature. And there is a risk to break something (if 
> standard completer is used programmatic).

Ok, it's up to you.

--

___
Python tracker 

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



[issue25209] Append space after completed keywords

2015-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> “Else” doesn’t always use a colon. Consider “1 if x else 2”.

Good catch Martin. Unfortunately the completer doesn't take context into 
account. "else" with a colon is a common case, but unwanted colon could be 
annoyed. I agree that it would be safe to not append a colon after "else". At 
least unless we make the completer context aware. However I don't think that 
unwanted space would be so annoyed. Here is updated patch.

I see that your code does an autocompletion for module names in "import", 
Martin. This was my next idea. Do you want to provide a patch for including 
this in CPython?

> I tested the patch. "wi" displays "with " (space)., but "fo" 
> displays "for" (no space). I don't understand why.

Because there is "format(".

> IMHO you should apply it to Python 3.4-3.6 (not only 3.6).

This is definitely a new feature. And there is a risk to break something (if 
standard completer is used programmatic).

--
Added file: http://bugs.python.org/file40561/rlcompleter_keyword_space_3.patch

___
Python tracker 

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



[issue25209] Append space after completed keywords

2015-09-24 Thread Martin Panter

Martin Panter added the comment:

Victor, maybe because “for” also stands for “format”?

--

___
Python tracker 

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



[issue22032] Use __qualname__ together with __module__

2015-09-24 Thread Robert Kuska

Robert Kuska added the comment:

I agree with you Victor that tests shouldn't rely on the exact representation 
and I also understand why such change was introduced therefore I don't think 
there is any bug to report, my comment was just pure 'FYI' for anyone who will 
come across it (as I did).

--

___
Python tracker 

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



[issue25209] Append space after completed keywords

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

I tested the patch. "wi" displays "with " (space)., but "fo" displays 
"for" (no space). I don't understand why. Well, it's not a big issue, anyway 
the patch looks good to me. IMHO you should apply it to Python 3.4-3.6 (not 
only 3.6).

--
nosy: +haypo

___
Python tracker 

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



[issue20519] Replace uuid ctypes usage with an extension module.

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

@Gustavo: Can you please take my remarks in account and rebase your change on 
the default branch?

--

___
Python tracker 

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



[issue20519] Replace uuid ctypes usage with an extension module.

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

In the Python stdlib, we try to avoid ctypes to use instead a C extension 
module. So I like the idea of a new optional _uuid module.

I reviewed the attached patch.

--

___
Python tracker 

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



[issue25208] improvements to the asyncio documentation

2015-09-24 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Fixed. Thanks!

--
nosy: +asvetlov
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
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



[issue25208] improvements to the asyncio documentation

2015-09-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3909d29d29fc by Andrew Svetlov in branch '3.4':
Fix #25208: Improve "Develop with asyncio" doc page.
https://hg.python.org/cpython/rev/3909d29d29fc

--
nosy: +python-dev

___
Python tracker 

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



[issue25223] Statically or dynamically linked to the VC++runtime ? or how Python install fails on Vista despite the VC redist packages - api-ms-win-crt-runtime-l1-1-0.dll

2015-09-24 Thread acx01bc

acx01bc added the comment:

On Vista32bits, the VC++2015 redist package does install msvcr140.dll but none 
of the api-ms-win-crt-***-l1-1-0.dll, thus (that's why I opened this discussion 
at first) it is impossible to make many of the Python releases working, at 
least on Vista 32bits.
There are many compiler options about the msvcr***.dll (platform 
V100,V110,V120,V140.., statically or dynamically linked to the C runtime, 
multi-threaded or not...) and obviously the settings used to build Python 3.4.3 
work fine on Vista (platform V100), while the settings used to build Python 
3.5.0 don't (platform V140).

--

___
Python tracker 

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



[issue21995] Idle: pseudofiles have no buffer attribute.

2015-09-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I believe this issue was derived from another were someone complained about 
something else being missing.  I will just look into the other two and see if 
they are supposed to be there.

--

___
Python tracker 

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



[issue25211] Error message formatting errors in int object unit-test script

2015-09-24 Thread Berker Peksag

Berker Peksag added the comment:

subTest-long.patch looks good to me. Thanks!

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



[issue25226] "suffix" attribute not documented in logging.TimedRotatingFileHandler

2015-09-24 Thread NobilisVir

New submission from NobilisVir:

The suffix attribute that controls the timestamp portion that gets appended to 
the file name is not documented (but it would be very useful to be). The 
documentation is here - 
https://docs.python.org/2/library/logging.handlers.html#timedrotatingfilehandler

I learned about this attribute from an SO answer after searching for a solution 
to how to control the file name (this answer - 
http://stackoverflow.com/a/338566/1006955).

--
assignee: docs@python
components: Documentation
messages: 251503
nosy: NobilisVir, docs@python
priority: normal
severity: normal
status: open
title: "suffix" attribute not documented in logging.TimedRotatingFileHandler
type: enhancement
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



[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka added the comment:
> The json code was almost not changed, so it can be related to changes in 
> import machinery or in ceval.c if they consume more stack than previous.
>
> Yet one suspect is Argument Clinic that adds additional wrappers.

This issue is about the number of Python frames, right? Argument Clinic may use 
a little bit more bytes on the C stack, but it doesn't create Python frames. 
Right?

--

Current thread 0x0a20 (most recent call first):
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 653 in 
_name_value_to_bson
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 692 in 
_element_to_bson
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 433 in 
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 433 in 
_encode_mapping
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 653 in 
_name_value_to_bson
  ...

The "Fatal Python error: Cannot recover from stack overflow" occurs when Python 
already raised a RecursionError (RuntimeError on Python < 3.5) in the current 
Python thread, but the recursion limit was reached again, even with 50 more 
frames than when the RecursionError was raised.

Since a RecursionError exception was raised, I would expect the program to 
crash in an except block, but it's not the case.

_name_value_to_bson:653: I don't have exactly the same version (I'm reading 
pymongo 3.0.3 source), but I only see a try/except KeyError here. No bare 
"except: pass" or "except Exception: ...".

_element_to_bson:692: Ditto, only a try/except AttributeError.

--

@Bernie: Would you be able to get a C backtrace using gdb on such crash?

--

___
Python tracker 

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



[issue22032] Use __qualname__ together with __module__

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

Oh by the way, this issue is closed, what do you expect Barry and Robert? If 
you consider that it's a bug, please open a new issue and describe what you 
want :-)

--

___
Python tracker 

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



[issue22032] Use __qualname__ together with __module__

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

Barry, Robert: I'm sorry that the change broke tests, but tests should not rely 
on the exact representation. They can test type(obj).__name__ for example.

Barry: "people should be aware that this can break doctests"

Some years ago, I was a big fan of doctest. But with the release of Python 3, I 
now think that it's a big mess. It's very hard to write reliable doctests. Most 
doctests rely on the exact representation of objects and subtle details which 
break on minor Python releases.

IHMO it's better to write classic unittest tests and use functions like 
assertEqual(). By the way, the unittest made great progress last years, it 
shows better error message when a test fails.

Maybe we should document better such changes in the 
https://docs.python.org/dev/whatsnew/3.5.html#porting-to-python-3-5 section ?

--

___
Python tracker 

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



[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

I'm unable to reproduce the issue on Linux. I tried system python 3.4.2 and the 
development version of Python 3.6. First I tried with no MongoDB server 
running. Then I tried with a MongoDB server running.

I also ran the pymongo test suite on Windows 8.1 with Python development 
version (3.6) with no MongoDB server.

With no MongoDB server running, I don't see threads running 
pymongo/periodic_executor.py.

Any hint to try to reproduce the crash?

--

___
Python tracker 

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



[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

+1 to remove parenthesis from type names in the error message. But
from all types, not only NoneType.

--

___
Python tracker 

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



[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The json code was almost not changed, so it can be related to changes in import 
machinery or in ceval.c if they consume more stack than previous.

Yet one suspect is Argument Clinic that adds additional wrappers.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue21995] Idle: pseudofiles have no buffer attribute.

2015-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

https://docs.python.org/3/library/io.html#io.TextIOBase.buffer
"""buffer

The underlying binary buffer (a BufferedIOBase instance) that TextIOBase deals 
with. This is not part of the TextIOBase API and may not exist in some 
implementations."""

It is common to replace standard streams with StringIO.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue24894] iso-8859-11 missing from codecs table

2015-09-24 Thread Prashant Tyagi

Prashant Tyagi added the comment:

Typo error is very silly,because i am new to this developement of python
foundation .next time i will try my best.

On Thu, Sep 24, 2015 at 12:37 PM, STINNER Victor 
wrote:

>
> STINNER Victor added the comment:
>
> > That was mistake in previous patch,so here is new patch for the same.
>
> Don't be sorry, that's why we have reviews :-)
>
>
> +| iso8859_11  | iso-8856-11, iso-8859-11-2001, | Thai languages
>|
> +| | thai   |
>   |
>
> I checked other ISO 8859 codecs: they also have an alias with the year,
> but it's not documented. So I prefer to not document iso-8859-11-2001
> neither.
>
> There was a typo in "iso-8856-11": it's 8859. I fixed it and pushed your
> change.
>
> Thanks for your first contribution Prashant ;-)
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue24894] iso-8859-11 missing from codecs table

2015-09-24 Thread Ezio Melotti

Ezio Melotti added the comment:

Thanks Prashant for the patch and Victor for taking care of it!

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed
versions: +Python 2.7, Python 3.4

___
Python tracker 

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



[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

Bernie Hackett wrote: "Feel free to close this won't fix, but given that this 
appears to be the second report of this issue for 3.5 (see issue22971) ..."

It's not because you get the same error message that the root cause is the same.

Martin Panter wrote: "I saw this error recently on some 3.4 builtbots: (...)  
AMD64 Windows10 3.4"

Again, the root cause can be very different. If you want to work on this crash, 
please open a separated issue for this specific crash on test_json. The code on 
Windows can be a little bit different, and ceval.c evolved between Python 3.4 
and 3.6.

--

___
Python tracker 

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



[issue21995] Idle: pseudofiles have no buffer attribute.

2015-09-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ac6ade0c5927 by Terry Jan Reedy in branch '2.7':
Issue 21995: Explain some differences between IDLE and console Python.
https://hg.python.org/cpython/rev/ac6ade0c5927

New changeset ca6c9cc77c20 by Terry Jan Reedy in branch '3.4':
Issue 21995: Explain some differences between IDLE and console Python.
https://hg.python.org/cpython/rev/ca6c9cc77c20

--
nosy: +python-dev

___
Python tracker 

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



[issue24894] iso-8859-11 missing from codecs table

2015-09-24 Thread STINNER Victor

STINNER Victor added the comment:

> That was mistake in previous patch,so here is new patch for the same.

Don't be sorry, that's why we have reviews :-)


+| iso8859_11  | iso-8856-11, iso-8859-11-2001, | Thai languages
 |
+| | thai   |   
 |

I checked other ISO 8859 codecs: they also have an alias with the year, but 
it's not documented. So I prefer to not document iso-8859-11-2001 neither.

There was a typo in "iso-8856-11": it's 8859. I fixed it and pushed your change.

Thanks for your first contribution Prashant ;-)

--

___
Python tracker 

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



[issue24894] iso-8859-11 missing from codecs table

2015-09-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset aa9e0dcbbcc2 by Victor Stinner in branch '3.4':
Issue #24894: Document the codec iso8859_11
https://hg.python.org/cpython/rev/aa9e0dcbbcc2

New changeset 84a918335fe5 by Victor Stinner in branch '3.5':
Merge 3.4 (codecs, issue #24894)
https://hg.python.org/cpython/rev/84a918335fe5

New changeset 97842831c635 by Victor Stinner in branch 'default':
Merge 3.5 (codecs, issue #24894)
https://hg.python.org/cpython/rev/97842831c635

New changeset ad560409c7d6 by Victor Stinner in branch '2.7':
Issue #24894: Document the codec iso8859_11
https://hg.python.org/cpython/rev/ad560409c7d6

--
nosy: +python-dev

___
Python tracker 

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



[issue22032] Use __qualname__ together with __module__

2015-09-24 Thread Robert Kuska

Robert Kuska added the comment:

FYI This also broke nosetests tests which relies on exact output.

https://github.com/nose-devs/nose/issues/928

--
nosy: +rkuska

___
Python tracker 

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



[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

And this is the only case where type name followed with '()' is occurred in 
error message. The repr() shouldn't be used in error message because it can be 
too long (imagine 'x'*10**9 < None) and can raise an exception.

IMHO more correct would be message "unorderable types: int and NoneType", but 
it lose the information about operation.

Yet one option is to follow the template for other binary operators:

>>> 1 + None
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

--

___
Python tracker 

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