[issue14373] C implementation of functools.lru_cache

2012-12-21 Thread Alexey Kachayev

Alexey Kachayev added the comment:

Serhiy, thank you for review. Working further on fixes.

--

___
Python tracker 

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



[issue16728] Missing cross-reference in sequence glossary entry

2012-12-21 Thread Nick Coghlan

Nick Coghlan added the comment:

Many algorithms that require a sequence only need __len__ and __getitem__. The 
term "sequence" is used to distinguish such containers from mere iterables that 
only provide "__iter__" (and may be consumed by iteration). The glossary entry 
covers this use of the term.

collections.abc.Sequence is a much richer interface, which defines many 
additional operations beyond those iteration, indexing and slicing. Types which 
implement that full API can be registered explicitly (or else an application 
can define it's own custom ABC for a subset of the Sequence API).

However, the glossary entry should link to 
http://docs.python.org/3.3/library/stdtypes#sequence-types-list-tuple-range to 
expand on the second meaning of the term.

PySequence_Check is an unreliable guide (albeit not quite as unreliable as 
PyMapping_Check) that checks a CPython implementation detail.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python, ncoghlan
stage:  -> needs patch
title: collections.abc.Sequence shoud provide __subclasshook__ -> Missing 
cross-reference in sequence glossary entry
type:  -> enhancement

___
Python tracker 

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



[issue16728] Missing cross-reference in sequence glossary entry

2012-12-21 Thread Nick Coghlan

Nick Coghlan added the comment:

As Amaury notes, implicit ducktyping is not feasible for sequences or mappings, 
as the method names overlap - you have to add explicit semantic information to 
say which kind of container you're implementing.

--

___
Python tracker 

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



[issue16728] Missing cross-reference in sequence glossary entry

2012-12-21 Thread INADA Naoki

INADA Naoki added the comment:

Thanks, Nick.

I see that the "sequence" doesn't have strict definition.

Though, I think collections.abc module's document should describe
this manner. For example:

"But checking type with these abc may be too strict for most case.
For example, some user defined sequence class may not cover
:class:`Sequence` abc. Using :term:`EAFP` manner is preferred in Python."

--

___
Python tracker 

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



[issue16694] Add pure Python operator module

2012-12-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

About length_hint():

I were mean something like (even explicit getattr() not needed):

try:
hint = type(obj).__length_hint__
except AttributeError:
return default
try:
val = hint(obj)
except TypeError:
return default
...

This is a little faster because there is only one attribute lookup instead two. 
This is a little safer because there is a little less chance of race when an 
attribute changed between two lookups (it is enough non-probably and doesn't 
matter).

There is type(obj) here because the C code uses _PyObject_LookupSpecial() which 
doesn't honor instance attributes and looks only class attributes.


About concat() and iconcat():

I think only first argument can be checked. If arguments are not concatenable 
then '+'/'+=' operator will raise an exception. I'm not sure. Does anyone have 
any thoughts about this?


About methodcaller():

Here is a catch. With this implementation you can't use `methodcaller('foo', 
name='spam')` or `methodcaller('foo', self='spam')` (please add tests for those 
cases). Here is a trick needed:

def __init__(*args, **kwargs):
self = args[0]
self._name = args[1]
self._args = args[2:]
self._kwargs = kwargs

(You can add a code for better error reporting).


I have added smaller comments on Rietveld.

--

___
Python tracker 

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



[issue16735] zipfile.is_zipfile wrongly recognizes non-zip as zip

2012-12-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

zipinfo detects /usr/bin/zip as a zip archive too.

--

___
Python tracker 

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



[issue16728] Missing cross-reference in sequence glossary entry

2012-12-21 Thread Nick Coghlan

Nick Coghlan added the comment:

No, that runs counter to the purpose of ABCs. If you have a type that is "good 
enough" for your purposes, then you can just register it.

--

___
Python tracker 

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



[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe

2012-12-21 Thread Trent Nelson

New submission from Trent Nelson:

Relevant thread: 
http://mail.python.org/pipermail/python-dev/2012-December/123225.html

PyOS_StdioReadline features numerous calls that require the GIL to be held.  
Ideally, the GIL drop-take should be moved closer to the actual underlying read 
system call.

--
assignee: trent
components: Interpreter Core
messages: 177874
nosy: trent
priority: normal
severity: normal
stage: needs patch
status: open
title: PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread 
safe
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue16480] pyvenv 3.3 fails to create symlinks for /local/{bin, lib} to /{bin, lib}

2012-12-21 Thread Matthias Klose

Matthias Klose added the comment:

fixed in experimental, pyvenv's are now handled the same way as 
python-virtualenvs. closing the issue here.

--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue16365] IDLE for Windows 8

2012-12-21 Thread amundell

amundell added the comment:

I had a similar issue in Win8, but occured after installing another program. My 
issue was related to the TCL_Library environment variable. If it is related to 
this error it can be confirmed by opening the command prompt, changing dir to 
cd c:\python33\ and typing python. Once python has started write import 
idlelib.idle. If idle does not start, read the errors and check to see if a 
TCL-related error has been generated. If this error has occured change the 
environment variable (ControlPanel\right click System\change settings\advanced 
tab\environment variable\select TCL_Library. Alter the the path to 
C:\Python33\tcl\tcl8.5. idle should then start. However you may have 
issues/conflict with other installed programs that access the TCL_Library. Hope 
this helps.

--
nosy: +amundell

___
Python tracker 

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



[issue16728] Missing cross-reference in sequence glossary entry

2012-12-21 Thread INADA Naoki

INADA Naoki added the comment:

So, I feel the 2nd meaning of "sequence" should be 
collections.abc.(Mutable)Sequence.

"sequence types in stdlib" have richer API then the ABC. (e.g. comparison, +, 
*, etc...)
They are "APIs that sequence may have" but not "APIs makes the type sequence."

--

___
Python tracker 

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



[issue16728] Missing cross-reference in sequence glossary entry

2012-12-21 Thread INADA Naoki

INADA Naoki added the comment:

And nice symmetry with mapping entry.

--

___
Python tracker 

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



[issue16743] mmap accepts files > 1 GB, but processes only 1 GB

2012-12-21 Thread Marc Schlaich

New submission from Marc Schlaich:

Platform: Windows 7 64 bit
Interpreter: Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit 
Intel)] on win32

Here are the steps to reproduce:

1. Create a big file (5 GB):

with open('big', 'wb') as fobj:
for _ in xrange(1024 * 1024 * 5):
fobj.write('1' + '0' * 1023)

2. Open and process it with `mmap`:

import mmap
import re
import sys

with open('big', 'rb') as fobj:
data = mmap.mmap(fobj.fileno(), 0, access=mmap.ACCESS_READ)
print data.size()
try:
counter = 0
for match in re.finditer('1' + '0' * 1023, data):
counter += 1
print len(data[1073740800:1073741824]) # (1 GB - 1024, 1 GB)
print len(data[1073741824:1073742848]) # (1 GB, 1 GB + 1024)
finally:
data.close()

print counter

This returns the following lines:

5368709120
1024
0
1048576

So this is a behavioral issue. `mmap` accepts a file which cannot fit in the 
interpreter memory but fits in the system memory. On processing the data, it 
only reads data until the maximum interpreter memory is reached (1 GB).

--
components: None
messages: 177879
nosy: schlamar
priority: normal
severity: normal
status: open
title: mmap accepts files > 1 GB, but processes only 1 GB
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue16731] xxlimited/xxmodule docstrings ambiguous

2012-12-21 Thread Daniel Shahaf

Daniel Shahaf added the comment:

Re the review, yes there is a typo in the comment: the comment in xxlimited.c 
should say "xxmodule.c" rather than "xxlimited.c".  (Got a traceback from the 
review app)

--

___
Python tracker 

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



[issue16744] sys.path.append causes wrong behaviour

2012-12-21 Thread rappy

New submission from rappy:

In bug.py print gives

['C:\\Users\\Glenn\\Desktop', 'C:\\Windows\\system32\\python27.zip', 
C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 
'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 
'C:\\Python27\\lib\\site-packages', 
'C:\\Users\\Glenn\\Documents\\ua\\mosis\x07ssignment6']

What it should give is

['C:\\Users\\Glenn\\Desktop', 'C:\\Windows\\system32\\python27.zip', 
C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 
'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 
'C:\\Python27\\lib\\site-packages', 
'C:\\Users\\Glenn\\Documents\\ua\\mosis\assignment6']

--
components: Library (Lib)
files: bug.py
messages: 177881
nosy: rappy
priority: normal
severity: normal
status: open
title: sys.path.append causes wrong behaviour
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file28384/bug.py

___
Python tracker 

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



[issue16744] sys.path.append causes wrong behaviour

2012-12-21 Thread Christian Heimes

Christian Heimes added the comment:

You have to either quote the backslashes or use raw strings:

>>> "\a"
'\x07'
>>> "\\a"
'\\a'
>>> r"\a"
'\\a'

--
nosy: +christian.heimes
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue16745] Hide symbols in _decimal.so

2012-12-21 Thread Stefan Krah

New submission from Stefan Krah:

This issue is for the _decimal specific parts from #4555. The patch
depends on _Pragma (C99) and gcc >= 4.0 for the contents of the pragma.
I think it will work for clang, too.

Should the libmpdec API symbols (i.e. the ones starting with mpd_*)
be hidden for _decimal.c, too?

--
assignee: skrah
components: Extension Modules
files: libmpdec-hide-non-api-symbols.diff
keywords: patch
messages: 177883
nosy: skrah
priority: normal
severity: normal
status: open
title: Hide symbols in _decimal.so
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file28385/libmpdec-hide-non-api-symbols.diff

___
Python tracker 

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



[issue16737] Different behaviours in script run directly and via runpy.run_module

2012-12-21 Thread Éric Araujo

Éric Araujo added the comment:

FTR, distutils only recommends and supports running “python setup.py”, i.e. 
relative path in the script’s directory.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue16713] "tel" URIs should support params

2012-12-21 Thread Éric Araujo

Éric Araujo added the comment:

It’s easy sure, but I think it’s still a bug :)

--
nosy: +eric.araujo

___
Python tracker 

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



[issue16731] xxlimited/xxmodule docstrings ambiguous

2012-12-21 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo, loewis

___
Python tracker 

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



[issue16745] Hide symbols in _decimal.so

2012-12-21 Thread Stefan Krah

Stefan Krah added the comment:

Adding everyone from issue #4555, in case you can think of a different
(portable) solution for hiding symbols (with minimal effort).

--
nosy: +christian.heimes, dmalcolm, doko, lemburg, loewis, pitrou

___
Python tracker 

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



[issue16694] Add pure Python operator module

2012-12-21 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue16651] Find out what stdlib modules lack a pure Python implementation

2012-12-21 Thread Éric Araujo

Éric Araujo added the comment:

Oops, sorry I slipped :)

--

___
Python tracker 

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



[issue16745] Hide symbols in _decimal.so

2012-12-21 Thread Meador Inge

Changes by Meador Inge :


--
nosy: +meador.inge

___
Python tracker 

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



[issue16737] Different behaviours in script run directly and via runpy.run_module

2012-12-21 Thread Vinay Sajip

Vinay Sajip added the comment:

> FTR, distutils only recommends and supports running “python setup.py”, i.e. 
> relative path in the script’s directory.

Right, but this behaviour is seen even when the script is in the current 
directory.

--

___
Python tracker 

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



[issue14373] C implementation of functools.lru_cache

2012-12-21 Thread Alexey Kachayev

Alexey Kachayev added the comment:

Fixed my previous patch according to all comments from review, except removing 
keyword arguments from lru_cache_new function.

--
Added file: http://bugs.python.org/file28386/14373.v3.diff

___
Python tracker 

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



[issue16745] Hide symbols in _decimal.so

2012-12-21 Thread Meador Inge

Meador Inge added the comment:

Personally I prefer using attributes instead of pragmas.  The GCC manual 
recommends such as well.  There are also other sources in Modules/* that use 
'__attribute__ ((visibility ("hidden")))'.  Namely ctypes and zlib.

I can understand that it is more work, but I find something like the following 
more readable (I am not actually suggesting names here, just an example):

   #define PY_LOCAL __attribute__ ((visibility ("hidden")))

   ...

   void foo(void) PY_LOCAL;
   void bar(void) PY_LOCAL;

--

___
Python tracker 

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



[issue16651] Find out what stdlib modules lack a pure Python implementation

2012-12-21 Thread Meador Inge

Meador Inge added the comment:

I noticed functools in the list.  issue14373 was opened somewhat recently to 
reimplement functools.lru_cache in C.  This issue seems to be promoting have 
more things implemented in pure Python.  Someone involved in this issue might 
want to weigh in on issue14373 if that is the case.

--
nosy: +meador.inge

___
Python tracker 

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



[issue16651] Find out what stdlib modules lack a pure Python implementation

2012-12-21 Thread Philip Jenvey

Philip Jenvey added the comment:

The guidelines for this are in PEP 399. Basically, adding 'accelerated' 
implementations when necessary isn't a bad thing as long as there are pure 
Python equivalents (unless it's a special case) and both are tested.

issue14373's latest patch seems to be following the PEP

--

___
Python tracker 

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



[issue13863] import.c sometimes generates incorrect timestamps on Windows + NTFS

2012-12-21 Thread Mark Dickinson

Mark Dickinson added the comment:

Whoops.  int.from_bytes doesn't exist in Python 2.7.

--
Added file: http://bugs.python.org/file28387/pyc_mtime4.patch

___
Python tracker 

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



[issue16745] Hide symbols in _decimal.so

2012-12-21 Thread Stefan Krah

Stefan Krah added the comment:

Meador Inge  wrote:
> Personally I prefer using attributes instead of pragmas.  The GCC manual 
> recommends such as well.

I followed www.akkadia.org/drepper/dsohowto.pdf . Drepper seems to be fine
with the use of pragmas in internal headers.

> There are also other sources in Modules/* that use '__attribute__ 
> ((visibility ("hidden")))'.  Namely ctypes and zlib.

They do, but for a tiny amount of functions. mpdecimal.h, which is internal
as far as _decimal.so is concerned, also needs to be changed. There you have
something like 200 lines of

[...]
void mpd_qrescale(mpd_t *result, const mpd_t *a, mpd_ssize_t exp, const 
mpd_context_t *ctx, uint32_t *status) Py_HIDDEN;
void mpd_qrescale_fmt(mpd_t *result, const mpd_t *a, mpd_ssize_t exp, const 
mpd_context_t *ctx, uint32_t *status) Py_HIDDEN;
[...],

which increases the size of the diff between the standalone libmpdec and the
one shipped with Python.

--

___
Python tracker 

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



[issue16694] Add pure Python operator module

2012-12-21 Thread Zachary Ware

Zachary Ware added the comment:

Here's another new version.  Changes include:

- Address Serhiy's Rietveld comments
- Fix length_hint() the way it was meant to be fixed last time.
- Remove __getitem__ check on 'b' in concat and iconcat.  More notes on this 
below.
- Fix methodcaller as Serhiy suggested
- Add test case for methodcaller for 'name' and 'self' keyword arguments
- Add comments to 'subdivide' the module into the rough sections the docs are 
divided into.  Move length_hint() with other sequence operations to also match 
the doc order.

On concat and iconcat: Looking at the glossary, a sequence should actually have 
both __getitem__ and __len__.  The test class in the test case for iconcat only 
defines __getitem__, though.  Should we check only for __getitem__ on the first 
argument, or check for both __getitem__ and __len__, and add __len__ to the 
test class?  Requiring __len__ may cause breakage for anyone using the Python 
implementation with a class they defined and used with the C implementation 
with only __getitem__, so I'm leaning towards only checking for __getitem__.  I 
can't really tell what the C implementation really looks for as I don't speak 
C, but it almost looks to me like it may be only checking for __getitem__.  
Latest patch only checks argument 'a' for __getitem__.

--
Added file: http://bugs.python.org/file28388/py_operator.v5.diff

___
Python tracker 

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



[issue16745] Hide symbols in _decimal.so

2012-12-21 Thread Meador Inge

Meador Inge added the comment:

Ah, I missed how big of a line range these pragmas are covering when I scanned 
the patch before.  In that case, I agree with the current patch.

--

___
Python tracker 

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



[issue16746] clarify what should be sent to peps@

2012-12-21 Thread Chris Jerdonek

New submission from Chris Jerdonek:

Currently, PEP 1 can be read to mean that  should be CC'ed on 
all e-mails related to PEPs.  However, this isn't the intent because, for 
example, it is okay to have discussions about PEPs on python-dev or 
python-ideas without involving .

I'm attaching a patch to clarify this language.

[This issue is from: 
http://mail.python.org/pipermail/python-dev/2012-December/123251.html ]

--
keywords: easy
messages: 177897
nosy: chris.jerdonek
priority: normal
severity: normal
status: open
title: clarify what should be sent to peps@

___
Python tracker 

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



[issue16746] clarify what should be sent to peps@

2012-12-21 Thread Chris Jerdonek

Changes by Chris Jerdonek :


--
keywords: +patch
Added file: http://bugs.python.org/file28389/issue-16746-1.patch

___
Python tracker 

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



[issue16743] mmap accepts files > 1 GB, but processes only 1 GB

2012-12-21 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
components: +Library (Lib), Windows -None
nosy: +brian.curtin, tim.golden
versions: +Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue16651] Find out what stdlib modules lack a pure Python implementation

2012-12-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm involved in both issues and I think it's good to have so much simple Python 
implementations as possible and to have C accelerators for any performance 
critical code.

--

___
Python tracker 

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



[issue16694] Add pure Python operator module

2012-12-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Good work, Zachary. I have no more nitpicks for you. ;)

LGTM.

--
stage: patch review -> commit review

___
Python tracker 

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



[issue16496] Simplify and optimize random_seed()

2012-12-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset db75553ff333 by Mark Dickinson in branch 'default':
Simplify random_seed to use _PyLong_AsByteArray.  Closes issue #16496.
http://hg.python.org/cpython/rev/db75553ff333

--
nosy: +python-dev

___
Python tracker 

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



[issue16496] Simplify and optimize random_seed()

2012-12-21 Thread Mark Dickinson

Changes by Mark Dickinson :


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

___
Python tracker 

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



[issue16694] Add pure Python operator module

2012-12-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

One comment to a committer. Don't forget to run `hg rename Modules/operator.c 
Modules/_operator.c` before applying the patch.

--

___
Python tracker 

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



[issue16694] Add pure Python operator module

2012-12-21 Thread Zachary Ware

Zachary Ware added the comment:

Nits are no fun; thank you for picking them, Serhiy ;)

--

___
Python tracker 

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



[issue14373] C implementation of functools.lru_cache

2012-12-21 Thread Alexey Kachayev

Alexey Kachayev added the comment:

Added additional Py_DECREF(s) for key and value.

--
Added file: http://bugs.python.org/file28390/14373.v4.diff

___
Python tracker 

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



[issue16745] Hide symbols in _decimal.so

2012-12-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 24f6c6f3b7bf by Stefan Krah in branch '3.3':
Issue #16745: Hide a couple of symbols by making them local.
http://hg.python.org/cpython/rev/24f6c6f3b7bf

--
nosy: +python-dev

___
Python tracker 

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



[issue16746] clarify what should be sent to peps@

2012-12-21 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon
nosy: +brett.cannon
priority: normal -> low
stage:  -> patch review

___
Python tracker 

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



[issue16746] clarify what should be sent to peps@

2012-12-21 Thread R. David Murray

R. David Murray added the comment:

The editors do more than your sentence suggests.  They also (sometimes) edit 
peps, (sometimes) provide advice about preparing one, and commit and update 
peps when the author(s) do not have commit access.

The distinction in the types of email that PEP 1 is attempting to make is the 
distinction between public discussions of the PEP (which go to python-dev or 
python-ideas) and semi-private discussions about the mechanics of preparing and 
posting and updating PEPs, which should go to all the pep editors (thus the 
instruction to cc the list).

In other words, if you want non-editors involved in the discussion, post to 
python-dev or whatnot, and do *not* CC the PEP editors.  All other PEP matters 
should go to the PEP editors, and *not* be CCed to any other list.

That's what the original text says, but admittedly you have to parse it like a 
computer would to understand that :)

--
assignee: brett.cannon -> 
nosy: +r.david.murray
priority: low -> normal
stage: patch review -> 

___
Python tracker 

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



[issue16682] Document that audioop works with bytes, not strings

2012-12-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Patch looks good to me, all three occurrences of 'string' are fixed.

--
nosy: +terry.reedy
stage: patch review -> commit review

___
Python tracker 

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



[issue16694] Add pure Python operator module

2012-12-21 Thread Éric Araujo

Éric Araujo added the comment:

FYI Mercurial can use the extended diff format invented by git, which supports 
renames, changes to file permissions, etc.

--

___
Python tracker 

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



[issue16694] Add pure Python operator module

2012-12-21 Thread Éric Araujo

Éric Araujo added the comment:

The base test class should not inherit from TestCase: it will be picked up by 
test discovery and then will break, as self.module will be None.

Typical usage:

class OperatorTestsMixin:
module = None

class COperatorTests(OperatorTestsMixin, unittest.TestCase):
module = _operator

--

___
Python tracker 

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



[issue16684] Unicode property value abbreviated names and long names

2012-12-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

This seems like a plausible request to me. The three dicts comprise 70 
code-alias pairs. If unicodedata had a Python version (should it?), the 
simplest thing would be to add bididict, eawdist, and gcdict to that version 
(and not to the C version). I don't know how well putting dicts in C code 
works. A unicodealias module could be added but I do not really like that idea. 
I would prefer adding data attributes and correspond docs to the current module.

Pander: submitting a proof-of-concept script that accesses and parses that url 
and produces ready-to-go python code like below might encourage adoption of 
your proposal. In any case, it would be here for others to use.

bididict = {
'AL': 'Arabic_Letter',
...
'WS': 'White_Space',
}

eawdict = ...

--
nosy: +loewis, terry.reedy

___
Python tracker 

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



[issue16694] Add pure Python operator module

2012-12-21 Thread Zachary Ware

Zachary Ware added the comment:

Did not know that about test discovery, thank you Éric.  Fixed in v6.

A few other test modules may need the same fix; I based my changes to 
Lib/test/test_operator.py on Lib/test/test_heapq.py which has the same issue.  
I'll open a new report for it and any others I find.

Also, this patch was created with `hg diff -g`; the operator.c rename should be 
well taken care of by this patch.

--
Added file: http://bugs.python.org/file28391/py_operator.v6.diff

___
Python tracker 

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



[issue16747] Remove 'file' type reference from 'iterable' glossary entry

2012-12-21 Thread Zachary Ware

New submission from Zachary Ware:

Here's a patch that changes the reference to :class:`file` in the iterable 
entry in Doc/glossary.rst to :term:`file objects `, along with 
minor grammatical fixes to make it fit, and reflowing of the text.

--
assignee: docs@python
components: Documentation
files: iterable_glossary.diff
keywords: patch
messages: 177911
nosy: docs@python, zach.ware
priority: normal
severity: normal
status: open
title: Remove 'file' type reference from 'iterable' glossary entry
versions: Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file28392/iterable_glossary.diff

___
Python tracker 

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



[issue16686] audioop overflow issues

2012-12-21 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +terry.reedy

___
Python tracker 

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



[issue16689] stdout stderr redirection mess

2012-12-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Is that really the simplest example that will exhibit the cited behavior? 

Why do you think this is a Python issue rather than a Windows issue?
What happens, for instance, with a C program than alternately outputs to stdout 
and stderr?

--
nosy: +terry.reedy
versions:  -Python 2.6, Python 3.1

___
Python tracker 

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



[issue16709] unittest discover order is filesystem specific - hard to reproduce

2012-12-21 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions:  -Python 3.1, Python 3.5

___
Python tracker 

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



[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2012-12-21 Thread Zachary Ware

New submission from Zachary Ware:

As pointed out by Éric Araujo in msg177908 of issue16694, tests using the idiom 
presented in PEP 399 are subject to breakage of test discovery.  This issue's 
goal is to root out and fix all usages of this idiom.

So far, only test_heapq is known to be affected.

As for fixing the issue, each module get its own mixin class, or should a 
simple class such as:

class TestPyAndCMixin:
module = None

be added to test.support?

--
components: Tests
messages: 177913
nosy: eric.araujo, zach.ware
priority: normal
severity: normal
status: open
title: Ensure test discovery doesn't break for modules testing C and Python 
implementations
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue16712] collections.abc.Sequence should not provide __reversed__

2012-12-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I would expect that the default method of reversed() and 
collections.abc.Sequence.__reverse__ are more or less the same. If so, this 
should be closed as invalid. But I want to hear from the abc experts.

--
nosy: +rhettinger, stutzbach, terry.reedy
versions:  -Python 3.5

___
Python tracker 

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



[issue16741] `int()`, `float()`, etc think python strings are null-terminated

2012-12-21 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions:  -Python 2.6, Python 3.1

___
Python tracker 

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



[issue16741] `int()`, `float()`, etc think python strings are null-terminated

2012-12-21 Thread Matthew Barnett

Matthew Barnett added the comment:

Python takes a long way round when converting strings to int. It does the 
following (I'll be talking about Python 3.3 here):

1. In function 'fix_decimal_and_space_to_ascii', the different kinds of spaces 
are converted to " " and the different kinds of digits are converted to their 
equivalents in the ASCII range;

2. The resulting string is converted to UTF-8;

3. The resulting string is passed to 'PyLong_FromString', which expects a 
null-terminated string.

4. If 'PyLong_FromString' is unable to parse the string as an int, it builds an 
error message using the string that was passed into it, which it does by 
converting that string _back_ into Unicode.

As a result of step 4, the string that's reported as the value in the error 
message is _not_ necessarily correct.

For example:

>>> int("\N{ARABIC-INDIC DIGIT ONE}")
1
>>> int("#\N{ARABIC-INDIC DIGIT ONE}")
Traceback (most recent call last):
  File "", line 1, in 
int("#\N{ARABIC-INDIC DIGIT ONE}")
ValueError: invalid literal for int() with base 10: '#1'

And it also means a "\x00" and anything after it will be omitted:

>>> int("foo\x00bar")
Traceback (most recent call last):
  File "", line 1, in 
int("foo\x00bar")
ValueError: invalid literal for int() with base 10: 'foo'

And in a final point, 'PyLong_FromString' limits the length of the value it 
reports in the error message, and the code that does it includes this line:

slen = strlen(orig_str) < 200 ? strlen(orig_str) : 200;

--
nosy: +mrabarnett

___
Python tracker 

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



[issue16743] mmap accepts files > 1 GB, but processes only 1 GB

2012-12-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The immediate fix is to use a 64 bit build. That aside, what change in behavior 
are you suggesting? (and for 32 bit builds only?)

Should mmap.mmap warn if the file is longer that would be supported?
This could be added to all current versions.

Should it raise in the same circumstance? What is a person *knows* that the 
file is 'too big' but only wants to access the first gigabyte? Forcing people 
to explicitly pass the magic number 1073741824 would, to me, effectively be a 
3.4-at-best api change.

Perhaps mmap.mmap should be left alone and only the attempt to access beyond 
the cutoff should raise or warn. (Is the 32-bit cutoff OS specific?) Given that 
there are multiple access methods and methods that access, and that all 
accesses are ultimately delegated to the os mmap functions, this could be major 
nuisance to get right.

Now that disks have grown to larger than a gigabyte, the doc should explicitly 
mention the memory space issue.

--
nosy: +terry.reedy
stage:  -> needs patch
type: behavior -> enhancement
versions:  -Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue16749] Fatal Python Error

2012-12-21 Thread R. David Murray

R. David Murray added the comment:

Given the error message, my guess would be that there is a bug in the 
Solidoodle Python extension module.  That is, it is unlikely to be a bug in 
Python.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue16749] Fatal Python Error

2012-12-21 Thread Leonardo DaVinci

Leonardo DaVinci added the comment:

Ok thanks for the quick reply. I'll check with them.

Regards
Ciro

On Fri, Dec 21, 2012 at 9:09 PM, R. David Murray wrote:

>
> R. David Murray added the comment:
>
> Given the error message, my guess would be that there is a bug in the
> Solidoodle Python extension module.  That is, it is unlikely to be a bug in
> Python.
>
> --
> nosy: +r.david.murray
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue16712] collections.abc.Sequence should not provide __reversed__

2012-12-21 Thread INADA Naoki

INADA Naoki added the comment:

I believe that using Sequence ABC as mix-in is recommended when implementing 
custom sequence.

But mixing-in it violates "should only provide __reversed__() if they can
 provide an implementation that is more efficient than the one
provided by reversed()."


Defining __reversed__ in Sequence ABC also means that classes doesn't have
__reversed__ aren't Sequence. While not implementing it is recommended
for most cases.

--

___
Python tracker 

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



[issue16749] Fatal Python Error

2012-12-21 Thread Leonardo DaVinci

Leonardo DaVinci added the comment:

Hi David,

I keep trying to unsuccessfully. Here's the problem details

  Problem signature:
  Problem Event Name: APPCRASH
  Application Name: python.exe
  Application Version: 0.0.0.0
  Application Timestamp: 4f84a6c8
  Fault Module Name: python27.dll
  Fault Module Version: 2.7.3150.1013
  Fault Module Timestamp: 4f84a6c7
  Exception Code: 4015
  Exception Offset: 0006016a
  OS Version: 6.1.7601.2.1.0.256.1
  Locale ID: 3084
  Additional Information 1: 8c07
  Additional Information 2: 8c07c320598b1e31bf5de83aa7155e8f
  Additional Information 3: 8e83
  Additional Information 4: 8e835205385ec5be9858c1342251f482

Hope this helps

Regards
Ciro

On Fri, Dec 21, 2012 at 9:09 PM, R. David Murray wrote:

>
> R. David Murray added the comment:
>
> Given the error message, my guess would be that there is a bug in the
> Solidoodle Python extension module.  That is, it is unlikely to be a bug in
> Python.
>
> --
> nosy: +r.david.murray
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2012-12-21 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue16689] stdout stderr redirection mess

2012-12-21 Thread anatoly techtonik

anatoly techtonik added the comment:

I don't know. I don't write C.

--

___
Python tracker 

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



[issue16750] Python Code module implements uncomputable function

2012-12-21 Thread pleed

New submission from pleed:

The "code" class implements the __eq__ operator which is known to be 
uncomputable.

--
messages: 177923
nosy: pleed
priority: normal
severity: normal
status: open
title: Python Code module implements uncomputable function
type: behavior
versions: Python 2.7

___
Python tracker 

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