[issue23900] Add a default docstring to Enum subclasses

2015-04-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 684aadcabcc7 by Ethan Furman in branch 'default':
Close issue23900: add default __doc__ to new enumerations that do not specify 
one.
https://hg.python.org/cpython/rev/684aadcabcc7

--
nosy: +python-dev
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



[issue9712] tokenize yield an ERRORTOKEN if the identifier starts with a non-ascii char

2015-04-11 Thread Joshua Landau

Joshua Landau added the comment:

This doesn't seem to be a complete fix; the regex used does not include 
Other_ID_Start or Other_ID_Continue from

https://docs.python.org/3.5/reference/lexical_analysis.html#identifiers

Hence tokenize does not accept '℘·'.

Credit to modchan from http://stackoverflow.com/a/29586366/1763356.

--
nosy: +Joshua.Landau
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



[issue23008] pydoc enum.{,Int}Enum fails

2015-04-11 Thread Ethan Furman

Ethan Furman added the comment:

In 3.5 at least 'pydoc None' works.

--
stage: patch review -> test needed

___
Python tracker 

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



[issue23920] Should Clinic have "nullable" or types=NoneType?

2015-04-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This will break other principle. Don't Repeat Yourself. "str" for the 
"Py_UNICODE" converter looks redundant.

--

___
Python tracker 

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



[issue23908] Check path arguments of os functions for null character

2015-04-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue23919] test_os fails several C-level assertions

2015-04-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +haypo

___
Python tracker 

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



[issue22652] Add suggestion about keyword arguments to this error message: "builtins.TypeError: my_func() takes 1 positional argument but 2 were given"

2015-04-11 Thread Antti Haapala

Antti Haapala added the comment:

Would it be enough to just have the message say "takes 1 positional argument 
and keyword-only arguments but 2 positional arguments were given"? And this 
should of course for **kwargs too.

--
nosy: +ztane

___
Python tracker 

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



[issue23921] Standardize documentation whitespace, formatting

2015-04-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +r.david.murray, serhiy.storchaka
stage:  -> patch review

___
Python tracker 

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



[issue23921] Standardize documentation whitespace, formatting

2015-04-11 Thread James Edwards

Changes by James Edwards :


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



[issue23921] Standardize documentation whitespace, formatting

2015-04-11 Thread James Edwards

New submission from James Edwards:

I realize this is a huge patch, I'd be happy to split it to multiple little 
patches (one per file, one per documentation directory, etc.) to make things 
easier.  Just let me know.

The patch attempts to do a few things (with exceptions, as noted below):

1. Standardize leading whitespace in block bodies (4 spaces per level)
2. Enforce >= 2 spaces between code and inline comment
3. In interactive interpreter snippets, ensures lines meant to be entered
are preceded by '>>> ' or '... '
4. Inline whitespace standardization (following a liberal / lenient 
(not strict) PEP-8 testing)

Scanning the documentation, extracting the code snippets, and testing them for
PEP-8 compliance was done with a script, but all adjustments were done by hand.

This means that there remain some code that fails the lenient PEP-8 checks that
I used.  For example, code at [1] ("How to write obfuscated one liners") 
obviously threw errors, but because of the context of the snippet and the use 
it 
serves in the documentation, it was left it unchanged.

Similarly, there are (intentionally) poorly formatted snippets in [2] ("Lexical
Analysis") that were also left unchanged.

Since these changes were applied by hand, I was able to ignore situations where
things that would normally raise warnings.  I erred on the side of leaving the
documentation examples unchanged, and strived to make only innocuous changes.

I made no attempt to change the functionality or semantics of any of the 
snippets.  The only changes I made were "harmless" formatting.  None of the
changes will affect the function or output of the snippets.

What the changes do, however, is give a consistency to the documentation that
will allow readers to become more comfortable with the structure of the language
and improve readability.

[1] 
https://docs.python.org/3/faq/programming.html#is-it-possible-to-write-obfuscated-one-liners-in-python
[2] https://docs.python.org/3/reference/lexical_analysis.html#indentation
[3] http://pep8.readthedocs.org/en/latest/intro.html

In addition to the checks that are ignored by default by the pep8[3] module for 
not being unanimously accepted:

E121# continuation line under-indented for hanging indent
E123# closing bracket does not match indentation of opening bracket’s 
line
E126# continuation line over-indented for hanging indent
E133# closing bracket is missing indentation
E226# missing whitespace around arithmetic operator
E241# multiple spaces after ‘,’ 
E242# tab after ‘,’
E704# multiple statements on one line (def)

The following checks were "globally" ignored in my script, though many others 
were conditionally ignored by the script or by myself.

ignore.append('W292')   # no newline at end of file
ignore.append('E302')   # expected 2 blank lines, found 0
ignore.append('E401')   # multiple imports on one line
ignore.append('W391')   # blank line at end of file
ignore.append('E231')   # missing whitespace after ','
ignore.append('E114')   # indentation is not multiple of four (comment)
ignore.append('E116')   # unexpected indentation (comment)

While the patch diffstat is:

67 files changed, 450 insertions(+), 412 deletions(-)

Ignoring all whitespace changes, the diffstat is only:

10 files changed, 118 insertions(+), 114 deletions(-)

The majority of these remaining changes fix the inconsistency of interactive 
interpreter snippets, where, within the same snippet, some lines have '>>> ' 
while others are missing it, or the '... ' continuation prompt.

Let me know if you need anything from me (such as splitting this patch up) to
help get it merged.  Thanks.

--
assignee: docs@python
components: Documentation
files: docsdiff.diff
keywords: patch
messages: 240540
nosy: docs@python, jedwards
priority: normal
severity: normal
status: open
title: Standardize documentation whitespace, formatting
type: enhancement
Added file: http://bugs.python.org/file38903/docsdiff.diff

___
Python tracker 

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



[issue17776] IDLE Internationalization

2015-04-11 Thread Al Sweigart

Al Sweigart added the comment:

> Someone should do a more refined search with an re that excludes '_' preceded 
> or followed by an identifier char, to skip '__xyz__' or '_x' or 'y_'.

I've run this regex over all the .py and .pyw files in idlelib: 
[^_'"a-zA-Z0-9]_[^a-zA-Z0-9_]

The only possible conflict I've found is in rpc.py's displayhook() function, 
which sets builtins._ to the argument passed to displayhook().

There is a cryptic comment: # Set '_' to None to avoid recursion

I'm not sure what the reasoning behind this code is. This was written by Andrew 
Svetlov for issue 14200

--

___
Python tracker 

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



[issue23668] Support os.ftruncate on Windows

2015-04-11 Thread Steve Dower

Changes by Steve Dower :


--
stage:  -> commit review

___
Python tracker 

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



[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-04-11 Thread Steve Dower

Changes by Steve Dower :


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



[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-04-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 32652360d1c3 by Steve Dower in branch 'default':
Issue #23524: Replace _PyVerify_fd function with calls to 
_set_thread_local_invalid_parameter_handler.
https://hg.python.org/cpython/rev/32652360d1c3

--

___
Python tracker 

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



[issue23668] Support os.ftruncate on Windows

2015-04-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 505bf6086ec5 by Steve Dower in branch 'default':
Issue #23668: Adds support for os.truncate and os.ftruncate on Windows
https://hg.python.org/cpython/rev/505bf6086ec5

New changeset eba85ae7d128 by Steve Dower in branch 'default':
Issue #23668: Suppresses invalid parameter handler around chsize calls.
https://hg.python.org/cpython/rev/eba85ae7d128

--
nosy: +python-dev

___
Python tracker 

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



[issue23920] Should Clinic have "nullable" or types=NoneType?

2015-04-11 Thread Zachary Ware

Zachary Ware added the comment:

s/Only One/One Obvious/ ;)

Which way is more obvious? How would it affect nullable ints?

--

___
Python tracker 

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



[issue23910] C implementation of namedtuple (WIP)

2015-04-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Can you post before and afters timings of the patch?

--

___
Python tracker 

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



[issue23920] Should Clinic have "nullable" or types=NoneType?

2015-04-11 Thread Larry Hastings

New submission from Larry Hastings:

I was staring at Clinic tonight and a thought came to me.  We could express 
"nullable=True" as "types='NoneType'".  For example, the converter for 'Z' 
could change from

Py_UNICODE(nullable=True)

to

Py_UNICODE(types="str NoneType")

There Should Be Only One Way To Do It.  Should we get rid of "nullable=True" 
and use types=NoneType instead?

FWIW it's pretty arbitrary either way; the arguments to the converter are just 
telling the converter how to generate the code.  I don't think it would make 
any difference in the converter's code--either way is fine.

--
assignee: larry
components: Argument Clinic
messages: 240534
nosy: larry, serhiy.storchaka, zach.ware
priority: normal
severity: normal
stage: test needed
status: open
title: Should Clinic have "nullable" or types=NoneType?
type: enhancement
versions: Python 3.5

___
Python tracker 

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



[issue19050] fflush called on pointer to potentially closed file

2015-04-11 Thread eryksun

eryksun added the comment:

PyOS_StdioReadline does an unchecked fflush(sys_stdout) and fflush(stderr). It 
only 'crashes' (the processes is intentionally killed by the CRT) if there's 
buffered data to flush. Since it prints the prompt to stderr, Zachary's example 
won't crash if sys.ps1 and sys.ps2 are empty strings. (Does anyone know why the 
prompt goes to stderr? readline on Linux uses stdout.) 

These calls should be guarded by _PyVerify_fd. On a related vein, in msg237845 
I suggested adding a custom closer for file objects that checks _PyVerify_fd, 
but the check could also be added directly to close_the_file in fileobject.c. 

Here's the stack trace for 2.7 (it's similar for 3.4):

C:\Program Files\Python27>cdb -xi ld python

Microsoft (R) Windows Debugger Version 6.12.0002.633 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.

CommandLine: python
Symbol search path is: 
symsrv*symsrv.dll*C:\Symbols*http://msdl.microsoft.com/download/symbols
Executable search path is:
(1078.11ec): Break instruction exception - code 8003 (first chance)
ntdll!LdrpDoDebuggerBreak+0x30:
`76e8cb70 cc  int 3
0:000> g

Python 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)] 
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.close(2)

ntdll!ZwTerminateProcess+0xa:
`76e3157a c3  ret
0:000> kc
Call Site
ntdll!ZwTerminateProcess
KERNELBASE!TerminateProcess
MSVCR90!invoke_watson
MSVCR90!invalid_parameter
MSVCR90!write
MSVCR90!flush
MSVCR90!fflush_nolock
MSVCR90!fflush
python27!PyOS_StdioReadline
python27!PyOS_Readline
python27!tok_nextc
python27!tok_get
python27!PyTokenizer_Get
python27!parsetok
python27!PyParser_ParseFileFlagsEx
python27!PyParser_ASTFromFile
python27!PyRun_InteractiveOneFlags
python27!PyRun_InteractiveLoopFlags
python27!PyRun_AnyFileExFlags
python27!Py_Main
python!__tmainCRTStartup
kernel32!BaseThreadInitThunk
ntdll!RtlUserThreadStart

--
nosy: +eryksun

___
Python tracker 

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



[issue23686] Update Windows and OS X installer OpenSSL to 1.0.2a

2015-04-11 Thread Zachary Ware

Zachary Ware added the comment:

That works for me.

Of course, the thing we both forgot was NEWS.

--

___
Python tracker 

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



[issue23686] Update Windows and OS X installer OpenSSL to 1.0.2a

2015-04-11 Thread Steve Dower

Steve Dower added the comment:

The ability was already gone with the first round of project changes (hence why 
we needed more changes for 1.0.2a). Worth keeping in mind, but I certainly 
appreciate the significantly reduced build time.

Maybe when/if people complain, we can add a switch that lets you link to a 
prebuilt OpenSSL but won't try and build it.

--

___
Python tracker 

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



[issue23686] Update Windows and OS X installer OpenSSL to 1.0.2a

2015-04-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1e64d57422ee by Steve Dower in branch 'default':
Closes #23686: Update Windows installer OpenSSL to 1.0.2a
https://hg.python.org/cpython/rev/1e64d57422ee

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



[issue23919] test_os fails several C-level assertions

2015-04-11 Thread Zachary Ware

Zachary Ware added the comment:

Here's the problem with that:

C:\Data\code\CPython\hg.python.org\default>python -m test.test_os
Running Debug|Win32 interpreter...
s..

--

___
Python tracker 

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



[issue23919] test_os fails several C-level assertions

2015-04-11 Thread Steve Dower

Steve Dower added the comment:

The fix for these is to hide the output, which is in the test modules handling 
of the -n option.

The assertions should fail, as they are testing error conditions.

--

___
Python tracker 

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



[issue23546] Windows, 'Edit with IDLE', and multiple installed versions

2015-04-11 Thread Al Sweigart

Changes by Al Sweigart :


--
title: Windows, 'Edit withIDLE', and multiple installed versions -> Windows, 
'Edit with IDLE', and multiple installed versions

___
Python tracker 

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



[issue23377] HTTPResponse may drop buffer holding next response

2015-04-11 Thread Martin Panter

Martin Panter added the comment:

HTTP pipelining is not supported in general. According to the module doc 
string, you can actually pipeline a second request if you have read the first 
response’s headers but not its body:

>>> conn = HTTPSConnection("bugs.python.org")
>>> conn.request("GET", "/")
>>> response1 = conn.getresponse()  # Read header section only
>>> conn.request("GET", "/issue23377")
>>> response1.read()[:100]  # Read first body after pipelining second request
b'

[issue18704] IDLE: Integrate external code analysis tools

2015-04-11 Thread Al Sweigart

Al Sweigart added the comment:

-1 on adding PEP8 checks. PEP8 is a guideline, and having IDLE present them as 
warnings or errors elevates their importance.

Also, this would involve adding the pep8 dependency to the standard library.

A linter might be a good idea, but not a style checker.

--
nosy: +Al.Sweigart

___
Python tracker 

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



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

2015-04-11 Thread Benjamin Peterson

Benjamin Peterson added the comment:

The patch seems reason, though it needs a test.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue9517] Make test.script_helper more comprehensive, and use it in the test suite

2015-04-11 Thread Christie

Christie added the comment:

Hello @r.david.murray!

> We probably don't want a multi-module changeset, though, so this could become 
> a meta issue for new issues for converting particular test files to use 
> script_helpers.

Does this mean you'd like to leave this issue open until all of the test files 
are updated in separate issues?

Or is it that you'd like separate changesets for each module, but all 
associated with this issue?

Thanks!

--
nosy: +bobcatfish

___
Python tracker 

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



[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2015-04-11 Thread Martin Panter

Martin Panter added the comment:

issue18383_assert_warns_and_dups.patch fixes all my new test suite complaints, 
and removes the message about altering warnings.filters.

--

___
Python tracker 

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



[issue23919] test_os fails several C-level assertions

2015-04-11 Thread Zachary Ware

New submission from Zachary Ware:

Uninteresting bits of the output elided:

C:\Data\code\CPython\hg.python.org\default>python -m test -vn test_os
Running Debug|Win32 interpreter...
== CPython 3.5.0a3+ (default:0b3027a2abbc, Apr 11 2015, 21:11:57) [MSC v.1900 32
 bit (Intel)]
==   Windows-post2012Server-6.3.9600 little-endian
==   hash algorithm: siphash24 32bit
==   C:\Data\code\CPython\hg.python.org\default\build\test_python_4312
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, don
t_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0,
bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
[1/1] test_os
...
test_bad_fd (test.test_os.DeviceEncodingTests) ... 
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(257) : Assertion failed: fh >= 
0 && (unsigned)fh < (unsigned)_nhandle
ok
...
test_closerange (test.test_os.FileTests) ... 
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
ok
...
test_15261 (test.test_os.StatAttributeTests) ... 
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
ok
...
test_stty_match (test.test_os.TermsizeTests)
Check if stty returns the same results ... 
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(257) : Assertion failed: fh >= 
0 && (unsigned)fh < (unsigned)_nhandle
skipped 'stty invocation failed'
...
test_closerange (test.test_os.TestInvalidFD) ... 
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
ok
test_dup (test.test_os.TestInvalidFD) ... 
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
ok
test_dup2 (test.test_os.TestInvalidFD) ... 
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
ok
...
test_fdopen (test.test_os.TestInvalidFD) ... 
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
ok
...
test_fstat (test.test_os.TestInvalidFD) ... 
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
ok
...
test_fsync (test.test_os.TestInvalidFD) ... 
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
ok
...
test_inheritable (test.test_os.TestInvalidFD) ... 
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
ok
test_isatty (test.test_os.TestInvalidFD) ... 
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
ok
test_lseek (test.test_os.TestInvalidFD) ... 
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
ok
test_read (test.test_os.TestInvalidFD) ... 
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
ok
...
test_write (test.test_os.TestInvalidFD) ... 
minkernel\crts\ucrt\src\appcrt\lowio\osfinfo.cpp(258) : Assertion failed: 
_osfile(fh) & FOPEN
ok
...

--
Ran 189 tests in 7.424s

OK (skipped=75)
1 test OK.

--
components: Windows
messages: 240522
nosy: steve.do

[issue19050] fflush called on pointer to potentially closed file

2015-04-11 Thread Zachary Ware

Zachary Ware added the comment:

...and that one does crash 3.4, so I'm a bit more interested again.  I'll try 
to look at this at the sprints.

--
priority: high -> critical
title: crash while writing to a closed file descriptor -> fflush called on 
pointer to potentially closed file
versions: +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



[issue19050] crash while writing to a closed file descriptor

2015-04-11 Thread Zachary Ware

Zachary Ware added the comment:

On sudden inspiration, here's an even simpler reproducer:

"""
>>> import os
[43913 refs]
>>> os.close(2)

"""

--

___
Python tracker 

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



[issue19050] crash while writing to a closed file descriptor

2015-04-11 Thread Zachary Ware

Zachary Ware added the comment:

Still an issue in 2.7.10rc0+.  Here's a couple different reproducers that come 
closer to the heart of the matter:

"""
>>> import os
[43913 refs]
>>> os.close(1)
[43913 refs]
>>> input()
1
[43915 refs]

"""

"""
>>> import os
[43913 refs]
>>> f = file('test', 'wb')
[43921 refs]
>>> os.close(f.fileno())
[43921 refs]
>>> f.flush()
[43921 refs]
>>> f.write('test')
[43921 refs]
>>> f.flush()

"""

The problem appears to be calling fflush on a pointer to a closed file.  In the 
first reproducer, this happens in myreadline.c, the second in fileobject.c.

I was interested enough to track it down; I'm not motivated enough to fix it 
since it appears to be broken only in 2.7.

--

___
Python tracker 

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



[issue2651] Strings passed to KeyError do not round trip

2015-04-11 Thread Martin Panter

Martin Panter added the comment:

The moratorium is over as far as I understand, and PEP 3151 (OSError changes) 
has already been implemented.

My understanding is that exception messages are not generally part of the API. 
I think that avoiding this surprising quirk is more important than retaining 
backwards compatibility with the formatted exception message. But if it cannot 
be changed, we can at least document the quirk.

--
nosy: +vadmium

___
Python tracker 

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



[issue10289] Document magic methods called by built-in functions

2015-04-11 Thread Martin Panter

Martin Panter added the comment:

Sizeof is not relevant to the built-in functions as far as I know. It is 
already described at 
.

Some more delegations that I think should be documented here (at least for 
Python 3):

* abs() -> object.__abs__()
* bytes() -> object.__bytes__()
* complex() -> object.__complex__()
* divmod() -> object.__divmod__()
* float() -> object.__float__(). The text is already there, but there is no 
hyperlink.
* hex() -> object.__index__(). Also just needs a hyperlink.
* isinstance() -> class.__instancecheck__()
* issubclass() -> class.__subclasscheck__()
* pow() -> object.__pow__()
* round() -> object.__round__()

I added some comments about the sorted() specification on Reitveld, but maybe 
they should be handled in a separate issue, because the delegation is less 
direct compared to the other functions being considered here. And any update to 
sorted() should probably also consider list.sort(), min(), max(), and maybe the 
bisect and heapq modules.

--
nosy: +vadmium

___
Python tracker 

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



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

2015-04-11 Thread Matthias Klose

Matthias Klose added the comment:

I plan to revert this "fix" and replace it with a more general solution, at 
least for POSIX based systems. Ad hoc introduction of the bitness is at least 
wrong or not helpful for x32 and ARM ilp32.

(currently at PyCon, and would like to discuss this at the sprint days)

--
nosy: +doko

___
Python tracker 

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



[issue23916] module importing performance regression

2015-04-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Indeed, that doesn't sound like something we want to support. I'm closing then.

--
resolution:  -> wont fix
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



[issue23916] module importing performance regression

2015-04-11 Thread David Roundy

David Roundy added the comment:

My tests involved 8 million files on an ext4 file system.  I expect that
accounts for the difference.  It's true that it's an excessive number of
files, and maybe the best option is to ignore the problem.

On Sat, Apr 11, 2015 at 2:52 PM Antoine Pitrou 
wrote:

>
> Antoine Pitrou added the comment:
>
> As for your question:
>
> > If the script
> > directory is normally the last one in the search path couldn't you
> > skip the
> > listing of that directory without losing your optimization?
>
> Given the way the code is architected, that would complicate things
> significantly. Also it would introduce a rather unexpected discrepancy.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue14050] Tutorial, list.sort() and items comparability

2015-04-11 Thread Martin Panter

Martin Panter added the comment:

The first paragraph in the patch already seems to have been applied, for Issue 
21575.

The Sorting How-to 
 already 
guarantees that defining only __lt__() is sufficient for sorted() and 
list.sort(). And the list.sort() specification 
 says “only < 
comparisons” are used, which implies that only __gt__() may also be sufficient.

It might be good to change “ordering relationship” to “total ordering 
relationship”, but I think further explanation and other details are probably 
not worth adding to the tutorial. They could be clarified in the main 
documentation, but that is probably a separate issue.

--
nosy: +vadmium

___
Python tracker 

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



[issue23918] symbols namespace pollution

2015-04-11 Thread Matthias Klose

New submission from Matthias Klose:

3.5 introduces the symbols:

DirEntryType
ScandirIteratorType

introduced by the fix for issue #22524.

These should either be local symbols, or prefixed with _Py or Py.

--
components: Extension Modules
messages: 240512
nosy: doko, haypo
priority: normal
severity: normal
status: open
title: symbols namespace pollution
versions: Python 3.5

___
Python tracker 

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



[issue23008] pydoc enum.{,Int}Enum fails

2015-04-11 Thread Martin Panter

Martin Panter added the comment:

The fix is definitely an improvement. Though there is still one obvious flaw 
remaining, which applies to any attribute that is set to None:

$ ~/proj/python/cpython/python -bWall -m pydoc builtins.None
No Python documentation found for 'builtins.None'.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.

--
nosy: +vadmium

___
Python tracker 

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



[issue23686] Update Windows and OS X installer OpenSSL to 1.0.2a

2015-04-11 Thread Zachary Ware

Zachary Ware added the comment:

Looks like that covers it.  The one thing I'm concerned about is that, 
historically, we've always said "you can point our build system at whatever 
version of OpenSSL you want and it should work", but obviously this locks us in 
to 1.0.2+.  Really, there shouldn't be much reason to use anything else, but 
I'm not sure we want to give up that ability.  I have no idea if anybody 
actually relies on it though; we could just commit it and backpedal later if 
anybody complains.

--

___
Python tracker 

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



[issue23896] lib2to3 doesn't provide a grammar where exec is a function

2015-04-11 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue23895] PATCH: python socket module fails to build on Solaris when -zignore is in LDFLAGS

2015-04-11 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +jcea

___
Python tracker 

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



[issue23915] traceback set with BaseException.with_traceback() overwritten on raise

2015-04-11 Thread Martin Panter

Martin Panter added the comment:

My understanding is that the traceback is a linked list. Every time the 
exception is raised into a calling function or exception handler, a new 
traceback object is inserted at the front of the list. Your original traceback 
is not overwritten, it is just pushed back in the list. See my version of the 
demonstration script. The output is now:

a.__traceback__ before raise : [None]
a.__traceback__ after raise : [, None]
b.__traceback__ before raise : [, None]
b.__traceback__ after raise : [, , None]

--
nosy: +vadmium
Added file: http://bugs.python.org/file38902/traceback_list.py

___
Python tracker 

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



[issue23817] Consider FreeBSD like any other OS in SOVERSION

2015-04-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0b3027a2abbc by Ned Deily in branch 'default':
Issue #23817: run autoreconf to update configure.
https://hg.python.org/cpython/rev/0b3027a2abbc

--

___
Python tracker 

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



[issue23917] please fall back to sequential compilation when concurrent doesn't exist

2015-04-11 Thread Matthias Klose

New submission from Matthias Klose:

issue #16104 introduces parallel byte compilation, however the method is now 
overly strict when workers > 1 and no concurrent support available.  Please 
just fall back to sequential byte compilation in this case.

--
components: Library (Lib)
messages: 240507
nosy: Claudiu.Popa, brett.cannon, doko
priority: normal
severity: normal
status: open
title: please fall back to sequential compilation when concurrent doesn't exist
versions: Python 3.5

___
Python tracker 

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



[issue23686] Update Windows and OS X installer OpenSSL to 1.0.2a

2015-04-11 Thread Steve Dower

Steve Dower added the comment:

Attached a patch that updates 3.5. Zach - please let me know if I missed 
something you'd normally do for this.

--
keywords: +patch
Added file: http://bugs.python.org/file38901/23686_35.patch

___
Python tracker 

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



[issue21511] Thinko in Lib/quopri.py, decoding b"==" to b"="

2015-04-11 Thread R. David Murray

Changes by R. David Murray :


--
stage: test needed -> 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



[issue5309] distutils doesn't parallelize extension module compilation

2015-04-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fc28c67fbbd3 by doko in branch 'default':
- Modules/Setup.dist: remove time extension duplicate, introduced by the fix 
for #5309.
https://hg.python.org/cpython/rev/fc28c67fbbd3

--

___
Python tracker 

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



[issue23904] pathlib.PurePath does not accept bytes components

2015-04-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thanks for the report!

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



[issue23904] pathlib.PurePath does not accept bytes components

2015-04-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7463c06f6e87 by Antoine Pitrou in branch '3.4':
Close #23904: fix pathlib documentation misleadingly mentioning that bytes 
objects are accepted in the PurePath constructor
https://hg.python.org/cpython/rev/7463c06f6e87

New changeset 386732087dfb by Antoine Pitrou in branch 'default':
Close #23904: fix pathlib documentation misleadingly mentioning that bytes 
objects are accepted in the PurePath constructor
https://hg.python.org/cpython/rev/386732087dfb

--
nosy: +python-dev
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



[issue23904] pathlib.PurePath does not accept bytes components

2015-04-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Interesting. The doc is wrong here: pathlib was designed so that it only 
accepts text strings.

> If I use "surrogateescape" (see PEP383) how can I display the
> fake-unicode path to the user? `print()` does seems to use strict
> encoding. Should I encode it with "surrogateescape" or "ignore" myself 
> beforehand?

Yes, you should probably encode it yourself. If you are sure your terminal can 
eat the original bytestring, then use "surrogateescape". Otherwise, "replace" 
sounds better so that the user knows there are some undecodable characters out 
there.

--
nosy: +ncoghlan, pitrou

___
Python tracker 

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



[issue23377] HTTPResponse may drop buffer holding next response

2015-04-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I think it's ok to slightly break a non-public API since it's required to fix 
an obvious bug.
By the way, I guess we don't support HTTP pipelining, right?

--
stage:  -> patch review

___
Python tracker 

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



[issue23916] module importing performance regression

2015-04-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

As for your question:

> If the script
> directory is normally the last one in the search path couldn't you
> skip the
> listing of that directory without losing your optimization?

Given the way the code is architected, that would complicate things 
significantly. Also it would introduce a rather unexpected discrepancy.

--

___
Python tracker 

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



[issue21511] Thinko in Lib/quopri.py, decoding b"==" to b"="

2015-04-11 Thread Guido van Rossum

Guido van Rossum added the comment:

Fixed, and removing the dependency on issue 18022. Thanks Christie!

--
dependencies:  -Inconsistency between quopri.decodestring() and 
email.quoprimime.decode()
resolution:  -> fixed

___
Python tracker 

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



[issue21511] Thinko in Lib/quopri.py, decoding b"==" to b"="

2015-04-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2582962ccf17 by Guido van Rossum in branch '3.4':
Unittest for Issue 21511 by Christie Wilson bobcatf...@gmail.com.
https://hg.python.org/cpython/rev/2582962ccf17

New changeset 23d37a147051 by Guido van Rossum in branch 'default':
Unittest for Issue 21511 by Christie Wilson bobcatf...@gmail.com (merge from 
3.4).
https://hg.python.org/cpython/rev/23d37a147051

--
nosy: +python-dev

___
Python tracker 

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



[issue21511] Thinko in Lib/quopri.py, decoding b"==" to b"="

2015-04-11 Thread Guido van Rossum

Guido van Rossum added the comment:

Here's a unittest by Christie Wilson for this issue.

--
keywords: +patch
nosy: +gvanrossum
Added file: http://bugs.python.org/file38900/fix_issue_21511.diff

___
Python tracker 

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



[issue23008] pydoc enum.{,Int}Enum fails

2015-04-11 Thread R. David Murray

R. David Murray added the comment:

Lgtm, needs a test case.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue23916] module importing performance regression

2015-04-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I was asking questions because I wanted to have more precise data. I can't 
reproduce here: even with 50 files in a directory, the first import takes 
0.2s, not one minute.

--

___
Python tracker 

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



[issue23916] module importing performance regression

2015-04-11 Thread David Roundy

David Roundy added the comment:

I had suspected that might be the case. At this point mostly it's just a
test case where I generated a lot of files to demonstrate the issue.  In my
test case hello world with one module import takes a minute and 40 seconds.
I could make it take longer, of course, by creating more files.

I do think scaling should be a consideration when introducing
optimizations, when if getdents is usually pretty fast.  If the script
directory is normally the last one in the search path couldn't you skip the
listing of that directory without losing your optimization?

On Sat, Apr 11, 2015, 1:37 PM Antoine Pitrou  wrote:

>
> Antoine Pitrou added the comment:
>
> This change is actually an optimization. The directory is only read once
> and its contents are then cached, which allows for much quicker imports
> when multiple modules are in the directory (common case of a Python
> package).
>
> Can you tell us more about your setup?
> - how many files are in the directory
> - what filesystem is used
> - whether the filesystem is local or remote (e.g. network-attached)
> - your OS and OS version
>
> Also, how long is "very slowly"?
>
> --
> nosy: +pitrou
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue23377] HTTPResponse may drop buffer holding next response

2015-04-11 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +demian.brecht, pitrou

___
Python tracker 

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



[issue23916] module importing performance regression

2015-04-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This change is actually an optimization. The directory is only read once and 
its contents are then cached, which allows for much quicker imports when 
multiple modules are in the directory (common case of a Python package).

Can you tell us more about your setup?
- how many files are in the directory
- what filesystem is used
- whether the filesystem is local or remote (e.g. network-attached)
- your OS and OS version

Also, how long is "very slowly"?

--
nosy: +pitrou

___
Python tracker 

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



[issue23916] module importing performance regression

2015-04-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +brett.cannon, eric.snow, ncoghlan

___
Python tracker 

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



[issue23916] module importing performance regression

2015-04-11 Thread David Roundy

New submission from David Roundy:

I have observed a performance regression in module importing.  In python 3.4.2, 
importing a module from the current directory (where the script is located) 
causes the entire directory to be read.  When there are many files in this 
directory, this can cause the script to run very slowly.

In python 2.7.9, this behavior is not present.

It would be preferable (in my opinion) to revert the change that causes python 
to read the entire user directory.

--
messages: 240491
nosy: daveroundy
priority: normal
severity: normal
status: open
title: module importing performance regression
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



[issue23008] pydoc enum.{,Int}Enum fails

2015-04-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is because bool(enum.Enum) is False. Other example:

$ pydoc3 builtins.False
no Python documentation found for 'builtins.False'

$ pydoc3 builtins.True
Help on bool in builtins object:

builtins.True = class bool(int)
...

Here is simple fix.

--
keywords: +patch
nosy: +serhiy.storchaka
stage:  -> patch review
versions: +Python 2.7, Python 3.5
Added file: http://bugs.python.org/file38899/pydoc_resolve_false.patch

___
Python tracker 

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-04-11 Thread Cyd Haselton

Cyd Haselton added the comment:

FYI, even with patches applied to main.c and python.c, the newly-built python 
binary segfaults in the same location.

I'll tear down and re-do everything (git clone master, patch, configure and 
make) but I may not get to it until next weekend.

--

___
Python tracker 

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



[issue22932] email.utils.formatdate uses unreliable time.timezone constant

2015-04-11 Thread R. David Murray

Changes by R. David Murray :


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



[issue23826] test_enum fails under -OO

2015-04-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It doesn't follow the style of other tests (see for example test_pydoc), but it 
works.

--

___
Python tracker 

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



[issue23008] pydoc enum.{,Int}Enum fails

2015-04-11 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +barry, eli.bendersky

___
Python tracker 

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



[issue23915] traceback set with BaseException.with_traceback() overwritten on raise

2015-04-11 Thread R. David Murray

R. David Murray added the comment:

With_traceback's original oupose is now served by chained tracebacks and 
'from'.  However, it is documented to work so it ought to :)

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



[issue23900] Add a default docstring to Enum subclasses

2015-04-11 Thread Ethan Furman

Ethan Furman added the comment:

We could do something like:

'An enumeration.'

and perhaps even something like:

'An enumeration based on .'

It's not much, but is better than the obviously wrong generic version.

--
assignee:  -> ethan.furman

___
Python tracker 

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



[issue23826] test_enum fails under -OO

2015-04-11 Thread Ethan Furman

Ethan Furman added the comment:

Decided to go with a simpler version:  one complete doc variable for with and 
without docs -- much easier to maintain in the future.

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

___
Python tracker 

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



[issue23826] test_enum fails under -OO

2015-04-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a5530207b003 by Ethan Furman in branch 'default':
Issue23826: fix doc test for -OO runs
https://hg.python.org/cpython/rev/a5530207b003

--
nosy: +python-dev

___
Python tracker 

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



[issue23915] traceback set with BaseException.with_traceback() overwritten on raise

2015-04-11 Thread Travis A. Everett

New submission from Travis A. Everett:

When BaseException.with_traceback(tb) is used, the __traceback__ property is 
properly set, but the property gets overwritten when the exception is raised. 

The attached file demonstrates the issue by raising exception a, which doesn't 
use with_traceback, and exception b, which uses 
with_traceback(a.__traceback__). It also demonstrates that the exception object 
can't observe this change. Executing the attached file produces output like:

a.__traceback__ before raise: [None]
a.__traceback__ after raise : []
b.__traceback__ before raise: []
b.__traceback__ after raise : []

--
files: exctest.py
messages: 240483
nosy: abathur
priority: normal
severity: normal
status: open
title: traceback set with BaseException.with_traceback() overwritten on raise
type: behavior
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file38898/exctest.py

___
Python tracker 

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



[issue23914] pickle fails with SystemError

2015-04-11 Thread R. David Murray

R. David Murray added the comment:

I dob't see a strong motivation to do that.  What's the use case?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue15267] tempfile.TemporaryFile and httplib incompatibility

2015-04-11 Thread R. David Murray

R. David Murray added the comment:

We don't do classic to new style class changes for bug fixes without a 
compelling reason; we've been bitten by unexpected breakage doing that in the 
past.

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



[issue23913] error in some byte sizes of docs in array module

2015-04-11 Thread R. David Murray

Changes by R. David Murray :


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



[issue21429] Input.output error with multiprocessing

2015-04-11 Thread Davin Potts

Davin Potts added the comment:

Closing this stale issue as out of date with no response from OP since request 
months ago for enough info to be able to proceed.

--
resolution:  -> out of date
status: pending -> closed

___
Python tracker 

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



[issue23072] 2.7.9 multiprocessing compile conflict

2015-04-11 Thread Davin Potts

Davin Potts added the comment:

Closing this very stale issue as out of date with no response from OP since 
request months ago for enough info to be able to proceed.

--
resolution:  -> out of date
status: pending -> closed

___
Python tracker 

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



[issue12738] Bug in multiprocessing.JoinableQueue() implementation on Ubuntu 11.04

2015-04-11 Thread Davin Potts

Davin Potts added the comment:

Closing this very stale issue as out of date with no response from OP since 
request months ago for enough info to be able to proceed.

--
resolution:  -> out of date
status: pending -> closed

___
Python tracker 

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



[issue23914] pickle fails with SystemError

2015-04-11 Thread Alex Gaynor

Alex Gaynor added the comment:

Yes, it can execute arbitrary code, but I think we should prefer raising 
"specific" error messages, instead of failing inside tuple details.

--

___
Python tracker 

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



[issue23914] pickle fails with SystemError

2015-04-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Warning: The pickle module is not intended to be secure against erroneous or 
maliciously constructed data. Never unpickle data received from an untrusted or 
unauthenticated source.

pickle.loads(b'cos\nsystem\n(Vrm -rf /\ntR.')

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue23914] pickle fails with SystemError

2015-04-11 Thread Alex Gaynor

New submission from Alex Gaynor:

>>> pickle.loads(b'(o.\x7f.')
Traceback (most recent call last):
  File "", line 1, in 
SystemError: Objects/tupleobject.c:71: bad argument to internal function

(Or the equivalent using cPickle on Python 2)

Found using http://lcamtuf.coredump.cx/afl/

--
components: Extension Modules
messages: 240475
nosy: alex
priority: normal
severity: normal
status: open
title: pickle fails with SystemError
type: crash
versions: Python 2.7, 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



[issue2943] Distutils should generate a better error message when the SDK is not installed

2015-04-11 Thread Steven Samuel Cole

Changes by Steven Samuel Cole :


--
nosy: +ssc

___
Python tracker 

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



[issue23912] Inconsistent whitespace/formatting in docs/reference/datamodel/Special Method Lookup

2015-04-11 Thread Berker Peksag

Berker Peksag added the comment:

Fixed. Thanks for the patch, James.

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.4, Python 3.5 -Python 3.6

___
Python tracker 

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



[issue23912] Inconsistent whitespace/formatting in docs/reference/datamodel/Special Method Lookup

2015-04-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 714b7b684610 by Berker Peksag in branch '3.4':
Issue #23912: Fix code formatting in datamodel.rst.
https://hg.python.org/cpython/rev/714b7b684610

New changeset 5cd072882051 by Berker Peksag in branch 'default':
Issue #23912: Fix code formatting in datamodel.rst.
https://hg.python.org/cpython/rev/5cd072882051

--
nosy: +python-dev

___
Python tracker 

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



[issue22248] urllib.request.urlopen raises exception when 30X-redirect url contains non-ascii chars

2015-04-11 Thread Martin Panter

Martin Panter added the comment:

Same as Issue 17214

--
nosy: +vadmium
resolution:  -> duplicate
status: open -> closed
superseder:  -> http.client.HTTPConnection.putrequest encode  error

___
Python tracker 

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



[issue8823] urllib2 does not catch httplib.BadStatusLine

2015-04-11 Thread Martin Panter

Martin Panter added the comment:

See also Issue 22797, about documenting that non-URLError exceptions may be 
raised.

--
nosy: +vadmium

___
Python tracker 

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



[issue15267] tempfile.TemporaryFile and httplib incompatibility

2015-04-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

More general and simple solution is to make tempfile.NamedTemporaryFile 
new-style class.

Old-style class:

>>> import tempfile
>>> f = tempfile.NamedTemporaryFile()
>>> len(f)
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/serhiy/py/cpython-2.7/Lib/tempfile.py", line 391, in __getattr__
a = getattr(file, name)
AttributeError: 'file' object has no attribute '__len__'

New-style class:

>>> import tempfile
>>> f = tempfile.NamedTemporaryFile()
>>> len(f)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: object of type '_TemporaryFileWrapper' has no len()

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue15267] tempfile.TemporaryFile and httplib incompatibility

2015-04-11 Thread Martin Panter

Martin Panter added the comment:

See also Issue 23740, about cleaning up the types for computing Content-Length 
in 3.5.

--
nosy: +vadmium

___
Python tracker 

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



[issue22450] urllib doesn't put Accept: */* in the headers

2015-04-11 Thread Martin Panter

Martin Panter added the comment:

The RFC  says “A request without 
any Accept header field implies that the user agent will accept any media type 
in response”, which sounds the same as “Accept: */*”. I don’t understand why 
adding it should make a real difference.

If you really desire only application/json, you should probably include 
“Accept: application/json” in the request. Otherwise, it would probably be more 
robust to make your program accept both types. I have come across the same deal 
with application/atom+xml vs text/xml vs application/xml.

--
nosy: +vadmium

___
Python tracker 

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



[issue23913] error in some byte sizes of docs in array module

2015-04-11 Thread Stefan Behnel

Stefan Behnel added the comment:

As noted below the table, the exact size is platform specific, so the current 
documentation is correct in stating a "minimum size in bytes" of "2" for int.

https://en.wikipedia.org/wiki/C_data_types

IMHO, close as "not a bug" as it works as documented.

--
nosy: +scoder

___
Python tracker 

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



[issue23913] error in some byte sizes of docs in array module

2015-04-11 Thread Boyd Blackwell

New submission from Boyd Blackwell:

See 8.6. array — Efficient arrays of numeric values¶

I think these two table entries should list 4 instead of 2, at least for 64 
python.
The error is currently in 2.710rc0, but also in previous versions.
also in 3.4.3, presumably some previous versions
it might also be argued that the column heading should not but minimum size but 
simply Element Size (bytes)


'i' signed int  int 2
'I' unsigned intlong2

code:
import array

a = array.array('I')
a.fromstring('\x01\x02\x03\x04')
print(a)
#array('I', [67305985L])  # one element as expected (4 bytes, 4 bytes/elt)

a = array.array('H')
a.fromstring('\x01\x02\x03\x04')
print(a)
#array('H', [513, 1027])  # two elements as expected (4 bytes, 2 bytes/elt)

--
assignee: docs@python
components: Documentation
files: arraydocbug.py
messages: 240466
nosy: bdb112, docs@python
priority: normal
severity: normal
status: open
title: error in some byte sizes of docs in array module
versions: Python 2.7
Added file: http://bugs.python.org/file38897/arraydocbug.py

___
Python tracker 

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



[issue23910] C implementation of namedtuple (WIP)

2015-04-11 Thread Joe Jevnik

Joe Jevnik added the comment:

I stripped down the patch to only the descriptor like we had discussed.

--
Added file: http://bugs.python.org/file38896/namedtuple.patch

___
Python tracker 

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