[issue26415] Out of memory, trying to parse a 35MB dict

2016-02-25 Thread A. Skrobov

A. Skrobov added the comment:

Yes, I understand that this is a matter of memory consumption, which is why I 
submitted this ticket as "resource usage".
What I don't understand is, what could possibly require gigabytes of memory for 
this task?

--

___
Python tracker 

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



[issue24421] Race condition compiling Modules/_math.c

2016-02-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d4190ed586a4 by Martin Panter in branch '2.7':
Issue #24421: Compile _math.c separately to avoid race condition
https://hg.python.org/cpython/rev/d4190ed586a4

--

___
Python tracker 

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



[issue26390] hashlib's pbkdf2_hmac documentation "rounds" does not match source

2016-02-25 Thread Martin Panter

Changes by Martin Panter :


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

___
Python tracker 

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



[issue26390] hashlib's pbkdf2_hmac documentation "rounds" does not match source

2016-02-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7609aaf180b4 by Martin Panter in branch '3.5':
Issue #26390: Fix and test pbkdf2_hmac() parameter names
https://hg.python.org/cpython/rev/7609aaf180b4

New changeset a74420677e6b by Martin Panter in branch 'default':
Issue #26390: Merge pbkdf2_hmac() doc from 3.5
https://hg.python.org/cpython/rev/a74420677e6b

--
nosy: +python-dev

___
Python tracker 

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



[issue24421] Race condition compiling Modules/_math.c

2016-02-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a99580157968 by Martin Panter in branch '3.5':
Issue #24421: Compile _math.c separately to avoid race condition
https://hg.python.org/cpython/rev/a99580157968

--

___
Python tracker 

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



[issue26439] ctypes.util.find_library fails ALWAYS when gcc is not used

2016-02-25 Thread Michael Felt

Michael Felt added the comment:

FYI: getting objdump is not too hard...

root@x064:[/data/prj/gnu/binutils-2.25.1]v/null /usr/lib/libcrypto.a <
In archive /usr/lib/libcrypto.a:

libcrypto.so: file format aixcoff-rs6000


libcrypto.so.0.9.8: file format aixcoff-rs6000


libcrypto.so.1.0.0: file format aixcoff-rs6000


libcrypto64.so: file format aix5coff64-rs6000


libcrypto64.so.0.9.8: file format aix5coff64-rs6000


libcrypto64.so.1.0.0: file format aix5coff64-rs6000

But ldconfig (as a command within glibc) will be a real headache - and I would 
home unnecessary.

In closing, I hope the AIX command /usr/bin/dump will be adequate as an 
alternative of objdump.

Where I am still a bit lost is with the "open", i.e. _dlopen(). 
Suggestions/hints for debugging are welcome.

--

___
Python tracker 

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



[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-02-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

'import tkinter; tkinter.messagebox' should also fail, but currently work in 
IDLE.  See 
https://stackoverflow.com/questions/35619027/sub-import-issues-with-tkinter-messagebox,
 and my answer there.

--

___
Python tracker 

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



[issue26441] email.charset: to_splittable and from_splittable are not there anymore!

2016-02-25 Thread Martin Panter

New submission from Martin Panter:

In /Doc/library/email.charset.rst, the descriptions of the to_splittable() and 
from_splittable() methods are disabled. The comment saying they are not there 
is presumably referring to the fact that the methods were removed from the 
Python 3 implementation. They were removed in r57697, and the documentation was 
adjusted in revision f65de36f185c.

Perhaps the two descriptions should just be deleted from the documentation?

--
components: email
messages: 260883
nosy: barry, martin.panter, r.david.murray
priority: normal
severity: normal
status: open
title: email.charset: to_splittable and from_splittable are not there anymore!
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue26431] string template substitute tests

2016-02-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue26431] string template substitute tests

2016-02-25 Thread Greg McCoy

Greg McCoy added the comment:

My Mistake, I wasn't running coverage on all the tests

--

___
Python tracker 

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



[issue26435] Fix versionadded/versionchanged documentation directives

2016-02-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1f8dc6f2b171 by Georg Brandl in branch '3.5':
Closes #26435: fix syntax in directives. Thanks to Jakub Stasiak.
https://hg.python.org/cpython/rev/1f8dc6f2b171

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



[issue26435] Fix versionadded/versionchanged documentation directives

2016-02-25 Thread Georg Brandl

Georg Brandl added the comment:

Ok, that was a bug in rstlint. Fixed now - and now I can find quite a few 
instances, will fix them (most of them are in this patch).

--

___
Python tracker 

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



[issue26435] Fix versionadded/versionchanged documentation directives

2016-02-25 Thread Georg Brandl

Georg Brandl added the comment:

These are interpreted as comments by docutils. "make suspicious" only checks 
for markup erroneously remaining in the output. "make check", which runs 
tools/rstlint.py, should pick them up though.

--
nosy: +georg.brandl

___
Python tracker 

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



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

2016-02-25 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

We discussed truncation vs. rounding some time ago.  See msg202270 and the 
posts around it.  The consensus was the same as Guido's current advise: do the 
truncation.

--

___
Python tracker 

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



[issue26437] asyncio create_server() not always accepts the 'port' parameter as str

2016-02-25 Thread Guido van Rossum

Guido van Rossum added the comment:

I don't know why it used to accept a string port, but I can't find anything in 
the docs indicating that is acceptable. I am guessing the doc authors assumed 
it was so obvious that a port is an integer they forgot to mention it.

I can guess that in the past some system API was used that considered the port 
a "servname" to be looked up in /etc/services (likely the getaddrinfo() call).

But if you were passing '12345' instead of 12345, well, you always had a latent 
bug in your program.

I don't think the code ought to be adjusted to explicitly reject string ports; 
but I do think the docs should be clarified on the issue.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python

___
Python tracker 

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



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

2016-02-25 Thread Guido van Rossum

Guido van Rossum added the comment:

Out of context here, but regarding round vs. truncate, IIUC for time
truncating down is the norm. My digital clock shows "12:00" for the
duration of the minute starting at noon. People look for clocks to
flip to know when it is exactly a given time (if the clock is accurate
enough).

--

___
Python tracker 

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



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

2016-02-25 Thread Alessandro Cucci

Alessandro Cucci added the comment:

Oh, now I see your point.

I've uploaded a new patch with a note for that.

--
Added file: http://bugs.python.org/file42031/issue19475_v16.patch

___
Python tracker 

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



[issue26415] Out of memory, trying to parse a 35MB dict

2016-02-25 Thread Eryk Sun

Eryk Sun added the comment:

> My Python is 64-bit, but my computer only has 2GB physical RAM.

That explains why it takes half an hour to crash. It's thrashing on page 
faults. Adding another paging file or increasing the size of your current 
paging file should allow this to finish parsing... eventually in maybe an hour 
or two. 

The design of the parser isn't something I've delved into very much, but 
possibly the dynamic nature of Python prevents optimizing the memory footprint 
here. Or maybe no one has seen the need to optimize parsing containers (dicts, 
sets, lists, tuples) that have constant literals. This is an inefficient way to 
store 35 MiB of data, as opposed to XML, JSON, or a binary format.

--

___
Python tracker 

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



[issue26436] Add the regex-dna benchmark

2016-02-25 Thread Brett Cannon

Brett Cannon added the comment:

Oh, and how long does an execution take?

--

___
Python tracker 

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



[issue26436] Add the regex-dna benchmark

2016-02-25 Thread Brett Cannon

Brett Cannon added the comment:

I assume the code looks idiomatic to you?

And out of curiosity, what does the performance look like between something 3.5 
and default?

--

___
Python tracker 

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



[issue26404] socketserver context manager

2016-02-25 Thread Aviv Palivoda

Aviv Palivoda added the comment:

updated the patch according to the CR comments.

--
Added file: http://bugs.python.org/file42030/socketserver_context_manager4.patch

___
Python tracker 

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



[issue26415] Out of memory, trying to parse a 35MB dict

2016-02-25 Thread A. Skrobov

A. Skrobov added the comment:

My Python is 64-bit, but my computer only has 2GB physical RAM.

--

___
Python tracker 

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



[issue26402] Regression in Python 3.5 xmlrpc.client, raises RemoteDisconnected seemingly randomly.

2016-02-25 Thread Jelte Fennema

Jelte Fennema added the comment:

No problem, I'm glad to have contributed something to the language I use the 
most.

--

___
Python tracker 

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



[issue26415] Out of memory, trying to parse a 35MB dict

2016-02-25 Thread Eryk Sun

Eryk Sun added the comment:

I don't think this is Windows related. Are you using 32-bit Python? On Linux, 
if I limit the process address space to 2 gigs, it crashes almost immediately:

$ ulimit -v 200
$ python-dbg -c 'import crash'
Segmentation fault

It runs out of memory while parsing the file:

Program received signal SIGSEGV, Segmentation fault.
0x0048ecb4 in PyObject_Malloc (nbytes=72) at 
../Objects/obmalloc.c:932
932 ../Objects/obmalloc.c: No such file or directory.
(gdb) bt
#0  0x0048ecb4 in PyObject_Malloc (nbytes=72) at 
../Objects/obmalloc.c:932
#1  0x0048f8be in _PyObject_DebugMallocApi (id=111 'o', nbytes=40) 
at ../Objects/obmalloc.c:1469
#2  0x0048fa2b in _PyObject_DebugReallocApi (api=111 'o', p=0x0, 
nbytes=40) at ../Objects/obmalloc.c:1520
#3  0x0048f83c in _PyObject_DebugRealloc (p=0x0, nbytes=40) at 
../Objects/obmalloc.c:1441
#4  0x00418a02 in PyNode_AddChild (n1=0x7fff85cbffb8, type=318, 
str=0x0, lineno=1, col_offset=6446977)
at ../Parser/node.c:98
#5  0x00418f53 in push (s=0xa6b680, type=318, d=0x8bfc70 
, newstate=1, lineno=1, col_offset=6446977)
at ../Parser/parser.c:126
#6  0x0041946c in PyParser_AddToken (ps=0xa6b680, type=262144, 
str=0x7fff85cba720 "11", lineno=1, 
col_offset=6446977, expected_ret=0x7fffd324) at 
../Parser/parser.c:252
#7  0x00419f19 in parsetok (tok=0xa5f650, g=0x8c0ac0 
<_PyParser_Grammar>, start=257, err_ret=0x7fffd300, 
flags=0x7fffd2ec) at ../Parser/parsetok.c:198
#8  0x00419cb6 in PyParser_ParseFileFlagsEx (fp=0xa19b70, 
filename=0xa53b00 "crash.py", 
g=0x8c0ac0 <_PyParser_Grammar>, start=257, ps1=0x0, ps2=0x0, 
err_ret=0x7fffd300, flags=0x7fffd2ec)
at ../Parser/parsetok.c:106

--
components:  -Windows
nosy: +eryksun

___
Python tracker 

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



[issue26440] tarfile._FileInFile.seekable is broken in stream mode

2016-02-25 Thread Bill Lee

Bill Lee added the comment:

I posted an incomplete traceback by mistake. Here is the whole traceback.

Traceback
=
Traceback (most recent call last):
  File "seekable.py", line 5, in 
print(contentFile.seekable())
  File "/usr/local/lib/python3.5/tarfile.py", line 649, in seekable
return self.fileobj.seekable()
AttributeError: '_Stream' object has no attribute 'seekable'

--

___
Python tracker 

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



[issue26440] tarfile._FileInFile.seekable is broken in stream mode

2016-02-25 Thread Bill Lee

New submission from Bill Lee:

Description
===
With a file object, retrieved by the `extractfile` method of a TarFile object 
opened in stream mode, calling its `seekable` method will raise an 
AttributeError.

How to Reproduce

cat > seekable.py << EOF
import sys
import tarfile
tar = tarfile.open(fileobj=sys.stdin.buffer, mode='r|')
contentFile = tar.extractfile(tar.next())
print(contentFile.seekable())
EOF

tar -cf test.tar seekable.py
python seekable.py < test.tar


Traceback
=
Traceback (most recent call last):
  File "seekable.py", line 5, in 
print(contentFile.seekable())
  File "/usr/local/lib/python3.5/tarfile.py", line 649, in seekable
return self.fileobj.seekable()

How to Fix
==
I think that adding a method seekable(), which always return False, to 
tarfile._Stream will works.

--
components: Library (Lib)
messages: 260866
nosy: Bill Lee
priority: normal
severity: normal
status: open
title: tarfile._FileInFile.seekable is broken in stream mode
type: behavior
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



[issue26415] Out of memory, trying to parse a 35MB dict

2016-02-25 Thread A. Skrobov

A. Skrobov added the comment:

Mine is on Windows. I've now installed both 2.7.10 and 3.4.3 to reconfirm, and 
it's still the same, on both of them, except that on 3.4.3 it crashes with a 
MemoryError much faster (within a couple minutes).

--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
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



[issue26439] ctypes.util.find_library fails ALWAYS when gcc is not used

2016-02-25 Thread Michael Felt

Michael Felt added the comment:

Last message (back to debian, and minor changes to learn expected behavior)

if sys.platform == "darwin":
print cdll.LoadLibrary("libm.dylib")
print cdll.LoadLibrary("libcrypto.dylib")
print cdll.LoadLibrary("libSystem.dylib")
print cdll.LoadLibrary("System.framework/System")
else:
print cdll.LoadLibrary("libm.so.6")
#print cdll.LoadLibrary("libcrypt.so")
print find_library("crypt")
x = find_library("crypt")
print cdll.LoadLibrary(x)

returns:
root@ipv4:/home/michael# python -m ctypes.util
libm.so.6
libc.so.6
libbz2.so.1.0

libcrypt.so.1


--

___
Python tracker 

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



[issue26439] ctypes.util.find_library fails ALWAYS when gcc is not used

2016-02-25 Thread Michael Felt

Michael Felt added the comment:

Further testing...

I added an extremely simple hack in util.py so that a archive (AIX library) 
name got returned.

Also in this case - the print cdll.LoadLibrary("libc.a") fails.

   +74  if os.name == "posix" and sys.platform == "darwin":
   +75  from ctypes.macholib.dyld import dyld_find as _dyld_find
   +76  def find_library(name):
   +77  possible = ['lib%s.dylib' % name,
   +78  '%s.dylib' % name,
   +79  '%s.framework/%s' % (name, name)]
   +80  for name in possible:
   +81  try:
   +82  return _dyld_find(name)
   +83  except ValueError:
   +84  continue
   +85  return None
   +86
   +87  if os.name == "posix" and sys.platform.startswith("aix"):
   +88   def find_library(name):
   +89  expr = "lib" + name + ".a"
   +90  return expr
   +91
   +92  elif os.name == "posix":
   +93  # Andreas Degert's find functions, using gcc, /sbin/ldconfig, 
objdump
   +94  import re, tempfile, errno
   +95
   +96  def _findLib_gcc(name):

  +275  else:
  +276  print cdll.LoadLibrary("libc.a")
  +277  print cdll.LoadLibrary("libm.so")
  +278  print cdll.LoadLibrary("libcrypt.so")

root@x064:[/tmp]python -m ctypes.util
libm.a
libc.a
libbz2.a
Traceback (most recent call last):
  File "/opt/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
  File "/opt/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
  File "/opt/lib/python2.7/ctypes/util.py", line 282, in 
test()
  File "/opt/lib/python2.7/ctypes/util.py", line 276, in test
print cdll.LoadLibrary("libc.a")
  File "/opt/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
return self._dlltype(name)
  File "/opt/lib/python2.7/ctypes/__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError:0509-022 Cannot load module /usr/lib/libc.a.
0509-103   The module has an invalid magic number.

So, what needs to be returned so that cdll.LoadLibrary could use that result? 
(e.g., I know that the default libm.a has no shared members on AIX 5.3 TL7 - 
but libc.a does (shr.o and more, but not all!).

--

___
Python tracker 

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



[issue26439] ctypes.util.find_library fails ALWAYS when gcc is not used

2016-02-25 Thread Michael Felt

Michael Felt added the comment:

p.s. On a debian (on POWER) system, the function is working, but the test seems 
a bit broken as well, i.e., cdll.LoadLibrary("libm.so") is not working even 
though 

if os.name == "posix":
# find and load_version
print find_library("m")
print find_library("c")
print find_library("bz2")

has successfully printed.
root@ipv4:/home/michael# python -m ctypes.util
libm.so.6
libc.so.6
libbz2.so.1.0
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
  File "/usr/lib/python2.7/ctypes/util.py", line 287, in 
test()
  File "/usr/lib/python2.7/ctypes/util.py", line 282, in test
print cdll.LoadLibrary("libm.so")
  File "/usr/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
return self._dlltype(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError: libm.so: cannot open shared object file: No such file or directory
root@ipv4:/home/michael# uname -a
Linux ipv4.rootvg.net 3.16.0-4-powerpc64 #1 SMP Debian 3.16.7-ckt9-3 
(2015-04-23) ppc64 GNU/Linux
root@ipv4:/home/michael# ldconfig -p | grep libm.so
libm.so.6 (libc6, OS ABI: Linux 2.6.32) => 
/lib/powerpc-linux-gnu/libm.so.6
root@ipv4:/home/michael# ls -l /lib/powerpc-linux-gnu/libm.so.6
lrwxrwxrwx 1 root root 12 Apr 15  2015 /lib/powerpc-linux-gnu/libm.so.6 -> 
libm-2.19.so
root@ipv4:/home/michael# ls -l /lib/powerpc-linux-gnu/libm-2.19.so
-rw-r--r-- 1 root root 743784 Apr 15  2015 /lib/powerpc-linux-gnu/libm-2.19.so

--

___
Python tracker 

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



[issue26439] ctypes.util.find_library fails ALWAYS when gcc is not used

2016-02-25 Thread Michael Felt

New submission from Michael Felt:

I have successful enough with python 2.7.10 (for building cloud-init), 
including it finding openssl libraries during the installation od setuptools 
(before installing pip).

I have also been able to assemble saltstack - BUT - salt-master and salt-minion 
fail to start because ctypes.util.find_library() always returns 'None'.
 EXCERPT 
  File "/opt/lib/python2.7/site-packages/salt/crypt.py", line 37, in 
import salt.utils.rsax931
  File "/opt/lib/python2.7/site-packages/salt/utils/rsax931.py", line 69, in 

libcrypto = _init_libcrypto()
  File "/opt/lib/python2.7/site-packages/salt/utils/rsax931.py", line 47, in 
_init_libcrypto
libcrypto = _load_libcrypto()
  File "/opt/lib/python2.7/site-packages/salt/utils/rsax931.py", line 40, in 
_load_libcrypto
raise OSError('Cannot locate OpenSSL libcrypto')
OSError: Cannot locate OpenSSL libcrypto
===
I built python using the IBM compiler, and my images do not have /sbin/ldconfig 
installed so the assumption that /sbin/ldconfig is always installed is "a bug".

in the util.py file the code reached is:

  +219  else:
  +220
  +221  def _findSoname_ldconfig(name):
  +222  import struct
  +223  if struct.calcsize('l') == 4:
  +224  machine = os.uname()[4] + '-32'
  +225  else:
  +226  machine = os.uname()[4] + '-64'
  +227  mach_map = {
  +228  'x86_64-64': 'libc6,x86-64',
  +229  'ppc64-64': 'libc6,64bit',
  +230  'sparc64-64': 'libc6,64bit',
  +231  's390x-64': 'libc6,64bit',
  +232  'ia64-64': 'libc6,IA-64',
  +233  }
  +234  abi_type = mach_map.get(machine, 'libc6')
  +235
  +236  # XXX assuming GLIBC's ldconfig (with option -p)
  +237  expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), 
abi_type)
  +238  f = os.popen('/sbin/ldconfig -p 2>/dev/null')
  +239  try:
  +240  data = f.read()
  +241  finally:
  +242  f.close()
  +243  res = re.search(expr, data)
  +244  if not res:
  +245  return None
  +246  return res.group(1)
  +247
  +248  def find_library(name):
  +249  return _findSoname_ldconfig(name) or 
_get_soname(_findLib_gcc(name))
  +250

(I have not researched _get_soname or _findLib_gcc but neither of these "feel 
right" as AIX, by default, does not end library (archives) with .so (archives 
end with .a and archive members frequently end with .so)

That this is/has not been reported more frequently may be because python 
programmers are avoiding ctypes - when portability is essential.

I hope that, just as for Solaris - where an alternate program is used - that 
AIX can have a block:
 # if os.name == "posix" and sys.platform.startswith("aix"):

so that if ldconfig is not available the command /usr/bin/dump could be used 
instead, and/or search LIBPATH and/or (when not empty) and/or ldd (for 
programs). Ideally, /sbin/ldconfig would not be need at all!

dump output:

root@x064:[/data/prj/gnu/bashRC1-4.4]dump -Xany -H /opt/bin/python

/opt/bin/python:

***Loader Section***
  Loader Header Information
VERSION# #SYMtableENT #RELOCentLENidSTR
0x0001   0x05ac   0x35e3   0x006e   

#IMPfilIDOFFidSTR LENstrTBLOFFstrTBL
0x0005   0x00030ee4   0x6772   0x00030f52   


***Import File Strings***
INDEX  PATH  BASEMEMBER  
0  /usr/vac/lib:/usr/lib:/lib
1libc.a  shr.o   
2libpthreads.a   shr_xpg5.o  
3libpthreads.a   shr_comm.o  
4libdl.a shr.o

root@x064:[/usr/bin]dump -Xany -H /usr/lib/libcrypto.a

/usr/lib/libcrypto.a[libcrypto.so]:

***Loader Section***
  Loader Header Information
VERSION# #SYMtableENT #RELOCentLENidSTR
0x0001   0x0ff9   0x498a   0x0038   

#IMPfilIDOFFidSTR LENstrTBLOFFstrTBL
0x0003   0x0004f1f0   0x00014636   0x0004f228   


***Import File Strings***
INDEX  PATH  BASEMEMBER  
0  /usr/lib:/lib 
1libc.a  shr.o   
2libpthreads.a   shr_xpg5.o  


[issue26415] Out of memory, trying to parse a 35MB dict

2016-02-25 Thread Christian Heimes

Christian Heimes added the comment:

It takes about 12 seconds to byte compile crash.py on my computer and less than 
half a second to import about 28 MB of byte code:


$ rm -rf crash.pyc __pycache__/
$ time python2.7 -c 'import crash'

real0m11.930s
user0m9.859s
sys 0m2.085s
$ time python2.7 -c 'import crash'

real0m0.484s
user0m0.401s
sys 0m0.083s
$ time python3.4 -c 'import crash'

real0m12.327s
user0m10.106s
sys 0m2.236s
$ time python3.4 -c 'import crash'

real0m0.435s
user0m0.367s
sys 0m0.069s

--
nosy: +christian.heimes

___
Python tracker 

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



[issue26438] Complete your registration to Python tracker -- key4g5ti2VWPYCbHm4wBLtl92LNQ9nzndqi

2016-02-25 Thread Christian Heimes

Changes by Christian Heimes :


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



[issue26438] Complete your registration to Python tracker -- key4g5ti2VWPYCbHm4wBLtl92LNQ9nzndqi

2016-02-25 Thread heha37

New submission from heha37:

is ok

---Original---
From: "Python tracker"
Date: 2016/2/25 21:55:19
To: "zhanghanqun";
Subject: Complete your registration to Python tracker -- 
key4g5ti2VWPYCbHm4wBLtl92LNQ9nzndqi

To complete your registration of the user "heha37" with
Python tracker, please do one of the following:

- send a reply to rep...@bugs.python.org and maintain the subject line as is 
(the
reply's additional "Re:" is ok),

- or visit the following URL:

http://bugs.python.org/?@action=confrego=4g5ti2VWPYCbHm4wBLtl92LNQ9nzndqi

--
messages: 260858
nosy: heha37
priority: normal
severity: normal
status: open
title: Complete your registration to Python tracker -- 
key4g5ti2VWPYCbHm4wBLtl92LNQ9nzndqi

___
Python tracker 

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



[issue26437] asyncio create_server() not always accepts the 'port' parameter as str

2016-02-25 Thread Xavier de Gaye

New submission from Xavier de Gaye:

create_server() used to accept the 'port' parameter as a string before in all 
cases (until last december at least).
The following session shows the difference in behavior when the listening 
address is INADDR_ANY and '127.0.0.1':


$ python
Python 3.6.0a0 (default:47fa003aa9f1, Feb 24 2016, 13:09:02) 
[GCC 5.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from asyncio import *
>>> loop = get_event_loop()
>>> coro = loop.create_server(Protocol(), '', '12345')
>>> loop.run_until_complete(coro)
, ]>
>>> coro = loop.create_server(Protocol(), '127.0.0.1', '12345')
>>> loop.run_until_complete(coro)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.6/asyncio/base_events.py", line 373, in 
run_until_complete
return future.result()
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 274, in result
raise self._exception
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 240, in _step
result = coro.send(None)
  File "/usr/local/lib/python3.6/asyncio/base_events.py", line 946, in 
create_server
sock.bind(sa)
TypeError: an integer is required (got type str)


IMPHO python should consistently either accept 'port' as str or require 'port' 
as int.

--
components: Library (Lib)
messages: 260857
nosy: giampaolo.rodola, gvanrossum, haypo, pitrou, xdegaye, yselivanov
priority: normal
severity: normal
status: open
title: asyncio create_server() not always accepts the 'port' parameter as str
type: behavior
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



[issue26402] Regression in Python 3.5 xmlrpc.client, raises RemoteDisconnected seemingly randomly.

2016-02-25 Thread Martin Panter

Martin Panter added the comment:

Thanks for reporting this Jelte

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



[issue22836] Broken "Exception ignored in:" message on exceptions in __repr__

2016-02-25 Thread Martin Panter

Martin Panter added the comment:

Here is a new patch with Victor’s suggestions. The reports now look like

>>> raise BrokenStrException()
Traceback (most recent call last):
  File "", line 1, in 
__main__.BrokenStrException: 
>>> o = VeryBroken()
>>> del o
Exception ignored in: 
Traceback (most recent call last):
  File "", line 9, in __del__
__main__.BrokenStrException: 

--
Added file: http://bugs.python.org/file42029/unraisable-continue.v5.patch

___
Python tracker 

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



[issue26436] Add the regex-dna benchmark

2016-02-25 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch adds the regex-dna benchmark from The Computer Language 
Benchmarks Game (http://benchmarksgame.alioth.debian.org/). This is artificial 
but well known benchmark.

The patch is based on regex-dna Python 3 #5 program and fasta Python 3 #3 
program (for generating input).

--
components: Benchmarks
files: bm_regex_dna.patch
keywords: patch
messages: 260854
nosy: brett.cannon, pitrou, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Add the regex-dna benchmark
type: enhancement
Added file: http://bugs.python.org/file42028/bm_regex_dna.patch

___
Python tracker 

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



[issue26402] Regression in Python 3.5 xmlrpc.client, raises RemoteDisconnected seemingly randomly.

2016-02-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d668b5595534 by Martin Panter in branch '3.5':
Issue #26402: Fix XML-RPC client retrying after server disconnection
https://hg.python.org/cpython/rev/d668b5595534

New changeset 70bf0d764939 by Martin Panter in branch 'default':
Issue #26402: Merge XML-RPC client fix from 3.5
https://hg.python.org/cpython/rev/70bf0d764939

--
nosy: +python-dev

___
Python tracker 

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



[issue26039] More flexibility in zipfile interface

2016-02-25 Thread Martin Panter

Martin Panter added the comment:

When you say concurrent writes should be impossible, I guess that only applies 
to a single-threaded program. There is no lock protecting the “self._fileRefCnt 
> 1” check and related manipulation (not that I am saying there should be).

For serializing concurrent writes to a single handle, if that is intended it 
should be documented. If it is not intended, maybe it should be removed (my 
preference)?

It would be good to wait if Serhiy can explain the purpose of the lock, seeing 
he was involved in adding it and probably knows a lot more about this module 
than I.

--

___
Python tracker 

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



[issue24291] wsgiref.handlers.SimpleHandler truncates large output blobs

2016-02-25 Thread Martin Panter

Changes by Martin Panter :


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



[issue26435] Fix versionadded/versionchanged documentation directives

2016-02-25 Thread Martin Panter

Martin Panter added the comment:

Thanks for finding these. I presume they are also applicable to 3.5.

There is a similar problem with the range() documentation:

./Doc/library/stdtypes.rst:1301:   .. data: start
./Doc/library/stdtypes.rst:1306:   .. data: stop
./Doc/library/stdtypes.rst:1310:   .. data: step

Unfortunately it looks like this error causes the text to be silently dropped 
from the output. There are scripts that check for other errors (make -C Doc/ 
suspicious check), but it seems this error is not picked up.

--
nosy: +martin.panter
stage:  -> patch review
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



[issue25801] ResourceWarning in test_zipfile64

2016-02-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your patch SilentGhost.

--
resolution:  -> fixed
stage: patch review -> resolved
status: languishing -> closed
type:  -> resource usage
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



[issue25801] ResourceWarning in test_zipfile64

2016-02-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset baec3e2e1b1f by Serhiy Storchaka in branch '3.5':
Issue #25801: Fixed resource warnings in test_zipfile64.
https://hg.python.org/cpython/rev/baec3e2e1b1f

New changeset 32051701a49d by Serhiy Storchaka in branch '2.7':
Issue #25801: Fixed resource warnings in test_zipfile64.
https://hg.python.org/cpython/rev/32051701a49d

New changeset 2193f8b956de by Serhiy Storchaka in branch 'default':
Issue #25801: Fixed resource warnings in test_zipfile64.
https://hg.python.org/cpython/rev/2193f8b956de

--
nosy: +python-dev

___
Python tracker 

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



[issue26435] Fix versionadded/versionchanged documentation directives

2016-02-25 Thread Jakub Stasiak

New submission from Jakub Stasiak:

A double colon seems to be required for a directive to work, please find a 
patch attached.

--
assignee: docs@python
components: Documentation
files: typos.patch
keywords: patch
messages: 260848
nosy: docs@python, jstasiak
priority: normal
severity: normal
status: open
title: Fix versionadded/versionchanged documentation directives
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42027/typos.patch

___
Python tracker 

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



[issue26335] Make mmap.write return the number of bytes written like other write methods

2016-02-25 Thread Jakub Stasiak

Jakub Stasiak added the comment:

Thank you. I didn't know whether to add an entry to Doc/whatsnew/3.6.rst, 
Misc/NEWS or both so I chose both, feel free to modify/remove as needed.

The new patch also doesn't have a typo in the versionchanged directive present 
in the version 2. I noticed more typos like this (single colon instead of 
double colon), I'll create a separate issue.

--
Added file: http://bugs.python.org/file42026/mmap_write_return_count3.patch

___
Python tracker 

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



[issue26434] multiprocessing cannot spawn grandchild from a Windows service

2016-02-25 Thread Marc Schlaich

New submission from Marc Schlaich:

This is a follow up of #5162.

There are some occasions where you can still run into this issue. One example 
is if you want to spawn a new multiprocessing.Process as a child of a 
multiprocessing.Process:

pythonservice.exe
  - multiprocessing.Process
- multiprocessing.Process (does not start!)


Attached is a test case. If you run this in pywin32 service debug mode, you see 
that the process crashes with:

Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python27\lib\multiprocessing\forking.py", line 380, in main
prepare(preparation_data)
  File "C:\Python27\lib\multiprocessing\forking.py", line 503, in prepare
file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named PythonService


In get_preparation_data is the following state:

  WINSERVICE: False
  WINEXE: False
  _python_exe: C:\Python27\python.exe


And so you get as preparation data:

  {'authkey': '...', 'sys_path': [...], 'name': 'test', 'orig_dir': '...', 
'sys_argv': ['C:\\Python27\\lib\\site-packages\\win32\\PythonService.exe'], 
'main_path': 'C:\\Python27\\lib\\site-packages\\win32\\PythonService.exe', 
'log_to_stderr': False}


A workaround for me is patching `get_preparation_data` as follows:

import multiprocessing.forking

_org_get_preparation_data = multiprocessing.forking.get_preparation_data

def _get_preparation_data(*args):
data = _org_get_preparation_data(*args)
main_path = data.get('main_path')
if main_path is not None and main_path.endswith('exe'):
data.pop('main_path')
return data

multiprocessing.forking.get_preparation_data = _get_preparation_data


BTW, the test case does not run on Python 3.5, but starting the service 
manually did work. So this is probably a Python 2 issue only.

--
components: Library (Lib), Windows
files: test_mp_service.py
messages: 260846
nosy: paul.moore, schlamar, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: multiprocessing cannot spawn grandchild from a Windows service
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file42025/test_mp_service.py

___
Python tracker 

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



[issue26433] urllib.urlencode() does not explain how to handle unicode

2016-02-25 Thread Thomas Güttler

New submission from Thomas Güttler:

The current docs for Python2, don't explain how to handle unicode:

https://docs.python.org/2/library/urllib.html#urllib.urlencode

It seems to be a common problem. See 
http://stackoverflow.com/questions/6480723/urllib-urlencode-doesnt-like-unicode-values-how-about-this-workaround

It would be nice to document the most pythonic way to handle unicode in 
urllib.urlencode()

--
assignee: docs@python
components: Documentation
messages: 260845
nosy: Thomas Güttler, docs@python
priority: normal
severity: normal
status: open
title: urllib.urlencode() does not explain how to handle unicode
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



[issue24291] wsgiref.handlers.SimpleHandler truncates large output blobs

2016-02-25 Thread Paolo Veglia

Paolo Veglia added the comment:

I had the same issue as Jonathan with Python 3.5.1, big chunks of data get 
truncated (to ~85KB).

The problem disappears when splitting original data into smaller chunks:

def _write(self,data):
chunk_size = 1024
for chunk in (data[i:i+chunk_size] for i in range(0, len(data), 
chunk_size)):
self.stdout.write(chunk)

--
nosy: +Paolo Veglia
versions:  -Python 2.7, Python 3.4, Python 3.6

___
Python tracker 

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



[issue26432] Add partial.kwargs

2016-02-25 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Most Python classes that exposes a dictionary of keyword arguments as an 
attribute, name this attribute "kwargs":

concurrent.futures.process._CallItem
concurrent.futures.process._WorkItem
concurrent.futures.thread._WorkItem
inspect.BoundArguments
sched.Event
threading.Timer
unittest.mock._patch
weakref.finalize._Info

The only exceptions are classes contextlib._GeneratorContextManager with the 
"kwds" attribute and functools.partial and functools.partialmethod with the 
"keywords" attribute.

Proposed patch adds the "kwargs" alias to the the "keywords" attribute in 
functools.partial and functools.partialmethod.

There are precedences for adding aliases in the stdlib.

--
components: Library (Lib)
files: partial_kwargs.patch
keywords: patch
messages: 260843
nosy: gvanrossum, rhettinger, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Add partial.kwargs
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42024/partial_kwargs.patch

___
Python tracker 

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