[issue21058] tempfile.NamedTemporaryFile leaks file descriptor when fdopen fails

2014-03-24 Thread tholzer

New submission from tholzer:

The NamedTemporaryFile inside the standard tempfile library leaks an open file 
descriptor when fdopen fails.

Test case:

# ulimit -SHn 50
# python test1.py

from tempfile import NamedTemporaryFile

while 1:
try:
NamedTemporaryFile(mode='x')
except ValueError as ex:
pass

Output:

Traceback (most recent call last):
  File "./a2.py", line 7, in 
  File "/usr/lib/python2.7/tempfile.py", line 454, in NamedTemporaryFile
  File "/usr/lib/python2.7/tempfile.py", line 235, in _mkstemp_inner
OSError: [Errno 24] Too many open files: '/tmp/tmpI0MIEW'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 66, in 
apport_excepthook
ImportError: No module named fileutils

Original exception was:
Traceback (most recent call last):
  File "./a2.py", line 7, in 
  File "/usr/lib/python2.7/tempfile.py", line 454, in NamedTemporaryFile
  File "/usr/lib/python2.7/tempfile.py", line 235, in _mkstemp_inner
OSError: [Errno 24] Too many open files: '/tmp/tmpI0MIEW'

Patch:

@@ -452,7 +452,11 @@
 flags |= _os.O_TEMPORARY
 
 (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
-file = _os.fdopen(fd, mode, bufsize)
+try:
+file = _os.fdopen(fd, mode, bufsize)
+except Exception as ex:
+_os.close(fd)
+raise
 return _TemporaryFileWrapper(file, name, delete)
 
 if _os.name != 'posix' or _os.sys.platform == 'cygwin':

--
components: Library (Lib)
messages: 214778
nosy: tholzer
priority: normal
severity: normal
status: open
title: tempfile.NamedTemporaryFile leaks file descriptor when fdopen fails
type: resource usage
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



[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-03-24 Thread Nikolaus Rath

Nikolaus Rath added the comment:

If someone is willing to review, I'd be happy to write a patch for this.

--

___
Python tracker 

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



[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-03-24 Thread Nikolaus Rath

New submission from Nikolaus Rath:

In Python 3.4, TextIOWrapper can not read from streams that return bytearrays 
or memoryviews:

from io import TextIOWrapper, BytesIO
class MyByteStream(BytesIO):
def read1(self, len_):
return memoryview(super().read(len_))
bs = MyByteStream(b'some data in ascii\n')
ss = TextIOWrapper(bs, encoding='ascii')
print(ss.read(200))

results in:

TypeError: underlying read1() should have returned a bytes object, not 
'memoryview'

I don't think there's any good reason for TextIOWrapper not accepting any 
bytes-like object (especially now that b''.join finally accepts bytes-like 
objects as well).

--
components: Library (Lib)
messages: 214776
nosy: nikratio
priority: normal
severity: normal
status: open
title: TextIOWrapper does not support reading bytearrays or memoryviews
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



[issue21056] csv documentation is incorrect

2014-03-24 Thread NRGunby

New submission from NRGunby:

The documentation for the csv reader objects next() method is incorrect. It 
states '
csvreader.next()

Return the next row of the reader’s iterable object as a list, parsed according 
to the current dialect.'

Either the documentation for DictReader objects needs to be be made separate 
from normal reader objects, or this needs to be amended to say '
csvreader.next()

Return the next row of the reader’s iterable object as a list (if reader) or 
dict (if DictReader), parsed according to the current dialect.
'
 
I observed this in the 2.7 online docs, found it to be the case in the 3.4 
online docs as well, and haven't checked other versions but assume it's the 
case.

--
assignee: docs@python
components: Documentation
messages: 214775
nosy: NRGunby, docs@python
priority: normal
severity: normal
status: open
title: csv documentation is incorrect
type: behavior
versions: Python 2.7, Python 3.4

___
Python tracker 

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



[issue15955] gzip, bz2, lzma: add option to limit output size

2014-03-24 Thread Nikolaus Rath

Nikolaus Rath added the comment:

I have attached a patch adding the max_length parameter to 
LZMADecompressor.decompress(). 

I have chosen to store the pointer to any unconsumed input in the lzma stream 
object itself. The new convention is: if lzs.next_in != NULL, then there is 
valid data that needs to be prepended.

Since I expect that max_length will often be specified as a keyword argument, I 
had to change the argument clinic definition to allow all arguments to be 
specified as keyword arguments. I hope that's ok.

Testcases seem to run fine. No reference leaks with -R : either.

Comments?

--
keywords: +patch
Added file: http://bugs.python.org/file34609/issue15955.diff

___
Python tracker 

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



[issue15955] gzip, bz2, lzma: add option to limit output size

2014-03-24 Thread Nikolaus Rath

Nikolaus Rath added the comment:

Thanks Nadeem. I'll get going.

--

___
Python tracker 

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



[issue20951] SSLSocket.send() returns 0 for non-blocking socket

2014-03-24 Thread Nikolaus Rath

Nikolaus Rath added the comment:

(refreshed patch)

--
Added file: http://bugs.python.org/file34608/issue20951.diff

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-03-24 Thread Benjamin Peterson

Benjamin Peterson added the comment:

On Mon, Mar 24, 2014, at 14:56, Martin v. Löwis wrote:
> 
> Martin v. Löwis added the comment:
> 
> What triggered my interpretation might have been this conversation:
> 
> https://mail.python.org/pipermail/python-dev/2002-May/023998.html
> https://mail.python.org/pipermail/python-dev/2002-May/024006.html

In this case, though, the patch gets accepted:
https://mail.python.org/pipermail/python-dev/2002-May/024036.html

--

___
Python tracker 

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



[issue20469] ssl.getpeercert() should include extensions

2014-03-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The ssl module doesn't return all cert contents simply because it isn't easy to 
do so, or at least AFAICT it isn't. If you look at _decode_certificate() in 
Modules/_ssl.c you'll see the kind of code that is needed for the few fields 
that Python currently returns :-)

--

___
Python tracker 

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



[issue20469] ssl.getpeercert() should include extensions

2014-03-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage: test needed -> needs patch

___
Python tracker 

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



[issue20469] ssl.getpeercert() should include extensions

2014-03-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

If you can, write test code that fails now and indicate what success would look 
like. It can start as a separate file rather than a patch to test_ssl. It does 
not have to use unittest, though that would be helpful.

--
nosy: +terry.reedy
stage:  -> test needed

___
Python tracker 

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



[issue21043] Stop recommending CACert.org in the SSL documentation

2014-03-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7ef262eafecd by Donald Stufft in branch '2.7':
Issue #21043 - Remove CACert.org from the recommendations
http://hg.python.org/cpython/rev/7ef262eafecd

--

___
Python tracker 

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



[issue21043] Stop recommending CACert.org in the SSL documentation

2014-03-24 Thread Donald Stufft

Changes by Donald Stufft :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue21043] Stop recommending CACert.org in the SSL documentation

2014-03-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0485552b487e by Donald Stufft in branch 'default':
Merge in 3.4 to bring forward the Issue #21043 changes.
http://hg.python.org/cpython/rev/0485552b487e

--

___
Python tracker 

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



[issue21055] Index (augmented) assignment symbols

2014-03-24 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Dependency of 21054

--
files: index-assign.diff
keywords: patch
messages: 214763
nosy: terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: Index (augmented) assignment symbols
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file34607/index-assign.diff

___
Python tracker 

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



[issue21043] Stop recommending CACert.org in the SSL documentation

2014-03-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6f776c91da08 by Donald Stufft in branch '3.4':
Issue #21043: Remove the recommendation for specific CA organizations
http://hg.python.org/cpython/rev/6f776c91da08

--
nosy: +python-dev

___
Python tracker 

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



[issue21054] Improve indexing of syntax symbols

2014-03-24 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Since I will post multiple patches for review on separate issues, this is an 
index issue that will have multiple dependencies.

--
messages: 214761
nosy: terry.reedy
priority: normal
severity: normal
status: open
title: Improve indexing of syntax symbols
versions: Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue21044] tarfile does not handle file .name being an int

2014-03-24 Thread Antoine Pietri

Antoine Pietri added the comment:

Well, this behavior seems pretty inconsistent to me, it means that every 
library has to check if the name attribute  is actually a string (which would 
correspond to a path) or an int (that would mean a fd), and I think a "fd" 
attribute would seem more consistent.
But as I don't think we could change this behavior that easily (it means 
breaking retrocompatibility after all...), we must at least make tarlib deal 
with that.

--

___
Python tracker 

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



[issue20992] reading individual bytes of multiple binary files using the Python module fileinput

2014-03-24 Thread Josh Rosenberg

Josh Rosenberg added the comment:

And of course, missed another typo. open's first arg should be file, not 
filename.

--

___
Python tracker 

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



[issue20992] reading individual bytes of multiple binary files using the Python module fileinput

2014-03-24 Thread Josh Rosenberg

Josh Rosenberg added the comment:

On memory: Yeah, it could be if the file didn't include any newline characters. 
Same problem could apply if a text input file relied on word wrap in an editor 
and included very few or no newlines itself.

There are non-fileinput ways of doing this, like I said; if you want consistent 
performance, you'd probably use one of them. For example, using the two arg 
form of iter:

from functools import partial

def bytefileinput(files):
for file in files:
with open(filename, "rb") as f:
yield from iter(partial(f.read, 1), b'')

Still kind of slow, but predictable on memory usage and not to complex.

--

___
Python tracker 

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



[issue21044] tarfile does not handle file .name being an int

2014-03-24 Thread Antoine Pietri

Antoine Pietri added the comment:

Yes, the bug report was originally titled like this ("TemporaryFile should'nt 
have a name attribute") but apparently this is a common and expected behavior 
for FileIO subclasses.

--

___
Python tracker 

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



[issue21044] tarfile does not handle file .name being an int

2014-03-24 Thread R. David Murray

R. David Murray added the comment:

See the documentation link in msg214670.  This isn't a characteristic of 
TemporaryFile, it's a characteristic of the Python IO system.  So you'd have to 
argue that the documented behavior of the io system is a bug.

--

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-03-24 Thread Stefan Krah

Stefan Krah added the comment:

Benjamin Peterson  wrote:
> I don't want to scare away contributors.

I think this is a very important point. Initially I was skeptical about m68k,
too (msg182388), but I've completely changed my opinion due to the nature
of the patches.

So far, the m68k issues were about C-standard compliance and timing assumptions
in tests.

This one is a small patch that won't affect anything else.

My experience with exotic Linux ports (Debian SPARC, etc.) is that the Python
test suite works rather well out of the box.  So I don't expect to have a flood
of posixmodule.c patches or similar (perhaps Andreas can confirm that).

--

___
Python tracker 

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



[issue21044] tarfile does not handle file .name being an int

2014-03-24 Thread Éric Araujo

Éric Araujo added the comment:

Isn’t the bug here really that TemporaryFile has a name attribute that’s not a 
string?  I don’t see how an integer name makes sense within the IO system.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue21053] Idle Crash with the ^ button

2014-03-24 Thread Pierre K

Pierre K added the comment:

Thanks Ned for the advice & the links, indeed, there is a warning. The Tcl/Tk 
8.5.15 version works like a charm!

--
status: pending -> closed

___
Python tracker 

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



[issue20992] reading individual bytes of multiple binary files using the Python module fileinput

2014-03-24 Thread Tommy Carstensen

Tommy Carstensen added the comment:

I read the fileinput code and realized how heavily tied it is to line input.

Will reading individual bytes as suggested not be very memory intensive, if 
each line is billions of characters?

def bytefileinput():
return (bytes((b,)) for line in fileinput.input() for b in line)

I posted my workaround on stackoverflow (see link earlier in tread), which does 
not make use of the fileinput module at all. After having read through the 
fileinput code I agree that the module should only support reading lines and 
this enhancement request should be closed.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-03-24 Thread Thomas Petazzoni

Thomas Petazzoni added the comment:

But this expectation is not true: if dependencies are not available, Python 
silently disables the build of certain modules. So this story of making the 
standard library always has all the modules does not really stand.

--

___
Python tracker 

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



[issue21040] socketserver: use selectors module

2014-03-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3047db8f6126 by Charles-François Natali in branch 'default':
Issue #21040: socketserver: Use the selectors module.
http://hg.python.org/cpython/rev/3047db8f6126

--
nosy: +python-dev

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-03-24 Thread Éric Araujo

Éric Araujo added the comment:

The main issue with the proposed changes is that it redefines what “the Python 
standard library” is.  Right now, users can mostly expect modules listed in the 
official Python docs to be available in their installation, regardless of how 
they got their Python.

I say “mostly” because a distributor may exclude tests from a binay package, 
split some extensions modules like _tkinter and _lzma in other packages, etc.  
A big source of pain in the past was distributors splitting distutils, but I 
think they all stopped.

(A related issue is that some distributors backport many bug fixes and 
sometimes features, which is a pain when you think you’ve run your tests with 
“Python X.Y.Z” and it was actually “X.Y.Z+some-patches”.)

--
nosy: +eric.araujo

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-03-24 Thread Andreas Schwab

Andreas Schwab added the comment:

We are actually talking about Linux here, I assume everyone knows what that is 
:-)

Also the patch is 2 files changed, 32+ (if you ignore the autoconf generated 
files), which is quite a bit smaller than the final version of the atheos patch 
(which is 19 files changed, 544+, 15-, also generated files ignored).

--

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-03-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> For example, a normal Python installation requires OpenSSL,
> libncurses, and lots of other things.

Not really. If some development libraries are not available, Python should 
still install fine without the corresponding modules.

--

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-03-24 Thread Thomas Petazzoni

Thomas Petazzoni added the comment:

No, because it's not simply about the size of the installed Python standard 
library: it's also about the number of dependencies to build before being able 
to build Python. For example, a normal Python installation requires OpenSSL, 
libncurses, and lots of other things. On many embedded systems, those are not 
needed.

--

___
Python tracker 

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



[issue19537] Fix misalignment in fastsearch_memchr_1char

2014-03-24 Thread Mark Lawrence

Mark Lawrence added the comment:

Please do not threaten me, I've been told that I'm to be ignored, and I now 
observe that committers seem to be sneaking patches into the source control 
system when the platform is unsupported.  I'll stop placing comments on 
appropriate issues if and only if I get satisfactory answers to my questions, 
which so far are conspicuous by their absence.

--

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-03-24 Thread Martin v . Löwis

Martin v. Löwis added the comment:

What triggered my interpretation might have been this conversation:

https://mail.python.org/pipermail/python-dev/2002-May/023998.html
https://mail.python.org/pipermail/python-dev/2002-May/024006.html

--

___
Python tracker 

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



[issue21053] Idle Crash with the ^ button

2014-03-24 Thread Ned Deily

Ned Deily added the comment:

>From the crash report provided, you are using the buggy Apple-supplied system 
>Tcl/Tk 8.5 in OS X 10.7.  You should have seen a warning message about this 
>when starting IDLE.  There are also warnings in the installer README and the 
>download pages.  Please download and install an up-to-date version of Tcl/Tk 
>8.5.15, for example, from ActiveState 
>(http://www.activestate.com/activetcl/downloads).  More information is 
>available here:  https://www.python.org/download/mac/tcltk/

--
nosy: +ned.deily
resolution:  -> out of date
stage:  -> committed/rejected
status: open -> pending

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-03-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I don't really like the idea of complicating our build tools even more. Can't 
you simply prune the install tree yourself?

--
nosy: +pitrou

___
Python tracker 

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



[issue20992] reading individual bytes of multiple binary files using the Python module fileinput

2014-03-24 Thread Josh Rosenberg

Josh Rosenberg added the comment:

That example should have included mode="rb" when using fileinput.input(); oops. 
Pretend I didn't forget it.

--

___
Python tracker 

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



[issue21036] typo in hashtable API: _PY_HASHTABLE_ENTRY_DATA -> _Py_HASHTABLE_ENTRY_DATA

2014-03-24 Thread STINNER Victor

STINNER Victor added the comment:

Thanks for the report Charles-François.

--

___
Python tracker 

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



[issue21036] typo in hashtable API: _PY_HASHTABLE_ENTRY_DATA -> _Py_HASHTABLE_ENTRY_DATA

2014-03-24 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue20992] reading individual bytes of multiple binary files using the Python module fileinput

2014-03-24 Thread Josh Rosenberg

Josh Rosenberg added the comment:

fileinput's semantics are heavily tied to lines, not bytes. And processing 
binary files byte by byte is rather inefficient; can you explain why this 
feature would be of general utility such that it would be worth including it in 
the standard library?

It's not hard to just get a byte at a time using existing parts:

def bytefileinput():
return (bytes((b,)) for line in fileinput.input() for b in line)

There are ways to do similar things without using fileinput at all. But it 
really depends on your use case.

Giving fileinput a read() method isn't a bad idea assuming some reasonable 
behavior is defined for the various line oriented methods, but making it 
iterate binary mode input byte by byte would be a breaking change of limited 
utility in my view.

--
nosy: +josh.rosenberg

___
Python tracker 

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



[issue6011] python doesn't build if prefix contains non-ascii characters

2014-03-24 Thread STINNER Victor

STINNER Victor added the comment:

> Victor, was this ticket kept open only for the backport to distutils2?

I have no idea :) It's probably fine now. Open a new and fresh issue if it's 
not fixed yet, this issue has a too long history.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue21052] Consider dropping ImportWarning for empty sys.path_hooks and sys.meta_path

2014-03-24 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

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



[issue16535] json encoder unable to handle decimal

2014-03-24 Thread Stefan Krah

Stefan Krah added the comment:

I think we should really apply #19232. At least that would take care
of the import issue.

--

___
Python tracker 

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



[issue21036] typo in hashtable API: _PY_HASHTABLE_ENTRY_DATA -> _Py_HASHTABLE_ENTRY_DATA

2014-03-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2bbda947a5b3 by Victor Stinner in branch '3.4':
Issue #21036: Fix typo in macro name
http://hg.python.org/cpython/rev/2bbda947a5b3

New changeset 0251614e853d by Victor Stinner in branch 'default':
(Merge 3.4) Issue #21036: Fix typo in macro name
http://hg.python.org/cpython/rev/0251614e853d

--
nosy: +python-dev

___
Python tracker 

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



[issue19537] Fix misalignment in fastsearch_memchr_1char

2014-03-24 Thread Stefan Krah

Stefan Krah added the comment:

Mark Lawrence, stop playing off committers against each other. This is
outright trolling.

--

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-03-24 Thread Martin v . Löwis

Martin v. Löwis added the comment:

It seems it wasn't actually a formal ruling (although I took it for that); see 
for yourself - or better, ask Guido what he thinks about this topic today:

https://mail.python.org/pipermail/python-3000/2007-August/009692.html
https://mail.python.org/pipermail/python-dev/2009-January/085064.html

There might be more postings on the topic which I can't find now.

--

___
Python tracker 

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



[issue16535] json encoder unable to handle decimal

2014-03-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The patch isn't really ok, IMO. It forcibly imports the decimal module and then 
looks up the type there. The decimal module is a rather large one and it 
shouldn't get imported if it doesn't get used.

I think it would be better to rely on the __float__ special method, which would 
also automatically accept other numberish types such as Fraction.

--

___
Python tracker 

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



[issue20990] pyflakes: undefined names, get_context() and main(), in multiprocessing

2014-03-24 Thread STINNER Victor

STINNER Victor added the comment:

Can we close this issue? Or Richard wants to write a test?

--

___
Python tracker 

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



[issue21040] socketserver: use selectors module

2014-03-24 Thread STINNER Victor

STINNER Victor added the comment:

I sent a review on Rietveld.

--

___
Python tracker 

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



[issue6011] python doesn't build if prefix contains non-ascii characters

2014-03-24 Thread Éric Araujo

Éric Araujo added the comment:

Victor, was this ticket kept open only for the backport to distutils2?  If 
everything is fixed in Python stdlib and docs, then it could be closed, as 
distutils2 development has stopped.

--
components:  -Distutils2
nosy: +dstufft
versions:  -3rd party

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-03-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> That's why I haven't said firmly yes or no yet.  I expect to see Guido
> in just over two weeks, and if nothing turns up by then I'll ask him
> in person.

It's a minor patch for a niche platform. What exactly is the point of
asking Guido in person? At worse, shoot him an e-mail. I would expect
the answer to be "I don't care".

--

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-03-24 Thread Tim Peters

Tim Peters added the comment:

In the absence of Guido here, I'll channel him ;-)  "The problem" with oddball 
platforms has been that some require major changes in many parts of the 
interpreter, and then all the added cruft complicates life for every 
maintainer, while few people benefit and the oddball platform typically has 
only one maintainer who vanishes for long stretches.

Guido would not object to this small, simple, well-motivated and isolated 
patch.  At least he wouldn't object on the basis of "it's an unsupported 
platform".

I don't object either ;-)

--

___
Python tracker 

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



[issue19537] Fix misalignment in fastsearch_memchr_1char

2014-03-24 Thread Mark Lawrence

Mark Lawrence added the comment:

Martin, Larry msg214639 states "Fix PyUnicode_DATA() alignment under m68k.", 
your comments please.

--
nosy: +BreamoreBoy, larry, loewis

___
Python tracker 

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



[issue21053] Idle Crash with the ^ button

2014-03-24 Thread Pierre K

New submission from Pierre K:

Idle crashes systematically when holding the ^button, which is regularly used 
in French. Very very annoying.

--
components: IDLE
files: Script.sh
messages: 214726
nosy: pancakesnutella
priority: normal
severity: normal
status: open
title: Idle Crash with the ^ button
type: crash
versions: Python 3.4
Added file: http://bugs.python.org/file34606/Script.sh

___
Python tracker 

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



[issue16535] json encoder unable to handle decimal

2014-03-24 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

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



[issue19871] json module won't parse a float that starts with a decimal point

2014-03-24 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-03-24 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I don't want to scare away contributors.

--

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-03-24 Thread Larry Hastings

Larry Hastings added the comment:

That's why I haven't said firmly yes or no yet.  I expect to see Guido in just 
over two weeks, and if nothing turns up by then I'll ask him in person.  Is 
anybody here in a hurry?

--

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-03-24 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Well, no one has produced a reference for this phantom announcement.

--

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-03-24 Thread Larry Hastings

Larry Hastings added the comment:

I agree that it's a short and straightforward patch, and as stated I wouldn't 
mind accepting it.  However, I don't make a habit of going against Guido's 
rulings.

--

___
Python tracker 

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



[issue17975] libpython3.so conflicts between $VERSIONs

2014-03-24 Thread koobs

koobs added the comment:

Confirming that altinstall installs libpython3.so

--

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-03-24 Thread Benjamin Peterson

Benjamin Peterson added the comment:

This is a short and straightforward patch that improves the Python experience 
for m86k users. I think it should be applied.

--

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-03-24 Thread Andreas Schwab

Andreas Schwab added the comment:

That's what I call hostile.

--

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-03-24 Thread Larry Hastings

Larry Hastings added the comment:

It sounds like this definitely won't happen for 3.4.  And if Guido has indeed 
declared "no code for unsupported platforms", it won't happen for 3.5 either.

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



[issue21041] pathlib.PurePath.parents rejects negative indexes

2014-03-24 Thread R. David Murray

R. David Murray added the comment:

Which is exactly what I mean by saying it is not a sequence.  It is 
'sequence-like'.  Kind of like email Messages are dict-like: they share many 
methods and behaviors, but the exact behaviors and semantics are different.

--

___
Python tracker 

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



[issue21041] pathlib.PurePath.parents rejects negative indexes

2014-03-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Well, it is a sequence, it's just that it doesn't respect the convention about 
negative indices :-)

As to why they are disallowed, I don't remember exactly (!) but I think it's 
because the exact semantics would be confusing otherwise.

--

___
Python tracker 

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



[issue21052] Consider dropping ImportWarning for empty sys.path_hooks and sys.meta_path

2014-03-24 Thread Brett Cannon

Brett Cannon added the comment:

It's a simple `if not sys.meta_path` check so it doesn't differentiate. But 
that's actually a good point about it being None in this case due to the 
shutdown; if the check changed to `if sys.meta_path is not None and 
len(sys.meta_path) == 0` then that should skip the shutdown issue while keeping 
the warning around.

Definitely going to be one of those instances where the tests are going to be 
more troublesome than the fix. =)

--
keywords: +easy
stage: needs patch -> test needed
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



[issue21051] incorrect utf-8 conversion with c api

2014-03-24 Thread Mark Dickinson

Mark Dickinson added the comment:

> I suspect that the actual bytes you get depend on your locale.

And from the output you're seeing, I'd guess that Windows is using the CP1250 
(Latin: Central European) codepage to make the translation on your machine: 
http://en.wikipedia.org/wiki/Windows-1250.

--

___
Python tracker 

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



[issue21051] incorrect utf-8 conversion with c api

2014-03-24 Thread Mark Dickinson

Mark Dickinson added the comment:

Indeed: the \u010d is being interpreted by your *C compiler* as a multibyte 
character, and the individual bytes of that multibyte character end up in the 
string that you actually pass to Python.  I suspect that the actual bytes you 
get depend on your locale.  Here I get (signed) bytes -60 and -115.  (See e.g. 
"translation phase 7" in C99 6.4.5.)

As Victor says, you need to escape the backslash in the C code.

--
nosy: +mark.dickinson
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue21052] Consider dropping ImportWarning for empty sys.path_hooks and sys.meta_path

2014-03-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Note that in issue #21409, sys.meta_path isn't "empty", it is actually None.

Another possibility is to drop those warnings only when the interpreter is 
shutting down (it would be easy to add a private API in sys to get that 
information).

--
nosy: +pitrou

___
Python tracker 

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



[issue21046] Document formulas used in statistics

2014-03-24 Thread Alextp

Alextp added the comment:

Without details like these it must be URLS to wikipedia or Wolfram. 
Usual users don't know how to search wolfram.

--

___
Python tracker 

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



[issue11481] The copy module already uses copyreg

2014-03-24 Thread hans.meine

hans.meine added the comment:

Maybe some 2.7 backport is missing w.r.t. the documentation of the copy module? 
 At least, http://docs.python.org/2/library/copy.html still states: "The copy 
module does not use the copy_reg registration module."

--
nosy: +hans-meine
versions:  -Python 3.2, Python 3.3

___
Python tracker 

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



[issue21041] pathlib.PurePath.parents rejects negative indexes

2014-03-24 Thread R. David Murray

R. David Murray added the comment:

I think this is a doc bug.  That object shouldn't be called a sequence, since 
it isn't one.

--

___
Python tracker 

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



[issue21044] tarfile does not handle file .name being an int

2014-03-24 Thread Antoine Pietri

Antoine Pietri added the comment:

Here's the test case as requested by berkerpeksag in the patch review.

--
Added file: http://bugs.python.org/file34605/test_tarfile_fobj_int.diff

___
Python tracker 

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



[issue21041] pathlib.PurePath.parents rejects negative indexes

2014-03-24 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +pitrou, r.david.murray

___
Python tracker 

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



[issue21041] pathlib.PurePath.parents rejects negative indexes

2014-03-24 Thread akira

Changes by akira <4kir4...@gmail.com>:


--
type:  -> behavior

___
Python tracker 

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



[issue21049] Flood of “ImportWarning: sys.meta_path is empty” after exception with socket subclass

2014-03-24 Thread Brett Cannon

Brett Cannon added the comment:

Sure, I'm fine with closing this as "Won't Fix" based on the cause being an 
edge case and rely on issue #21052 to discuss the value of the ImportWarning.

Thanks for the report, Martin.

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



[issue21046] Document formulas used in statistics

2014-03-24 Thread Mark Lawrence

Mark Lawrence added the comment:

IMHO the docs shouldn't be cluttered with details such as this.

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue21046] Document formulas used in statistics

2014-03-24 Thread Alextp

Alextp added the comment:

5) pvariance.
Calculates "population variance" of iterable by such formula:

pvariance([x1, x2, ..., xN], M) = ((x1 - M)**2 + ... + (xN - M)**2) / N

M is optional argument which should be value of mean([x1, ... xN]) calculated 
before. If M parameter is missed in call, it's calculated automatically:
M = (x1 + ... + xN) / N

6) variance.
(NOTE: pls check this.)
Calculates "sample variance" from iterable. It's given by the same formula as 
pvariance, but not for entire iterable value set. Only subset of iterable is 
used for calculation. .. (write here how this subset is taken, randomly 
or what. i didn't get it from Wikipedia.)

Ok?

--

___
Python tracker 

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



[issue21049] Flood of “ImportWarning: sys.meta_path is empty” after exception with socket subclass

2014-03-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Of course the use case presented here is very contrived, so we can also choose 
to not fix it.

--

___
Python tracker 

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



[issue21052] Consider dropping ImportWarning for empty sys.path_hooks and sys.meta_path

2014-03-24 Thread Brett Cannon

Brett Cannon added the comment:

I should also say that dropping warnings leaves only a single case of 
ImportWarning related to empty directory names (in relation to 
Finder.find_module()). Once that can go away that will eliminate all uses of 
warnings in importlib and thus won't necessitate importing it in this case.

--

___
Python tracker 

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



[issue21052] Consider dropping ImportWarning for empty sys.path_hooks and sys.meta_path

2014-03-24 Thread Brett Cannon

New submission from Brett Cannon:

Issue #21049 managed to trigger a huge output of "ImportWarning: sys.meta_path 
is empty" because it managed to trigger an import during interpreter shutdown. 
The ImportWarning for sys.path_hooks and sys.meta_path were originally added 
because before importlib took over import it was totally legal to blank out 
sys.path_hooks and sys.meta_path and have import continue to work. But 
hopefully by the time Python 3.5 comes out there will be enough knowledge out 
there to not blindly empty them, making the warning superfluous as well as an 
annoyance when things go wrong in other respects.

--
components: Interpreter Core
messages: 214702
nosy: brett.cannon, eric.snow, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Consider dropping ImportWarning for empty sys.path_hooks and 
sys.meta_path
type: behavior

___
Python tracker 

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



[issue21049] Flood of “ImportWarning: sys.meta_path is empty” after exception with socket subclass

2014-03-24 Thread Brett Cannon

Brett Cannon added the comment:

So the import warnings were added for sys.meta_path and sys.path_hooks because 
prior to Python 3.3 you could empty out those values and import would continue 
to work, but with importlib that stopped being the case. My thinking was that 
it would be easier to debug if you got that warning instead of your imports 
entirely failing and wondering what was going on. But perhaps sys.path_hooks 
and sys.meta_path are known well enough at this point that the warnings are 
superfluous. I'll open a separate bug to track that discussion.

--

___
Python tracker 

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



[issue21043] Stop recommending CACert.org in the SSL documentation

2014-03-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Looks good to me too.

--

___
Python tracker 

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



[issue21049] Flood of “ImportWarning: sys.meta_path is empty” after exception with socket subclass

2014-03-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

For a more detailed analysis:
- the warning gets printed very late because the socket is caught in a 
reference cycle (self.attr = self), which itself is tied to the exception 
traceback
- when the socket is collected, it tries to print a ResourceWarning because it 
hasn't been closed explicitly (just add self.close() in the constructor to make 
it disappear)
- when trying to print the ResourceWarning, it probably wants to import 
linecache or something, and that breaks

The only remaining mystery is why there are 200 lines and not just one :-)

--

___
Python tracker 

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



[issue21043] Stop recommending CACert.org in the SSL documentation

2014-03-24 Thread Donald Stufft

Donald Stufft added the comment:

The latest patch looks good to me.

--

___
Python tracker 

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



[issue21049] Flood of “ImportWarning: sys.meta_path is empty” after exception with socket subclass

2014-03-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Well, basically some sys attributes (including meta_path) are cleaned during 
shutdown, so if some code executes afterwards and tries to import something, 
importlib will complain that meta_path is empty.

Unless the warning is genuinely useful, I would suggest simply removing it.

Printing warnings during import can also degenerate into an infinite recursion, 
if printing the warning needs to import a module, for example:

./python -Wa -c "import sys; sys.meta_path = None; import logging"

--

___
Python tracker 

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



[issue21050] Failure to import win32api (from pywin32)

2014-03-24 Thread Thomas Heller

Thomas Heller added the comment:

It was most certainly an issue on my side, something with leftover files or 
directories from a previous installation.  After cleaning everything up it 
works now.  Sorry for the confusion.

(A personal remark: sometimes, the bdist_wininst uninstaller does not remove 
all directories that it has created - possibly because there are files leftover 
which the installer didn't create and so the uninstaller does not remove.  This 
leaves directories on sys.path which have no __init__.py? files, but they can 
be imported as 'namespace module' although they no functionality.  I don't find 
this useful...)

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue21046] Document formulas used in statistics

2014-03-24 Thread Alextp

Alextp added the comment:

I wrote not ok formula for median_grouped. But i can't get idea from source. 
THIS SHOWS that source code is NOT ok doc, even student can't get it
 
e.g. pvariance.
Calculates population variance of iterable. It's given by formula:

pvariance([x1, x2, ..., xN]) = ((x1 - M)**2 + ... + (xN - M)**2) / N,
where M is mean of all values:
M = (x1 + ... + xN) / N

--

___
Python tracker 

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



[issue21051] incorrect utf-8 conversion with c api

2014-03-24 Thread STINNER Victor

STINNER Victor added the comment:

In the C language, \u must be escaped as "\\u".

--

___
Python tracker 

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



[issue21051] incorrect utf-8 conversion with c api

2014-03-24 Thread David Zámek

New submission from David Zámek:

I use python 2.7.6 on win32.

If I enter u'\u010d'.encode('utf-8') to console, I get '\xc4\x8d' as response. 
That's correct.

But it I use C API for the same, I get incorrect '\xc3\xa8' as response. 

I was testing it on this program:

#include 
int main() {
Py_Initialize();
PyObject* dict = PyDict_New();
PyRun_String("u'\u010d'.encode('utf-8')", Py_single_input, dict, dict);
Py_DECREF(dict);
}

--
components: Unicode
messages: 214693
nosy: dzaamek, ezio.melotti, haypo
priority: normal
severity: normal
status: open
title: incorrect utf-8 conversion with c api
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



[issue21046] Document formulas used in statistics

2014-03-24 Thread Alextp

Alextp added the comment:

I'm author or topic

I suggest to give simple formulas. for ex -

1) mean. 
Calculates sum of all values in iterable, divided by number of elements. 
E.g. 
mean([x1, x2, ..., xN]) = (x1 + x2 + ... + xN) / N

2) median. 
Calculates value with middle index from iterable. 
If number of elements is even, ie no strict middle index exists, then function 
takes average of two values at two indexes near middle.

E.g.
median([x1, x2, x3, x4, x5]) = x3
median([x1, x2, x3, x4, x5, x6]) = (x3 + x4) / 2

3) median_low.
 Calculates value with middle index from iterable. 
If number of elements is even, ie no strict middle index exists, then function 
takes value at near index, lower than middle.


4) median_high.
 Calculates value with middle index from iterable. 
If number of elements is even, ie no strict middle index exists, then function 
takes value at near index, higher than middle.

5) median_grouped.
(((NOTE!! I may not understand median_grouped OK)))
Calculates average of values of iterable at L given middle indexes.

E.g.
median_grouped([x1, x2, x3, x4, x5], L=3) = (x2+x3+x4)/3

NOTE: pls check this!

--
nosy: +Alextp

___
Python tracker 

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



[issue21050] Failure to import win32api (from pywin32)

2014-03-24 Thread Brett Cannon

Brett Cannon added the comment:

For those that don't read German, the exception says "The specified module 
could not be found".

Anyway, what looks suspicious to me is this line that gets imported by 
pywintypes:

# extension module loaded from 
'C:\\Python34\\lib\\site-packages\\win32\\_win32sysloader.pyd'

That module's name suggests it might be critical. I also wonder what is going 
on with your sys.path as pywintypes is coming from 
site-packages\win32\lib\pywintypes.py while win32api is coming from 
site-packages\\win32\\win32api.pyd (notice how pywintypes is in some lib 
subidrectory and win32api is not). That suggests to me that something is 
mucking with sys.path somewhere to make this require the ordering.

--

___
Python tracker 

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



[issue21049] Flood of “ImportWarning: sys.meta_path is empty” after exception with socket subclass

2014-03-24 Thread Brett Cannon

Brett Cannon added the comment:

This might be a shutdown issue. If you print out what module is being imported 
at the time of the warning its 'io' and it's only coming up after the script 
has exited (you will notice the warnings come up after the traceback is 
printed). My guess is some cleanup code that gets called a lot is trying to 
import io after shutdown cleanup has blasted sys.meta_path.

I should also mention that if you raise an exception instead of print the 
warning nothing shows up, which is another indicator that this is a 
shutdown-related issue since that could quite easily consume the exception.

Antoine, any ideas on what might be going on?

--
nosy: +brett.cannon, pitrou

___
Python tracker 

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



[issue21035] Python's HTTP server implementations hangs after 16.343 requests on MacOSX

2014-03-24 Thread Ronald Oussoren

Ronald Oussoren added the comment:

You could trace using dtruss (as root), which behaves similarly to strace.

What happens when you first set "http_proxy" in the environment:

$ env http_proxy= python -m SimpleHTTPServer

If that doesn't cause problems the hang is caused by the _scproxy extension, 
which urllib uses to get the system proxy settings on OSX.

--

___
Python tracker 

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



[issue20992] reading individual bytes of multiple binary files using the Python module fileinput

2014-03-24 Thread Berker Peksag

Changes by Berker Peksag :


--
stage:  -> needs patch
versions: +Python 3.5 -Python 3.3, Python 3.4

___
Python tracker 

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



[issue20135] FAQ need list mutation answers

2014-03-24 Thread M. Volz

M. Volz added the comment:

Thanks David,

I've updated the patch to move the default values question into the programming 
FAQ where you recommended it go, and also changed the title of the mutable list 
question.

--
Added file: http://bugs.python.org/file34604/sortFAQ_defaultval.patch

___
Python tracker 

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



[issue17975] libpython3.so conflicts between $VERSIONs

2014-03-24 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

'make altinstall' installs libpython3.so.

--

___
Python tracker 

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



[issue17975] libpython3.so conflicts between $VERSIONs

2014-03-24 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Patrick: it is very difficult to track an issue with shifting focus, since it 
is never clear what the actual issue is.

Please confirm that it is consensus that
1. It is desired and correct behavior that python3.so is a conflicting file
2. It is possible to avoid the conflict by making "make alt install"

If so, can you please restate what you think the issue is that you want to see 
resolved?

Why do you say it is impossible to install packages for both python 3.2 and 
python 3.3? Works perfectly fine for me.

--

___
Python tracker 

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



[issue21044] tarfile does not handle file .name being an int

2014-03-24 Thread R. David Murray

Changes by R. David Murray :


--
title: tarfile does not handle file __name__ being an int -> tarfile does not 
handle file .name being an int

___
Python tracker 

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



  1   2   >