[issue28165] The 'subprocess' module leaks roughly 4 KiB of memory per call

2016-09-14 Thread Xavion

Xavion added the comment:

I wouldn't have reported this if it was only happening *once*.  I already have 
it in a loop; a new shell command is fired every second.

The memory footprint increases by roughly 4 KiB *each* time.  I monitor it via 
the following Bash script:
while true; do
ps -C "python3 ./Program.pyw" -o pid=,%mem=,rss= >> ./Output.log
sleep 1
done &

I have attached the logfile for your convenience.  Let me know if you'd like me 
to run any other tests.

--
Added file: http://bugs.python.org/file44671/Output.log

___
Python tracker 

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



[issue28150] Error CERTIFICATE_VERIFY_FAILED in macOS

2016-09-14 Thread Ned Deily

Ned Deily added the comment:

Sorry, the information about this feature is currently only documented in the 
OS X installer ReadMe.  As you noted, it's displayed to the user during 
installation when using the OS X installer app.  A copy of the ReadMe is also 
installed for later reference in the directory /Applications/Python 3.6/.

Here's what it says about this feature:


Certificate verification and OpenSSL


**NEW** This variant of Python 3.6 now includes its own private copy of OpenSSL 
1.0.2.  Unlike previous releases, the deprecated Apple-supplied OpenSSL 
libraries are no longer used.  This also means that the trust certificates in 
system and user keychains managed by the Keychain Access application and the 
security command line utility are no longer used as defaults by the Python ssl 
module.  For 3.6.0b1, a sample command script is included in 
/Applications/Python 3.6 to install a curated bundle of default root 
certificates from the third-party certifi package 
(https://pypi.python.org/pypi/certifi).  If you choose to use certifi, you 
should consider subscribing to the project's email update service to be 
notified when the certificate bundle is updated.

The bundled pip included with the Python 3.6 installer has its own default 
certificate store for verifying download connections.


So the feature does *not* require 'certifi' to be installed.  As currently 
implemented, the supplied private copy of the OpenSSL libs is configured with 
its own private openssl directory for root certificates, as root certificates 
in macOS / OS X are stored in system and user keychains, not in an 
OpenSSL-compatible file or directory.  The path to the Python-installed 
directory is accessible via the attributes of ssl.get_default_verify_paths().  
As installed, the Python-installed directory is empty.  So, to supply default 
root certificates, you need to either copy a certificate bundle or directory to 
the directory or provide a symlink to a certificate bundle or directory 
installed elsewhere.  In 360b1 as noted in the ReadMe, there is a simple 
double-clickable or command-line-runnable script ("/Applications/Python 
3.6/Install Certificates.command") that does two things: 1. uses pip to install 
certifi and 2. creates a symlink in the OpenSSL directory to certifi's 
installed bundle locati
 on. Without the second step, installing certifi manually won't work, as you 
discovered.  Running the script as described in the ReadMe will solve your 
problem.  Of course, anyone can supply their own certificates as with any 
version of OpenSSL.

Granted, the 360b1 ReadMe could be more detailed.  For 360b2, I intend to 
expand the script to cover some other options and expand the documentation as 
part of Issue17128.  What's in 360b1 is not all that pretty but it seemed to me 
to be the least bad of the various practical options, including continuing to 
use the old, deprecated system OpenSSL libraries.

--
priority: critical -> normal
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: security -> 

___
Python tracker 

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



[issue28165] The 'subprocess' module leaks roughly 4 KiB of memory per call

2016-09-14 Thread Antti Haapala

Antti Haapala added the comment:

3.5.1+ ubuntu; I run the Popen case in while True, and watch `top` - not a 
single digit changes in the memory usage (the last digit being the kilobytes). 
That the memory footprint increases *once* by 4KiB is nothing; please run this 
in a loop.

--
nosy: +ztane

___
Python tracker 

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



[issue28165] The 'subprocess' module leaks roughly 4 KiB of memory per call

2016-09-14 Thread Xavion

New submission from Xavion:

Each time I run a shell command via the 'subprocess' module, I notice that the 
memory footprint of my program increases by roughly 4 KiB.

I've tested the problem with two different slices of code; the result is the 
same in either case (long after the function finishes).

Code slice 1:
check_output("true")

Code slice 2:
pTest = Popen("true", stdout=PIPE, stderr=PIPE)
pTest.wait()
pTest.stdout.close()
pTest.stderr.close()
del pTest
gc.collect()

I'm using Python v3.5.2-1 on Arch Linux; it was installed via the [extra] 
repository.  Let me know if you need any further information.

--
components: Library (Lib)
messages: 276514
nosy: Xavion
priority: normal
severity: normal
status: open
title: The 'subprocess' module leaks roughly 4 KiB of memory per call
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



[issue28099] Drop Mac OS X Tiger support in Python 3.6

2016-09-14 Thread Ned Deily

Changes by Ned Deily :


--
assignee:  -> ned.deily

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-09-14 Thread INADA Naoki

INADA Naoki added the comment:

This is the patch.
And git branch is here https://github.com/methane/cpython/pull/5

--
Added file: http://bugs.python.org/file44670/fastfuture.patch

___
Python tracker 

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



[issue28164] _PyIO_get_console_type fails for various paths

2016-09-14 Thread Eryk Sun

New submission from Eryk Sun:

_PyIO_get_console_type currently hard codes the names "CON", "CONIN$", and 
"CONOUT$" and doesn't use a case-insensitive comparison. For example, opening 
"conin$" doesn't get directed to WindowsConsoleIO:

>>> open('conin$', 'rb', buffering=0)
<_io.FileIO name='conin$' mode='rb' closefd=True>

unlike CONIN$:

>>> open('CONIN$', 'rb', buffering=0)
   <_io._WindowsConsoleIO mode='rb' closefd=True>

This also ignores the special handling of DOS devices in existing directories. 
The normal DOS-device check (i.e. if the parent directory exists, call 
GetFullPathName to normalize the path) isn't reliable, unfortunately. Prior to 
Windows 8, CreateFile special-cases parsing console paths by calling 
BaseIsThisAConsoleName, which has an annoying speed hack that makes it buggy. 
Ultimately the only way to know if a path opens the console is to open it and 
check the handle.

--
components: IO, Library (Lib), Windows
messages: 276512
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: test needed
status: open
title: _PyIO_get_console_type fails for various paths
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-14 Thread Ned Deily

Changes by Ned Deily :


--
priority: normal -> high
stage: needs patch -> patch review
versions: +Python 3.7

___
Python tracker 

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



[issue21337] Add tests for Tix

2016-09-14 Thread Zachary Ware

Zachary Ware added the comment:

Tix is now deprecated, extra tests are unnecessary.

--
resolution:  -> out of date
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



[issue28140] Attempt to give better errors for pip commands typed into the REPL

2016-09-14 Thread Nick Coghlan

Nick Coghlan added the comment:

Given that this can be done with just an excepthook change, I'm going to 
suggest we make the change for 3.5 and 2.7 as well.

--
versions: +Python 2.7, Python 3.5

___
Python tracker 

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



[issue28163] WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle

2016-09-14 Thread Eryk Sun

New submission from Eryk Sun:

WindowsConsoleIO fileno() gets a file descriptor on demand by calling 
_open_osfhandle. As a low I/O function this expects _open flags, but currently 
the code is passing 'rb' (int 0x7262) and 'wb' (int 0x7762). It should use 
_O_RDONLY | _O_BINARY and _O_WRONLY | _O_BINARY. 

Actually, _open_osfhandle isn't actually opening the file, so it only cares 
about a few flags. Specifically, in lowio\osfinfo.cpp I see that it looks for 
_O_APPEND, _O_TEXT, and _O_NOINHERIT. So in this case passing 0 for the flags 
would also be ok.

--
components: IO, Library (Lib), Windows
messages: 276509
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue28162] WindowsConsoleIO readall() fails if first line starts with Ctrl+Z

2016-09-14 Thread Eryk Sun

New submission from Eryk Sun:

For a console readall(), if the first line starts with '\x1a' (i.e. Ctrl+Z), it 
breaks out of its read loop before incrementing len. Thus the input isn't 
handled properly as EOF, for which the check requires len > 0. Instead it ends 
up calling WideCharToMultiByte with len == 0, which fails as follows:

>>> sys.stdin.buffer.raw.read()
^Z
Traceback (most recent call last):
  File "", line 1, in 
OSError: [WinError 87] The parameter is incorrect

--
components: IO, Library (Lib), Windows
messages: 276508
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: test needed
status: open
title: WindowsConsoleIO readall() fails if first line starts with Ctrl+Z
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue28140] Attempt to give better errors for pip commands typed into the REPL

2016-09-14 Thread Nick Coghlan

Nick Coghlan added the comment:

Paul Moore pointed out on distutils-sig that since this is mainly desired for 
the REPL, we can put the logic in the default excepthook rather than into the 
SyntaxError constructor the way we had to for "print" and "exec":

def excepthook(typ, value, traceback):
if typ is SyntaxError and "pip install" in value.text:
print("'pip install' found in supplied text")
print("Try running this from a system command prompt")
return
sys.__excepthook__(typ, value, traceback)

--
title: Attempt to give better errors for shell commands typed into the REPL -> 
Attempt to give better errors for pip commands typed into the REPL

___
Python tracker 

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



[issue28161] Opening CON for write access fails

2016-09-14 Thread Eryk Sun

New submission from Eryk Sun:

When opening the CON device the underlying CreateFile call needs to use either 
GENERIC_READ or GENERIC_WRITE access, but not both. Currently opening for 
writing fails as follows:

   >>> open('CON', 'wb', buffering=0)
   Traceback (most recent call last):
  File "", line 1, in 
   OSError: [WinError 87] The parameter is incorrect: 'CON'

If self->writable is true, it should set `access = GENERIC_WRITE`, not `access 
|= GENERIC_WRITE`.

This only applies to CON. It's normal to open CONIN$ and CONOUT$ with both read 
and write access, and WindowsConsoleIO handles that correctly.

--
components: IO, Library (Lib), Windows
messages: 276507
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: test needed
status: open
title: Opening CON for write access fails
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-09-14 Thread Yury Selivanov

Yury Selivanov added the comment:

> Implementing __del__ and __repr__ in C is bit hard task to me.
> I can't do it in this week. (maybe I can't do it in this month too.)

NP.  I'll take a look myself after you upload the next iteration of the patch...

--

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-09-14 Thread INADA Naoki

INADA Naoki added the comment:

I'm working on fixing points you commented.  Wait a minute.

Implementing __del__ and __repr__ in C is bit hard task to me.
I can't do it in this week. (maybe I can't do it in this month too.)

On Thu, Sep 15, 2016 at 7:37 AM, Yury Selivanov  wrote:
>
> Yury Selivanov added the comment:
>
> INADA, would you be able to address my last review comments?  Also, I'm 
> wondering what if we could implement __del__ and __repr__ in C too, so that 
> we could drop BaseFuture class?
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2016-09-14 Thread paul j3

paul j3 added the comment:

Clint, 'nargs=argparser.REMAINDER' ('...') may do what you want

p=argparse.ArgumentParser()
p.add_argument('--subscipt_args', nargs='...')
p.add_argument('pos',nargs='*')

p.parse_args('--subscipt_args --foo --bar --baz -- other args'.split())

produces

Namespace(pos=['other', 'args'], subscipt_args=['--foo', '--bar', '--baz'])

'REMAINDER' is like '*' except it takes everything.  But the '--' means 
'everything that follows is a positional argument, so it effectively ends the 
'REMAINDER'.  'REMAINDER' is documented (briefly), but I don't recall reading 
about its interaction with '--'.  I'm a little surprised that it wasn't 
mentioned earlier in this bug/issue.

'+...', argparse.PARSER is similar except it requires at least one argument.  
It is used by the 'subparsers' argument, to collect the cmd string and use all 
that follow as subparser arguments.

There is a bug issue (or two) about what should happen when there are more than 
one '--' argument.

--

___
Python tracker 

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



[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread INADA Naoki

INADA Naoki added the comment:

xiang is right. Python 3.5 has same issue when using popitem().
I'll make patch for 3.5.  But it will be bit differ from patch for 3.6 and they 
will conflict.

--

___
Python tracker 

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



[issue27906] Socket accept exhaustion during high TCP traffic

2016-09-14 Thread Guido van Rossum

Guido van Rossum added the comment:

(Of course I meant b2.)

--

___
Python tracker 

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



[issue28160] Python -V and --version output to stderr instead of stdout

2016-09-14 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report. This was already done in Python 3.4. See 
https://docs.python.org/dev/whatsnew/3.4.html#changes-in-python-command-behavior
 and issue 18338 for details. Backporting this to 2.7 would break backwards 
compatibility so that means we can't change the behavior of python -V in a 
bugfix release.

--
nosy: +berker.peksag
resolution:  -> rejected
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



[issue27906] Socket accept exhaustion during high TCP traffic

2016-09-14 Thread Yury Selivanov

Yury Selivanov added the comment:

> @Yury, do you think you could get to this before b1 goes out? It's a pure 
> optimization (and a good one!).

LGTM. Will commit tomorrow.

--
assignee:  -> yselivanov

___
Python tracker 

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



[issue27906] Socket accept exhaustion during high TCP traffic

2016-09-14 Thread Guido van Rossum

Guido van Rossum added the comment:

Sorry, we didn't get to this. @Yury, do you think you could get to this before 
b1 goes out? It's a pure optimization (and a good one!).

--

___
Python tracker 

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



[issue28160] Python -V and --version output to stderr instead of stdout

2016-09-14 Thread Yaron Goland

Yaron Goland added the comment:

To be fair it turns out that Java also outputs its version to stderr. Still 
seems wrong. It's not an error!

--

___
Python tracker 

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



[issue28160] Python -V and --version output to stderr instead of stdout

2016-09-14 Thread Yaron Goland

New submission from Yaron Goland:

When running python -V or --version the output goes to stderr instead of 
stdout. Unless python thinks its version is an err shouldn't the result go to 
stdout?

--
components: Macintosh
messages: 276496
nosy: Yaron Goland, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Python -V and --version output to stderr instead of stdout
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-14 Thread STINNER Victor

STINNER Victor added the comment:

Christian Heimes added the comment:
> The main reason for two different hash algorithms was missing support for
64bit integer types. Python 3.4 was targeting platforms that had no 64bit
integer support at all (IIRC SPARC). Nowaday Python requires 64bit ints to
compile.
>
> I'm all in favor to remove FVN2 and use SipHash24 on all platforms. Let's
deprecated it now and remove it in 3.7.

Python 3.5.0 doesn't compile if the compiler doesn't support 64 signed
integer: see pytime.h ;-)

Are you aware of platforms still using FVN2?

I'm also in favor of deprecating it. Maybe use #warning in C to log a
deprecation warning.

--

___
Python tracker 

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



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-09-14 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-09-14 Thread Yury Selivanov

Yury Selivanov added the comment:

INADA, would you be able to address my last review comments?  Also, I'm 
wondering what if we could implement __del__ and __repr__ in C too, so that we 
could drop BaseFuture class?

--

___
Python tracker 

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



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-09-14 Thread Yury Selivanov

Yury Selivanov added the comment:

I had to rewrite the patch to make sure it reports correct position and covers 
all cases where using async/await should trigger a warning.

Brett, could you please take a look at the patch?

--
Added file: http://bugs.python.org/file44669/issue_26182.patch

___
Python tracker 

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



[issue28130] Document that time.tzset updates time module globals

2016-09-14 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
title: Document that time.tzset updates time module constants -> Document that 
time.tzset updates time module globals

___
Python tracker 

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



[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2016-09-14 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
assignee: belopolsky -> 
priority: high -> 
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue28159] Deprecate isdst argument in email.utils.localtime

2016-09-14 Thread Alexander Belopolsky

New submission from Alexander Belopolsky:

With the implementation of PEP 495, email.utils.localtime() does not need the 
isdst argument to disambiguate naive time.  In fact the utility method itself 
is redundant given that astimezone() now works for naive instances.

--
components: Library (Lib)
messages: 276492
nosy: belopolsky, r.david.murray
priority: normal
severity: normal
status: open
title: Deprecate isdst argument in email.utils.localtime
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue25478] Consider adding a normalize() method to collections.Counter()

2016-09-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The pitfall I imagine here is that if you continue adding elements after 
normalize() is called, the results will be nonsensical.

--
nosy: +pitrou

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> I thought `[...]localtime_r()`'s way of ordering the arguments made most 
> sense here.

Right. I keep forgetting which one is localtime_r and which is localtime_s. I 
don't think there is any preference in the Python codebase. (PEP 8 is silent on 
this point.)

Use of time_t instead of time_t* makes it obvious which argument is input, so 
as I said, for me the order does not matter.  Google style guide is reason 
enough to pick the order.

--

___
Python tracker 

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



[issue28158] Implement LOAD_GLOBAL opcode cache

2016-09-14 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Ed Schouten

Ed Schouten added the comment:

I've been brainwashed by 
https://google.github.io/styleguide/cppguide.html#Function_Parameter_Ordering 
over the last couple of years, which is why I thought 
`localtime()/localtime_r()`'s way of ordering the arguments made most sense 
here. ;-)

--

___
Python tracker 

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



[issue28158] Implement LOAD_GLOBAL opcode cache

2016-09-14 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I see that you picked localtime_s-like order of arguments.  While I have no 
personal preference, I wonder why you prefer output to follow input.  The usual 
UNIX/C convention is the opposite.  Interfaces like sprintf, strcat, strftime 
and many other have output first.  I think the logic is that this is the order 
in variable assignment OUTPUT = INPUT.

--

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Very nice.  I'll give it a week or two for the others to chime in and commit if 
I don't hear any objections.

--
keywords: +patch
stage: patch review -> commit review
versions: +Python 3.7

___
Python tracker 

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



[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2016-09-14 Thread Clint Olsen

Clint Olsen added the comment:

I'm not sure if this is applicable to this bug, but one feature missing from 
argparse is the ability to snarf arbitrary options up to a terminating '--'. 
The purpose of this is to collect arguments for potential children you may 
spawn. An example:

--subscript_args --foo --bar --baz -- 

So, if you ran args = parser.parse_args()

args.subscript_args = [ '--foo', '--bar', '--baz' ]

Right now I have NO way of enabling this w/o writing my own argument parser, 
and I think it's bizarre that argparse can't do something like this.

And no, I don't want to pass a singly-quoted string to this so I don't have to 
manually split() the arguments which may or may not match what /bin/sh does.

Does this deserve it's own enhancement request?

--
nosy: +Clint Olsen

___
Python tracker 

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



[issue28158] Implement LOAD_GLOBAL opcode cache

2016-09-14 Thread Yury Selivanov

New submission from Yury Selivanov:

The attached patch implements an opcode cache for LOAD_GLOBAL opcode, making it 
2x faster.

The idea is to use the new co_extra field of code objects & PEP 509 to attach a 
cache structure pointing directly to the resolved global name.  When globals or 
builtins are updated, the cache is invalidated.

The patch adds a new file "ceval_cache.h" which provides some infrastructure to 
ease the pain of implementing new caches for other opcode types.  I can strip 
down all macros from that file if Victor finds it too hard to review.

Here's a simple script I used to make sure that the cache is working: 
https://gist.github.com/1st1/a9660aabdcf6b8bc6205b9fe39a82bba

You can also set OPCACHE_COLLECT_STATS to 1 to get debug stats output for the 
cache.

--
assignee: yselivanov
components: Interpreter Core
files: load_globals_cache.patch
keywords: patch
messages: 276485
nosy: gvanrossum, haypo, yselivanov
priority: critical
severity: normal
stage: patch review
status: open
title: Implement LOAD_GLOBAL opcode cache
type: performance
versions: Python 3.6
Added file: http://bugs.python.org/file44668/load_globals_cache.patch

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Ed Schouten

Ed Schouten added the comment:

Does this patch look all right to you?

--
Added file: http://bugs.python.org/file44667/patch-pytime-localtime-gmtime

___
Python tracker 

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



[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread INADA Naoki

Changes by INADA Naoki :


Added file: http://bugs.python.org/file44666/fix-28147.patch

___
Python tracker 

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



[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread INADA Naoki

INADA Naoki added the comment:

This issue is caused by dictresize() and _PyObjectDict_SetItem()

1. a.__dict__.pop('a') convert the dict to combined table which has double 
keysize.
2. a.a = 1  converts the dict to split table again if there are no instances 
sharing key with class.

As I wrote before, pop, popitem, and del should not increase key size.

And _PyObjectDict_SetItem shouldn't convert the dict to split-table when the 
dict doesn't share keys
with the class before calling PyDict_SetItem.

--

___
Python tracker 

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



[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread INADA Naoki

Changes by INADA Naoki :


Added file: http://bugs.python.org/file44665/fix-28147.patch

___
Python tracker 

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



[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread Xiang Zhang

Xiang Zhang added the comment:

> popitem() before does the same thing and should never cause a problem.

Ahh, this seems not true. Test it in py3.5 also crash.

--

___
Python tracker 

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



[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread Xiang Zhang

Xiang Zhang added the comment:

> I confirmed and investigated it.  Thanks!
I'll post patch including more test in 24 hours.

Please wait a second.

The cause of this problem is that attribute setting causes a combined table to 
be splitted (the code path is [0]->[1]->[2]->[3]). So every time you set an 
attribute and then pop, it will do dictresize(right now it will increase memory 
usage). So even if you make pop() not increase memory usage, the example Min 
gives will still do much work not wanted (dictresize and make_keys_shared).

Actually I think memory usage increasing is not a problem if other things are 
right. popitem() before does the same thing and should never cause a problem.
 
[0] https://hg.python.org/cpython/file/tip/Python/ceval.c#l2248
[1] https://hg.python.org/cpython/file/tip/Objects/object.c#l1119
[2] https://hg.python.org/cpython/file/tip/Objects/object.c#l1125
[3] https://hg.python.org/cpython/file/tip/Objects/object.c#l1172

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> Maybe we can just pick a prototype that's as Pythonesque as possible that 
> also fixes these shortcomings. Any thoughts?

Yes, and just call it _PyTime_localtime without the ugly suffix.

--

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Ed Schouten

Ed Schouten added the comment:

As a person who keeps a close eye on the Austin Group mailing lists (i.e., 'the 
POSIX working group'), my guess is that it's very unlikely that POSIX will ever 
add those *_s() extensions. Here's a discussion on Reddit that actually 
captures all of the arguments pretty well:

https://www.reddit.com/r/C_Programming/comments/3ivi77/eli5_why_does_glibc_still_not_support_the/

That said, any API will do. The localtime_r() function has the disadvantage 
that the return value is a bit odd: can it return any other tm structure than 
the one provided? localtime_s() is a bit weird in that its input argument is 
stored after the output argument. Both functions also unnecessarily pass the 
time_t by reference. Maybe we can just pick a prototype that's as Pythonesque 
as possible that also fixes these shortcomings. Any thoughts?

--

___
Python tracker 

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



[issue22799] wrong time.timezone

2016-09-14 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
superseder:  -> Document time module constants (timezone, tzname, etc.) as 
deprecated.

___
Python tracker 

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



[issue28157] Document time module constants (timezone, tzname, etc.) as deprecated.

2016-09-14 Thread Alexander Belopolsky

New submission from Alexander Belopolsky:

The time module defines timezone, altzone, tzname and daylight constants that 
store information about system timezone.  This information is derived  from the 
timezone rules that are in effect at the module loading time, but may be 
incorrect for the times in the past.  The documentation should warn the user 
about this and recommend using the tm_zone and tm_gmtoff attributes in the 
result of time.localtime() to obtain timezone information.  See #22799 and 
msg148208.

--
assignee: belopolsky
components: Documentation
messages: 276478
nosy: belopolsky
priority: normal
severity: normal
stage: needs patch
status: open
title: Document time module constants (timezone, tzname, etc.) as deprecated.
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



[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread INADA Naoki

INADA Naoki added the comment:

I confirmed and investigated it.  Thanks!
I'll post patch including more test in 24 hours.

--

___
Python tracker 

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



[issue22799] wrong time.timezone

2016-09-14 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Closing. See #22798 for the reasons why synchronizing C variables with the time 
module constants is not a solution.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue26669] time.localtime(float("NaN")) does not raise a ValueError on all platforms

2016-09-14 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
assignee:  -> belopolsky
nosy: +belopolsky
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> we should likely introduce full wrappers that have a name starting with 
> _PyTime_, right?


Yes, and I would like to give some thought to what the best API would be. The 
two choices are to emulate localtime_r on Windows or emulate localtime_s on 
POSIX. While localtime_r is probably a better known function, localtime_s has 
been standardized by C11 and may appear on POSIX platforms in the future.

Also, I think _PyTime_localtime_r/s should include the 

 #ifdef EINVAL
 if (errno == 0)
 errno = EINVAL;
 #endif

code that is repeated everywhere in the current codebase.

--

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Ed Schouten

Ed Schouten added the comment:

Hi Alexander,

I'm absolutely no expert when it comes to the Python codebase, so I've got a 
question. If we're going to movein this to Include/pytime.h, we should likely 
introduce full wrappers that have a name starting with _PyTime_, right?

This header seem to be part of the installation, so we should likely not 
declare any commonly used symbols there.

--

___
Python tracker 

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



[issue16384] import.c doesn't handle EOFError from PyMarshal_Read*

2016-09-14 Thread Sye van der Veen

Sye van der Veen added the comment:

I would also agree that failing to load the main codec should be an abort.  
This bug was specifically the race condition in writing the .pyc file.

Thanks for all your help!

--

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Yes, I think this is a good idea.  I was hesitant to make this change while 
#22798 was open because I thought we may end up exposing changes to tzname 
caused by localtime and friends.

I also believe we can classify this as a bug-fix because side-effects of 
localtime are often undesirable.  Nevertheless, I would like to hear from more 
people before accepting this.

--
assignee:  -> belopolsky
nosy: +akira, belopolsky, haypo, lemburg, pitrou, tim.peters
stage:  -> patch review
type:  -> behavior

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> What would be the right location for [the Windows wrappers]?

I would say Include/pytime.h:

/**
Symbols and macros to supply platform-independent interfaces to time related
functions and constants
**/

--

___
Python tracker 

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



[issue28156] [Patch] posixmodule: Make the presence of os.getpid() optional

2016-09-14 Thread Ed Schouten

New submission from Ed Schouten:

CloudABI (https://mail.python.org/pipermail/python-dev/2016-July/145708.html) 
does not provide getpid(). Though this may sound quite silly at first, there is 
quite a good reason for this. One of the things that CloudABI wants to achieve 
is making large scale (cluster/cloud) computing easier. In such an environment 
there is rarely a need for having machine-local unique process identifiers. 
They have to be globally unique and preferably not recycled.

POSIX requires that pid_t is a signed integer that must have a positive value. 
Most C compilers only provide full support for integers up to 64 bits in size. 
This means that CloudABI could only provide 63-bit process identifiers, which 
is far smaller than, say, a UUID. For this reason we've decided to omit 
getpid() altogether.

Attached is a patch that makes use of the already existing HAVE_GETPID 
definition in pyconfig.h to disable the os.getpid() function that is part of 
the posixmodule.

--
components: Extension Modules
files: patch-no-getpid
messages: 276470
nosy: EdSchouten
priority: normal
severity: normal
status: open
title: [Patch] posixmodule: Make the presence of os.getpid() optional
versions: Python 3.6
Added file: http://bugs.python.org/file44664/patch-no-getpid

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Ed Schouten

Changes by Ed Schouten :


--
title: Also stop using localtime() in timemodule -> [Patch] Also stop using 
localtime() in timemodule

___
Python tracker 

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



[issue28155] Small typo in Json docs

2016-09-14 Thread Zachary Ware

Zachary Ware added the comment:

See 05e8b25379a3, though; it may be worth a backport.  Not to 3.3, though; it's 
docs are not being updated anymore.

--
nosy: +zach.ware
versions:  -Python 3.3

___
Python tracker 

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



[issue28155] Small typo in Json docs

2016-09-14 Thread SilentGhost

Changes by SilentGhost :


--
status: open -> closed

___
Python tracker 

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



[issue28155] Small typo in Json docs

2016-09-14 Thread SilentGhost

SilentGhost added the comment:

The space between -m switch and module name is not mandatory as you should be 
able to see if you run those examples.

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

___
Python tracker 

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



[issue28155] Small typo in Json docs

2016-09-14 Thread Андрей Морозько

New submission from Андрей Морозько:

In Json module, example titled "Using json.tool from the shell to validate and 
pretty-print:"
5th line reads:
echo '{1.2:3.4}' | python -mjson.tool
should
echo '{1.2:3.4}' | python -m json.tool

--
assignee: docs@python
components: Documentation
messages: 276467
nosy: docs@python, Андрей Морозько
priority: normal
severity: normal
status: open
title: Small typo in Json docs
type: enhancement
versions: Python 2.7, Python 3.3

___
Python tracker 

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



[issue28154] Core dump after importing lxml in Python3.6b

2016-09-14 Thread Filip Stefanov

Filip Stefanov added the comment:

My source was out of date... You are right now is working fine 
Sorry for the time wasted. :)

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

___
Python tracker 

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



[issue28114] parse_envlist(): os.execve(), os.spawnve(), etc. crash in Python 3.6.0 when env contains byte strings

2016-09-14 Thread Berker Peksag

Berker Peksag added the comment:

Eryk's patch looks good to me, thanks! I will wait for others to review the 
patch.

--

___
Python tracker 

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



[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-14 Thread Steve Dower

Steve Dower added the comment:

> They might get a tiny bit faster on Windows, if they have used Py_MEMCPY() 
> for up to 16 bytes

Even that's unlikely as the loop in the macro would have been unrolled in 
practically every case.

This is about removing an unnecessary macro. Certainly no API change unless we 
delete it entirely (which I'm okay with), and IMHO if it has an issue number it 
should go in NEWS. Maybe build is the right section?

--

___
Python tracker 

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



[issue28114] parse_envlist(): os.execve(), os.spawnve(), etc. crash in Python 3.6.0 when env contains byte strings

2016-09-14 Thread Eryk Sun

Changes by Eryk Sun :


Added file: http://bugs.python.org/file44663/issue_28114_03.patch

___
Python tracker 

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



[issue28153] [Patch] selectmodule: Make kqueue()'s event filters optional

2016-09-14 Thread Berker Peksag

Berker Peksag added the comment:

Thanks!

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> behavior
versions: +Python 3.7

___
Python tracker 

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



[issue28153] [Patch] selectmodule: Make kqueue()'s event filters optional

2016-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 57ff729e923f by Berker Peksag in branch '3.6':
Issue #28153: Make kqueue()'s event filters optional
https://hg.python.org/cpython/rev/57ff729e923f

New changeset 6c5f9c6c25ea by Berker Peksag in branch 'default':
Issue #28153: Merge from 3.6
https://hg.python.org/cpython/rev/6c5f9c6c25ea

--
nosy: +python-dev

___
Python tracker 

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



[issue28154] Core dump after importing lxml in Python3.6b

2016-09-14 Thread Christian Heimes

Christian Heimes added the comment:

I can't reproduce the problem with the latest checkout of Python 3.6. The crash 
might have been caused by #28120. Can you try again with a refresh checkout 
from hg.python.org?

--

___
Python tracker 

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



[issue28154] Core dump after importing lxml in Python3.6b

2016-09-14 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue28154] Core dump after importing lxml in Python3.6b

2016-09-14 Thread Filip Stefanov

New submission from Filip Stefanov:

fstefanov@lin-0360: ~/bin/python/vm/python3.6b/bin 
$ python

Python 3.6.0b1 (default, Sep 14 2016, 11:15:36) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import lxml as xxl
*** Error in `python': free(): invalid pointer: 0x7f65d052b258 ***
Aborted (core dumped)
(python3.6b) 

$ pip list | grep lxml
lxml (3.6.4)

--
components: Interpreter Core
messages: 276460
nosy: philip.stefanov
priority: normal
severity: normal
status: open
title: Core dump after importing lxml in Python3.6b
type: crash
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



[issue28153] [Patch] selectmodule: Make kqueue()'s event filters optional

2016-09-14 Thread Ed Schouten

New submission from Ed Schouten:

Just like the BSDs and Mac OS X, CloudABI 
(https://mail.python.org/pipermail/python-dev/2016-July/145708.html) provides 
support for kqueue(). Its implementation, however, is far more limited. It can 
only be used for polling on descriptors (EVFILT_READ/EVFILT_WRITE) and waiting 
on timers (EVFILT_TIMER).

The existing selectmodule already allows some filters to be present optionally 
(e.g., EVFILT_NETDEV). The attached patch extends this work by only defining 
the filter and corresponding filter flags when available.

I've also added guards around EV_SYSFLAGS and EV_FLAG1. EV_SYSFLAGS is a flag 
that's typically only used by the kernel to trim off flags that are only used 
internally. EV_FLAG1 is an example of such a flag, which seems to be used by 
FreeBSD to mark incoming AIO events as validated. I would even go as far as to 
remove these two flags from the module entirely, but let's not take the risk.

--
components: Extension Modules
files: patch-kqueue-EVFILT
messages: 276459
nosy: EdSchouten
priority: normal
severity: normal
status: open
title: [Patch] selectmodule: Make kqueue()'s event filters optional
versions: Python 3.6
Added file: http://bugs.python.org/file44662/patch-kqueue-EVFILT

___
Python tracker 

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



[issue28135] assertRaises should return the exception in its simple form

2016-09-14 Thread R. David Murray

R. David Murray added the comment:

This has been proposed and rejected several times before.

IMO, a strong reason to reject it is that no other assert methods return 
values.  Consistency is important.

Also note that cm survives the context manager, so you don't need that 
assignment statement.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> unittest.assertRaises() return the raised exception

___
Python tracker 

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



[issue28114] parse_envlist(): os.execve(), os.spawnve(), etc. crash in Python 3.6.0 when env contains byte strings

2016-09-14 Thread Eryk Sun

Eryk Sun added the comment:

Thanks for the spawn test framework, Victor. I've added a use_bytes argument to 
encode the args and env using os.fsencode. It's encoding args as well because 
parse_arglist calls fsconvert_strdup, which was assuming Unicode strings on 
Windows instead of first calling PyUnicode_FSDecoder. test_spawnve_bytes passes 
for me on Linux and Windows.

--
Added file: http://bugs.python.org/file44661/issue_28114_02.patch

___
Python tracker 

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



[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread Min RK

Min RK added the comment:

I pulled just now and saw changes in dictobject.c, and just wanted to confirm 
the memory growth bug is still in changeset 56294e03ad89 (I think I used the 
right hash, this time).

--

___
Python tracker 

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



[issue28145] Fix whitespace in C source code

2016-09-14 Thread R. David Murray

R. David Murray added the comment:

A while ago Antoine fixed the leading tabs throughout the C source, after 
considerable debate about it.  So we've been down this road before.  Since I 
don't touch the C code often, I don't really have an opinion on this one way or 
the other :)

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



[issue28135] assertRaises should return the exception in its simple form

2016-09-14 Thread Raymond Hettinger

Raymond Hettinger added the comment:

-0 This doesn't feel Pythonic to me.

--
nosy: +rhettinger

___
Python tracker 

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



[issue28143] ASDL compatibility with Python 3 system interpreter

2016-09-14 Thread R. David Murray

R. David Murray added the comment:

It's probably not a bad thing to fix this, but you should be able to avoid the 
problem by using 'make touch' before building.  It should not be necessary to 
have a running python to build python; all the build artifacts are checked in.  
Specifically, the release tarballs should build without an existing python, and 
if they don't, that's a release packaging problem.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue23147] Possible error in _header_value_parser.py

2016-09-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> test needed
versions: +Python 3.6, Python 3.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



[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread Min RK

Min RK added the comment:

> Ah, is the leak happen in 3.6b1?

The leak happens in 3.6b1 and master as of an hour ago (git: 
3c06edfe9463f1cf81bc34b702f165ad71ff79b8, hg:r103797)

--
title: Memory leak in new 3.6 dictionary resize -> Unbounded memory growth 
resizing split-table dicts

___
Python tracker 

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



[issue23148] Missing the charset parameter in as_encoded_word()

2016-09-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> test needed
versions: +Python 3.7

___
Python tracker 

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



[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread STINNER Victor

STINNER Victor added the comment:

> According to 
> https://www.python.org/dev/peps/pep-0412/#split-table-dictionaries 
> `obj.__dict__` is always a split-table dict.

Hum, this PEP is now probably outdated since Python 3.6 beta 1 :-)

--

___
Python tracker 

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



[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread Min RK

Min RK added the comment:

> dictresize() is called for converting split table to combined table.
> How is it triggered many times?

every `self.__dict__.pop` triggers a resize. According to 
https://www.python.org/dev/peps/pep-0412/#split-table-dictionaries 
`obj.__dict__` is always a split-table dict. I do not understand the dict 
implementation enough to say precisely why, but `pop` forces a recombine via 
`resize` because split-table dicts don't support deletion. In `dict_resize`, 
due to a `<=minused` condition, the size is guaranteed to at least double every 
time `dict_resize` is called. It would appear that after this, `__dict__` is 
again forced to be a split-table dict, though I'm not sure how or where this 
happens, but good old-fashioned printf debugging shows that `dict_resize` is 
called for every `__dict__.pop` because _PyDict_HasSplitTable is true every 
time pop is called.


> In your test code, which loop cause leak? new instance loop or re-use 
> instance loop?

Both loops cause the leak. If the `pop_attr()` is not in `__init__`, then only 
the re-used instance has the leak. if `pop_attr` is in `__init__`, then it 
happens across instances as well. I will try to add more comments in the code 
to make this clearer.

Does anyone have a handy way to create a split-table dict other than on 
`obj.__dict__`?


> Please add an unit test which triggers the memory leak

I should not have used the term memory leak, and have updated the title to be 
more precise. It is not memory allocated without a corresponding free, instead 
it is unbounded growth of the memory owned by a split-table dict. Cleaning up 
the object does indeed clean up the memory associated with it. The included 
test exercises the bug with several iterations. Running the test several times 
with only one iteration would not exercise the bug.

--

___
Python tracker 

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



[issue28145] Fix whitespace in C source code

2016-09-14 Thread Mark Dickinson

Mark Dickinson added the comment:

It's also worth noting that "make patchcheck", which we're encouraged to use by 
the Python developer's guide, autofixes these whitespace issues. I find that 
somewhat annoying, since "make patchcheck" makes changes unrelated to the patch 
I'm committing, which I then have to manually undo. But if the codebase were 
clean with respect to these whitespace issues, that wouldn't be a problem.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue28152] Clang warnings: code will never be executed

2016-09-14 Thread STINNER Victor

New submission from STINNER Victor:

The issue #23545 enabled extra warnings on GCC. Clang on FreeBSD now complains 
about unreachable (dead) code:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Non-Debug%203.x/builds/281/steps/compile/logs/warnings%20%2814%29

Python/ast.c:3133:5: warning: code will never be executed [-Wunreachable-code]
Modules/posixmodule.c:10256:5: warning: code will never be executed 
[-Wunreachable-code]
Modules/zipimport.c:1004:22: warning: code will never be executed 
[-Wunreachable-code]
Modules/faulthandler.c:988:5: warning: code will never be executed 
[-Wunreachable-code]

See also my change ea00c88f7f42 which fixed a similar issue in Parser/grammar.c.

See also the issue #14656.

--
messages: 276448
nosy: benjamin.peterson, haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Clang warnings: code will never be executed
versions: Python 3.7

___
Python tracker 

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



[issue27599] Buffer overrun in binascii

2016-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 423ad3b14ee1 by Serhiy Storchaka in branch '3.5':
Issue #27599: Fixed buffer overrun in binascii.b2a_qp() and binascii.a2b_qp().
https://hg.python.org/cpython/rev/423ad3b14ee1

New changeset fbc579ec36ab by Serhiy Storchaka in branch '2.7':
Issue #27599: Fixed buffer overrun in binascii.b2a_qp() and binascii.a2b_qp().
https://hg.python.org/cpython/rev/fbc579ec36ab

New changeset d53e1a5576e6 by Serhiy Storchaka in branch '3.6':
Issue #27599: Fixed buffer overrun in binascii.b2a_qp() and binascii.a2b_qp().
https://hg.python.org/cpython/rev/d53e1a5576e6

New changeset 56294e03ad89 by Serhiy Storchaka in branch 'default':
Issue #27599: Fixed buffer overrun in binascii.b2a_qp() and binascii.a2b_qp().
https://hg.python.org/cpython/rev/56294e03ad89

--
nosy: +python-dev

___
Python tracker 

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



[issue27599] Buffer overrun in binascii

2016-09-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7

___
Python tracker 

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



[issue28145] Fix whitespace in C source code

2016-09-14 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Well, it's trading one person's style for the PEP7 official style, so it's not 
completely arbitrary.

That said, I'm not sure it's justifiable to apply to the entire historic code 
base; my impression was that PEP7 was not intended to be applied retroactively 
in bulk, per the second reason not to obey a rule:

"To be consistent with surrounding code that also breaks it (maybe for historic 
reasons) -- although this is also an opportunity to clean up someone else's 
mess (in true XP style)."

--
nosy: +josh.r

___
Python tracker 

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



[issue28151] testPythonOrg() of test_robotparser fails on validating python.org HTTPS certificate

2016-09-14 Thread Berker Peksag

Berker Peksag added the comment:

Note that I'm planning to rewrite the test to use pythontest.net.

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



[issue28099] Drop Mac OS X Tiger support in Python 3.6

2016-09-14 Thread STINNER Victor

STINNER Victor added the comment:

The "x86 Tiger 3.6" and "x86 Tiger 3.x" buildbots currently fail to compile 
Python:

* http://buildbot.python.org/all/builders/x86%20Tiger%203.6
* http://buildbot.python.org/all/builders/x86%20Tiger%203.x

--

___
Python tracker 

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



[issue28151] testPythonOrg() of test_robotparser fails on validating python.org HTTPS certificate

2016-09-14 Thread STINNER Victor

New submission from STINNER Victor:

The "x86 Windows7 3.x" buildbot fails to validate python.org HTTPS certificate.

The unit test uses the clear text HTTP URL, but 
http://www.python.org/robots.txt returns "301 Moved Permanently" with the new 
link: https://www.python.org/robots.txt

Firefox sees the cert as valid on my Fedora 24.

Firefox tells me that the cert organization (O) is "Python Software Foundation" 
and it was emitted by (CN) "DigiCert SHA2 Extended Validation Server CA", (O) 
"DigiCert Inc", (OU) "www.digicert.com".

Does this buildbot lack DigitCert root CA?

http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/11636/steps/test/logs/stdio

==
ERROR: testPythonOrg (test.test_robotparser.NetworkTestCase)
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\http\client.py", 
line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\http\client.py", 
line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\http\client.py", 
line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\http\client.py", 
line 1026, in _send_output
self.send(msg)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\http\client.py", 
line 964, in send
self.connect()
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\http\client.py", 
line 1400, in connect
server_hostname=server_hostname)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\ssl.py", 
line 401, in wrap_socket
_context=self, _session=session)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\ssl.py", 
line 808, in __init__
self.do_handshake()
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\ssl.py", 
line 1061, in do_handshake
self._sslobj.do_handshake()
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\ssl.py", 
line 683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed 
(_ssl.c:747)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_robotparser.py",
 line 280, in testPythonOrg
parser.read()
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\robotparser.py",
 line 58, in read
f = urllib.request.urlopen(self.url)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 223, in urlopen
return opener.open(url, data, timeout)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 532, in open
response = meth(req, response)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 642, in http_response
'http', request, response, code, msg, hdrs)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 564, in error
result = self._call_chain(*args)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 504, in _call_chain
result = func(*args)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 756, in http_error_302
return self.parent.open(new, timeout=req.timeout)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 526, in open
response = self._open(req, data)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 544, in _open
'_open', req)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 504, in _call_chain
result = func(*args)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 1320, in do_open
raise URLError(err)
urllib.error.URLError: 

--
components: Tests
messages: 276442
nosy: christian.heimes, haypo
priority: normal
severity: normal
status: open
title: testPythonOrg() of test_robotparser fails on validating python.org HTTPS 
certificate
versions: Python 3.7

___
Python tracker 

[issue28151] testPythonOrg() of test_robotparser fails on validating python.org HTTPS certificate

2016-09-14 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +buildbot
nosy: +zach.ware

___
Python tracker 

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



[issue28144] Decrease empty_keys_struct's dk_refcnt

2016-09-14 Thread INADA Naoki

INADA Naoki added the comment:

Nice catch!

--

___
Python tracker 

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



[issue28151] testPythonOrg() of test_robotparser fails on validating python.org HTTPS certificate

2016-09-14 Thread STINNER Victor

STINNER Victor added the comment:

A workaround is to catch the ssl.SSLError and skip the unit test...

Another fix is to avoid completely network connection to the Internet and only 
uses the temporary HTTP server used by other unit tests.

--

___
Python tracker 

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



[issue28125] identify cross builds by a more generic environment setting.

2016-09-14 Thread STINNER Victor

STINNER Victor added the comment:

@Matthias Klose: I concur with Xavier, can you please behave as a professional 
and "keep exchanges on the bug tracker strictly on a technical level"? Personal 
attacks doesn't help us to contribute with you.

I didn't follow the discussion, but I'm sure that we can find a solution with 
work for all use cases: multiarch, cross compilation, etc.

--

___
Python tracker 

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



[issue15369] pybench and test.pystone poorly documented

2016-09-14 Thread STINNER Victor

STINNER Victor added the comment:

> I'd also like to request that you reword this dismissive line in the 
> performance package's readme: (...)

Please report issues of the performance module on its own bug tracker:
https://github.com/python/performance

Can you please propose a new description? You might even create a pull
request ;-)

Note: I'm not sure that we should keep pybench, this benchmark really
looks unreliable. But I should still try at least to use the same
number of iterations for all worker child processes. Currently the
calibration is done in each child process.

--

___
Python tracker 

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



[issue28125] identify cross builds by a more generic environment setting.

2016-09-14 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> please try to build extension modules with mismatching abi flags (pydebug is 
> the
relevant one). Post your results for both mismatch cases.

Hum, you are claiming that there is a problem with mismatching abi flags but 
don't care to explain why or to demonstrate the problem, and asking instead 
that it should be proven by someone else running a test that you are right...

Anyway, you are mistaken. The cross-compilation of Android with 'pydebug' set, 
using a native interpreter built without 'pydebug' gives the following results:

The native interpreter:
[xavier@bilboquet python-native]$ ./python
Python 3.7.0a0 (default:879bde95a456+, Sep 13 2016, 18:59:47) 
[GCC 6.1.1 20160707] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.abiflags
'm'

The Android interpreter built with this native interpreter:
root@generic_x86:/data/data/org.bitbucket.pyona # python
Python 3.7.0a0 (default:879bde95a456+, Sep 14 2016, 14:53:50) 
[GCC 4.2.1 Compatible Clang 3.8.243773 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.abiflags
'dm'
>>> import _socket
>>> _socket.__file__
'/data/data/org.bitbucket.pyona/python/lib/python3.7/lib-dynload/_socket.cpython-37dm-i686-linux-android.so'

--

___
Python tracker 

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



  1   2   >