[sphinx-dev] Sphinx 1.1 released

2011-10-10 Thread Georg Brandl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi all,

I'm happy to announce the release of Sphinx 1.1, a new feature release.

The full changelog is at http://sphinx.pocoo.org/changes.html.

Highlights
==

* Added Python 3.x support.
* Added a Texinfo builder.
* Added i18n support for content, a ``gettext`` builder and related
  utilities.
* Added the ``websupport`` library and builder.
* Added a ``sphinx-apidoc`` script that autogenerates a hierarchy
  of source files containing autodoc directives to document modules
  and packages.
* Added an `index` role, to make inline index entries.
* Added the :mod:`sphinx.ext.mathjax` extension.

What is it?
===

Sphinx is a tool that makes it easy to create intelligent and beautiful
documentation for Python projects (or other documents consisting of
multiple reStructuredText source files).

Website: http://sphinx.pocoo.org/


cheers,
Georg
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)

iEYEARECAAYFAk6SE6QACgkQN9GcIYhpnLD/cgCbBMABuQe3pTIfSekXaNtPC47r
IVUAoI5PzoWpIZr7I2wUZOXOIm3awHOW
=Do0C
-END PGP SIGNATURE-
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: Usefulness of the not in operator

2011-10-10 Thread Alexander Kapps

On 08.10.2011 18:08, Steven D'Aprano wrote:


Let's define the boolean values and operators using just two functions:


[SNIP]

Have you just explained Church booleans in an understandable 
language? Awesome. I still have to chew on this, but I think this is 
the first time where I might understand it. Thanks!


Even if it's off-topic, could you add some similar explanations for 
Church numerals (maybe Lambda calculus it isn't too much?)


--
http://mail.python.org/mailman/listinfo/python-list


Re: Usefulness of the not in operator

2011-10-10 Thread John Ladasky
On Oct 8, 5:01 am, Steven D'Aprano steve
+comp.lang.pyt...@pearwood.info wrote:

 Who like that second one speaks?

Yoda his name is.  Programs in Forth he must.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Usefulness of the not in operator

2011-10-10 Thread Alec Taylor
On Sun, Oct 9, 2011 at 3:08 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
 Roy Smith wrote:

 If you want to take it one step further, all the boolean operators can
 be derived from nand (the dualists would insist on using nor).

 Let's define the boolean values and operators using just two functions:

 def true(x, y):
    return x

 def false(x, y):
    return y


 That's all we need to define all of Boolean algebra. Unfortunately, it's a
 bit ugly in Python:

 true
 function true at 0xb7c3a36c

 So let's add a helper function to prettify the output:

 def pr(b):
    print(b(true, false).__name__)

 pr(true)
 true

 Much nicer!


 Now define NAND:

 def Nand(a, b):
    return (lambda c: lambda x, y: c(y, x))(a(b, a))


 and we're done. All of boolean algebra can now be derived from Nand.


 def Not(b):
 ...     return Nand(b, b)
 ...
 pr(Not(true))
 false
 pr(Not(false))
 true


 def And(a, b):
 ...     return Nand(Nand(a, b), Nand(a, b))
 ...
 pr(And(true, false))
 false
 pr(And(true, true))
 true


 def Or(a, b):
 ...     return Nand(Nand(a, a), Nand(b, b))
 ...
 pr(Or(true, false))
 true
 pr(Or(false, false))
 false


 def Xor(a, b):
 ...     return And(Nand(a, b), Or(a, b))
 ...
 pr(Xor(true, false))
 true
 pr(Xor(true, true))
 false


 and so forth.



 --
 Steven

 --
 http://mail.python.org/mailman/listinfo/python-list


Awesome
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Usefulness of the not in operator

2011-10-10 Thread Alain Ketterlin
Alec Taylor alec.tayl...@gmail.com writes:

 On Sun, Oct 9, 2011 at 3:08 AM, Steven D'Aprano
 steve+comp.lang.pyt...@pearwood.info wrote:

 def true(x, y):
    return x

 def false(x, y):
    return y
[...]
 def Nand(a, b):
    return (lambda c: lambda x, y: c(y, x))(a(b, a))

 and we're done. [...]

 Awesome

Yes, that's how Church defined booleans in the lambda calculus. See
http://en.wikipedia.org/wiki/Church_encoding for encodings of natural
numbers and lists.

-- Alain.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Usefulness of the not in operator

2011-10-10 Thread Alec Taylor
Unfortunately I don't know lambda [or for that matter, regular] calculus...

On Tue, Oct 11, 2011 at 12:01 AM, Alain Ketterlin
al...@dpt-info.u-strasbg.fr wrote:
 Alec Taylor alec.tayl...@gmail.com writes:

 On Sun, Oct 9, 2011 at 3:08 AM, Steven D'Aprano
 steve+comp.lang.pyt...@pearwood.info wrote:

 def true(x, y):
    return x

 def false(x, y):
    return y
 [...]
 def Nand(a, b):
    return (lambda c: lambda x, y: c(y, x))(a(b, a))

 and we're done. [...]

 Awesome

 Yes, that's how Church defined booleans in the lambda calculus. See
 http://en.wikipedia.org/wiki/Church_encoding for encodings of natural
 numbers and lists.

 -- Alain.
 --
 http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Usefulness of the not in operator

2011-10-10 Thread candide

Le 10/10/2011 10:06, John Ladasky a écrit :


Who like that second one speaks?


Yoda his name is.  Programs in Forth he must.



;)


We can add to the list :

-- Tarzan
-- Geronimo
-- don Alexandro de la Vega dying in the arms of Zorro
...

--
http://mail.python.org/mailman/listinfo/python-list


Re: OpenGL.GLU.gluNewQuadric() segmentation fault on 64 bit systems

2011-10-10 Thread Ulrich Eckhardt

Am 10.10.2011 14:18, schrieb X1:

has this bug been resolved?
if yes, which version on files to install?


That seems to be part of PyOpenGL, so I'd check their bugtracking system.

Uli
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python Migration Error: TypeError: exceptions must be old-style classes or derived from BaseException, not str

2011-10-10 Thread 88888 dihedral
I am thinking with the power of python evolving in different versions, if a 
feature is not desired in the new version, then the new version could also 
provide some script tools, of course in python,  to convert codes in old styles 
into new styles automatically. 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Usefulness of the not in operator

2011-10-10 Thread Nobody
On Sun, 09 Oct 2011 02:25:27 +0200, Alexander Kapps wrote:

 Even if it's off-topic, could you add some similar explanations for 
 Church numerals (maybe Lambda calculus it isn't too much?)

The Church numeral for N is a function of two arguments which applies its
first argument N times to its second, i.e. (f^N)(x) = f(f(...(f(x))...)).

IOW:

def zero(f, x):
return x

def one(f, x):
return f(x)

def two(f, x):
return f(f(x))

def three(f, x):
return f(f(f(x)))

And so on.

In general:

def applyN(n, f, x):
for i in xrange(n):
x = f(x)
return x

def church(n):
return lambda f, x: applyN(n, f, x)

seven = church(7)   # this is the Church numeral for 7

 seven(lambda x: x + 1, 0)
7
 seven(lambda x: x * 2, 1)
128
 seven(lambda x: x + ., )
'...'


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Usefulness of the not in operator

2011-10-10 Thread Chris Angelico
On Tue, Oct 11, 2011 at 4:29 AM, Nobody nob...@nowhere.com wrote:

 The Church numeral for N is a function of two arguments which applies its
 first argument N times to its second, i.e. (f^N)(x) = f(f(...(f(x))...)).


Thanks - nice clear explanation. Appreciated. For an encore, can you
give an example of where this is actually useful? It seems a pretty
narrow utility.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Usefulness of the not in operator

2011-10-10 Thread Ian Kelly
On Mon, Oct 10, 2011 at 11:33 AM, Chris Angelico ros...@gmail.com wrote:
 On Tue, Oct 11, 2011 at 4:29 AM, Nobody nob...@nowhere.com wrote:

 The Church numeral for N is a function of two arguments which applies its
 first argument N times to its second, i.e. (f^N)(x) = f(f(...(f(x))...)).


 Thanks - nice clear explanation. Appreciated. For an encore, can you
 give an example of where this is actually useful? It seems a pretty
 narrow utility.

It's useful for writing mathematical theorems about computability with
regard to the natural numbers using lambda calculus.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [NUMPY] ValueError: total size of new array must be unchanged just on Windows

2011-10-10 Thread Paolo Zaffino
On Mac OS there is numpy 1.2.1, on Fedora 14 64bits numpy 1.4.1 and on
Ubuntu 10.04 64bits numpy 1.3.0.
On these platforms my function runs without problems.
Just on Windows it doesn't works.


2011/10/9 Yaşar Arabacı yasar11...@gmail.com

 I don't know about your problem, but did you compare numpy versions in
 windows and other platforms? You may have newer/older version in Windows.
 Otherwise, it looks like a platform spesific bug to me.

 2011/10/9 Paolo Zaffino zaffin...@gmail.com

 Hello,
 I wrote a function that works on a numpy matrix and it works fine on
 Mac OS and GNU/Linux (I didn't test it on python 3)
 Now I have a problem with numpy: the same python file doesn't work on
 Windows (Windows xp, python 2.7 and numpy 2.6.1).
 I get this error:

 matrix=matrix.reshape(a, b, c)
 ValueError: total size of new array must be unchanged

 Why? Do anyone have an idea about this?
 Thank you very much.
 --
 http://mail.python.org/mailman/listinfo/python-list




 --
 http://yasar.serveblog.net/


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Migration Error: TypeError: exceptions must be old-style classes or derived from BaseException, not str

2011-10-10 Thread Terry Reedy

On 10/10/2011 11:13 AM, 8 dihedral wrote:

I am thinking with the power of python evolving in different
versions, if a feature is not desired in the new version, then the
new version could also provide some script tools, of course in
python,  to convert codes in old styles into new styles
automatically.


That is what the 2to3 script does. It could use some updating. A 3to2 
script using the same tools is available somewhere. Someone could write 
a 32to33 script for the few things removed in 3.3.


--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


Re: Usefulness of the not in operator

2011-10-10 Thread Terry Reedy

On 10/10/2011 1:55 PM, Ian Kelly wrote:

On Mon, Oct 10, 2011 at 11:33 AM, Chris Angelicoros...@gmail.com  wrote:

On Tue, Oct 11, 2011 at 4:29 AM, Nobodynob...@nowhere.com  wrote:


The Church numeral for N is a function of two arguments which applies its
first argument N times to its second, i.e. (f^N)(x) = f(f(...(f(x))...)).



Thanks - nice clear explanation. Appreciated. For an encore, can you
give an example of where this is actually useful? It seems a pretty
narrow utility.


It's useful for writing mathematical theorems about computability with
regard to the natural numbers using lambda calculus.


Whereas pure set theorists define counts as sets so they can work with 
counts within the context of pure set theory (in which everything is a 
set). Other mathematicians use an axiomatic definition which pretty much 
abstracts the common features of the set and function definitions.


--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


Question: Optional Regular Expression Grouping

2011-10-10 Thread galyle
HI, I've looked through this forum, but I haven't been able to find a
resolution to the problem I'm having (maybe I didn't look hard enough
-- I have to believe this has come up before).  The problem is this:
I have a file which has 0, 2, or 3 groups that I'd like to record;
however, in the case of 3 groups, the third group is correctly
captured, but the first two groups get collapsed into just one group.
I'm sure that I'm missing something in the way I've constructed my
regular expression, but I can't figure out what's wrong.  Does anyone
have any suggestions?

The demo below showcases the problem I'm having:

import re

valid_line = re.compile('^\[(\S+)\]\[(\S+)\](?:\s+|\[(\S+)\])=|\s+[\d\
[\']+.*$')
line1 = [field1][field2] = blarg
line2 = 'a continuation of blarg'
line3 = [field1][field2][field3] = blorg

m = valid_line.match(line1)
print 'Expected: ' + m.group(1) + ', ' + m.group(2)
m = valid_line.match(line2)
print 'Expected: ' + str(m.group(1))
m = valid_line.match(line3)
print 'Uh-oh: ' + m.group(1) + ', ' + m.group(2)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Regex to match all trailing whitespace _and_ newlines.

2011-10-10 Thread Dotan Cohen
On Thu, Sep 1, 2011 at 13:30, Peter Otten __pete...@web.de wrote:
 Dotan Cohen wrote:

 In the terrific Anki [1] application I am trying to remove trailing
 whitespace from form fields. This is my regex:
 [\n+\s+]$

 My attempt:

 sub = re.compile(r\s*?(\n|$)).sub
 sub(EOL, alpha   \nbeta   \r\n\ngamma\n)
 'alphaEOLbetaEOLEOLgammaEOL'
 sub(EOL, alpha   \nbeta   \r\n\ngamma)
 'alphaEOLbetaEOLEOLgammaEOL'
 sub(EOL, alpha   \nbeta   \r\n\ngamma\t)
 'alphaEOLbetaEOLEOLgammaEOL'


Hi Peter, sorry for the _late_ reply.

It turns out that Anki stores newlines internally as br, since its
display model is based on HTML. Thanks, though!


-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question: Optional Regular Expression Grouping

2011-10-10 Thread MRAB

On 10/10/2011 22:57, galyle wrote:

HI, I've looked through this forum, but I haven't been able to find a
resolution to the problem I'm having (maybe I didn't look hard enough
-- I have to believe this has come up before).  The problem is this:
I have a file which has 0, 2, or 3 groups that I'd like to record;
however, in the case of 3 groups, the third group is correctly
captured, but the first two groups get collapsed into just one group.
I'm sure that I'm missing something in the way I've constructed my
regular expression, but I can't figure out what's wrong.  Does anyone
have any suggestions?

The demo below showcases the problem I'm having:

import re

valid_line = re.compile('^\[(\S+)\]\[(\S+)\](?:\s+|\[(\S+)\])=|\s+[\d\
[\']+.*$')
line1 = [field1][field2] = blarg
line2 = 'a continuation of blarg'
line3 = [field1][field2][field3] = blorg

m = valid_line.match(line1)
print 'Expected: ' + m.group(1) + ', ' + m.group(2)
m = valid_line.match(line2)
print 'Expected: ' + str(m.group(1))
m = valid_line.match(line3)
print 'Uh-oh: ' + m.group(1) + ', ' + m.group(2)


Instead of \S I'd recommend using [^\]], or using a lazy repetition
\S+?.

You'll also need to handle the space before the = in line3.

valid_line = 
re.compile(r'^\[(\[^\]]+)\]\[(\[^\]]+)\](?:\s+|\[(\[^\]]+)\])\s*=|\s+[\d\[\']+.*$')

--
http://mail.python.org/mailman/listinfo/python-list


Re: Question: Optional Regular Expression Grouping

2011-10-10 Thread Vlastimil Brom
2011/10/10 galyle gal...@gmail.com:
 HI, I've looked through this forum, but I haven't been able to find a
 resolution to the problem I'm having (maybe I didn't look hard enough
 -- I have to believe this has come up before).  The problem is this:
 I have a file which has 0, 2, or 3 groups that I'd like to record;
 however, in the case of 3 groups, the third group is correctly
 captured, but the first two groups get collapsed into just one group.
 I'm sure that I'm missing something in the way I've constructed my
 regular expression, but I can't figure out what's wrong.  Does anyone
 have any suggestions?

 The demo below showcases the problem I'm having:

 import re

 valid_line = re.compile('^\[(\S+)\]\[(\S+)\](?:\s+|\[(\S+)\])=|\s+[\d\
 [\']+.*$')
 line1 = [field1][field2] = blarg
 line2 =     'a continuation of blarg'
 line3 = [field1][field2][field3] = blorg

 m = valid_line.match(line1)
 print 'Expected: ' + m.group(1) + ', ' + m.group(2)
 m = valid_line.match(line2)
 print 'Expected: ' + str(m.group(1))
 m = valid_line.match(line3)
 print 'Uh-oh: ' + m.group(1) + ', ' + m.group(2)
 --
 http://mail.python.org/mailman/listinfo/python-list


Hi,
I believe, the space before = is causing problems (or the pattern missing it);
you also need non greedy quantifiers +? to match as little as possible
as opposed to the greedy default:

valid_line = 
re.compile('^\[(\S+?)\]\[(\S+?)\](?:\s+|\[(\S+)\])\s*=|\s+[\d\[\']+.*$')

or you can use word-patterns explicitely excluding the closing ], like:

valid_line = 
re.compile('^\[([^\]]+)\]\[([^\]]+)\](?:\s+|\[([^\]]+)\])\s*=|\s+[\d\[\']+.*$')

hth
 vbr
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question: Optional Regular Expression Grouping

2011-10-10 Thread Ian Kelly
On Mon, Oct 10, 2011 at 4:49 PM, MRAB pyt...@mrabarnett.plus.com wrote:
 Instead of \S I'd recommend using [^\]], or using a lazy repetition
 \S+?.

Preferably the former.  The core problem is that the regex matches
ambiguously on the problem string.  Lazy repetition doesn't remove
that ambiguity; it merely attempts to make the module prefer the match
that you prefer.

Other notes to the OP:  Always use raw strings (r'') when writing
regex patterns, to make sure the backslashes are escape characters in
the pattern rather than in the string literal.

The '^foo|bar$' construct you're using is wonky.  I think you're
writing this to mean match if the entire string is either 'foo' or
'bar'.  But what that actually matches is anything that either
starts with 'foo' or ends with 'bar'.  The correct way to do the
former would be either '^foo$|^bar$' or '^(?:foo|bar)$'.
-- 
http://mail.python.org/mailman/listinfo/python-list


Any tradeoffs or cautions in using virtualenv?

2011-10-10 Thread python
We're thinking about using virtualenv to isolate our development
enivronments.

Are there any tradeoffs or cautions we should consider before
going this route?

Are there other alternatives to virtualenv that we should
consider?

We are using Python 2.7 (32-bit) on Windows 7 Professional and
Windows Server 2008.

Malcolm
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question: Optional Regular Expression Grouping

2011-10-10 Thread galyle
On Oct 10, 4:59 pm, Vlastimil Brom vlastimil.b...@gmail.com wrote:
 2011/10/10 galyle gal...@gmail.com:









  HI, I've looked through this forum, but I haven't been able to find a
  resolution to the problem I'm having (maybe I didn't look hard enough
  -- I have to believe this has come up before).  The problem is this:
  I have a file which has 0, 2, or 3 groups that I'd like to record;
  however, in the case of 3 groups, the third group is correctly
  captured, but the first two groups get collapsed into just one group.
  I'm sure that I'm missing something in the way I've constructed my
  regular expression, but I can't figure out what's wrong.  Does anyone
  have any suggestions?

  The demo below showcases the problem I'm having:

  import re

  valid_line = re.compile('^\[(\S+)\]\[(\S+)\](?:\s+|\[(\S+)\])=|\s+[\d\
  [\']+.*$')
  line1 = [field1][field2] = blarg
  line2 =     'a continuation of blarg'
  line3 = [field1][field2][field3] = blorg

  m = valid_line.match(line1)
  print 'Expected: ' + m.group(1) + ', ' + m.group(2)
  m = valid_line.match(line2)
  print 'Expected: ' + str(m.group(1))
  m = valid_line.match(line3)
  print 'Uh-oh: ' + m.group(1) + ', ' + m.group(2)
  --
 http://mail.python.org/mailman/listinfo/python-list

 Hi,
 I believe, the space before = is causing problems (or the pattern missing it);
 you also need non greedy quantifiers +? to match as little as possible
 as opposed to the greedy default:

 valid_line = 
 re.compile('^\[(\S+?)\]\[(\S+?)\](?:\s+|\[(\S+)\])\s*=|\s+[\d\[\']+.*$')

 or you can use word-patterns explicitely excluding the closing ], like:

 valid_line = 
 re.compile('^\[([^\]]+)\]\[([^\]]+)\](?:\s+|\[([^\]]+)\])\s*=|\s+[\d\[\']+. 
 *$')

 hth
  vbr

Thanks, I had a feeling that greedy matching in my expression was
causing problem.  Your suggestion makes sense to me, and works quite
well.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Usefulness of the not in operator

2011-10-10 Thread Tim Roberts
Westley Martínez aniko...@gmail.com wrote:
On Sat, Oct 08, 2011 at 12:34:42PM -0400, Roy Smith wrote:
 
 Here's my take on parenthesis:  If you need to look up whether they're 
 necessary or not, they are :-)

So we don't need precedence charts in the bathroom?

Yes, we do, because I'm always reading code from other people that didn't
follow that rule.
-- 
Tim Roberts, t...@probo.com
Providenza  Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue8087] Unupdated source file in traceback

2011-10-10 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

(just reviewing the idea here, not the current patch)

The problem of stale code (i.e. what was executed doesn't match what is 
displayed in the traceback) is a tricky and subtle one. There are a few 
different cases:

1. Source displayed does not match source on disk
- these cases do happen, but they're almost always due to straight up bugs in 
the linecache or traceback modules.
2. Source has been changed, but module has not been reloaded
- this is the case for edited source file but forgot to reload module. I've 
certainly forgotten to do this myself, and I'm far from the only one. This is 
the case Diego's RFE targets, and I think it has some merit.
3. Source has been changed, module has been reloaded, but object reference is 
from previous version of module
- the patch doesn't detect this. There are various ways we *could* detect it, 
but they all involve some fairly significant changes to the way compilation and 
module import work.

Aspect 3 is a much deeper (and bigger) problem relating to native introspection 
support in function and class objects. But that doesn't make Diego's idea to 
improve Aspect 2 invalid - there have certainly been times when playing at the 
interactive prompt that such a warning would have reminded me that I needed to 
reload the module I was working on.

--
nosy: +ncoghlan

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



[issue2945] bdist_rpm does not list dist files (should effect upload)

2011-10-10 Thread Carl Robben

Carl Robben carl.rob...@gmail.com added the comment:

Here's a patch for test_bdist_rpm.py and to check the contents of 
dist.dist_files

--
Added file: http://bugs.python.org/file23363/test_bdist_rpm.patch

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



[issue2945] bdist_rpm does not list dist files (should effect upload)

2011-10-10 Thread Carl Robben

Carl Robben carl.rob...@gmail.com added the comment:

Adding a patch for 2.7

--
Added file: http://bugs.python.org/file23364/bdist_rpm-2.7.patch

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



[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

2011-10-10 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


Removed file: http://bugs.python.org/file23355/issue12753-4.diff

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



[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

2011-10-10 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


Added file: http://bugs.python.org/file23365/issue12753-4.diff

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



[issue11776] types.MethodType() params and usage is not documented

2011-10-10 Thread Guandalino

Changes by Guandalino guandal...@gmail.com:


--
nosy: +guandalino

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



[issue13143] os.path.islink documentation is ambiguous

2011-10-10 Thread Eric V. Smith

Changes by Eric V. Smith e...@trueblade.com:


--
nosy: +eric.smith, jason.coombs

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



[issue1673007] urllib2 requests history + HEAD support

2011-10-10 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Attached an updated patch that addresses the comments of Éric in the review and 
adds an entry to the whatsnew.

--
assignee: orsenthil - ezio.melotti
keywords: +needs review
nosy:  -BreamoreBoy
stage: patch review - commit review
Added file: http://bugs.python.org/file23366/issue1673007.diff

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



[issue13144] Global Module Index link in the offline documentation is incorrect

2011-10-10 Thread Graeme Glass

New submission from Graeme Glass graemegl...@gmail.com:

On my machine (Ubuntu 11.04) the link to Python Module Index from the index 
page is incorrect in the Indices and tables section (it links to
modindex.html instead of py-modindex.html).
It links to the correct place in the navigation bar at the top right of the 
page.

Navigation (Correct): 
li class=right 
a href=py-modindex.html title=Python Module Indexmodules/a 
|/li

In the body (Incorrect):
 pstrongIndices and tables:/strong/p
  ...
  p class=biglinka class=biglink href=modindex.htmlGlobal Module 
Index/abr/
  ...

This seems to affect python2.6 and python2.7 documentation.

(Indices and tables) link for these files:
file:///usr/share/doc/python2.6/html/index.html
file:///usr/share/doc/python2.6-doc/html/index.html

Link to: 
file:///usr/share/doc/python2.6/html/modindex.html
file:///usr/share/doc/python2.6-doc/html/modindex.html

When they should link to:
file:///usr/share/doc/python2.6/html/py-modindex.html
file:///usr/share/doc/python2.6-doc/html/py-modindex.html

Likewise:
file:///usr/share/doc/python2.7/html/index.html
file:///usr/share/doc/python2.7-doc/html/index.html

Link to:
file:///usr/share/doc/python2.7/html/modindex.html
file:///usr/share/doc/python2.7-doc/html/modindex.html

When they should link to:
file:///usr/share/doc/python2.7/html/py-modindex.html
file:///usr/share/doc/python2.7-doc/html/py-modindex.html

I searched the python bug tracker for a similar issue and could not find one.
I do not know if this affects python3.x Documentation also as I do not have it 
installed so have not checked. 
I am not sure if this is an Ubuntu issue or Python Docs Issue.

--
assignee: docs@python
components: Documentation
messages: 145295
nosy: docs@python, graemeglass
priority: normal
severity: normal
status: open
title: Global Module Index link in the offline documentation is incorrect
versions: Python 2.6, Python 2.7

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



[issue13062] Introspection generator and function closure state

2011-10-10 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

No, the naming problem had occurred to me as well. Given the 'vars' builtin, 
perhaps 'getclosurevars' would do as the name?

--

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



[issue13145] Documentation of PyNumber_ToBase() wrong

2011-10-10 Thread Sven Marnach

New submission from Sven Marnach s...@marnach.net:

The documentation of PyNumber_ToBase() [1] states

When base is not 2, 8, 10, or 16, the format is 'x#num'
where x is the base.

In reality, the function does not accept any bases different
from 2, 8, 10, or 16, as can be seen in the source code of 
_PyLong_Form() [2], which is called from PyNumber_ToBase() to
do the actual conversion.

The patch fixes the documentation.

[1]: http://docs.python.org/c-api/number.html#PyNumber_ToBase
[2]: http://hg.python.org/cpython/file/f924e0f62bcb/Objects/longobject.c#l1663

--
assignee: docs@python
components: Documentation
files: pynumber-tobase-doc.patch
keywords: patch
messages: 145297
nosy: docs@python, smarnach
priority: normal
severity: normal
status: open
title: Documentation of PyNumber_ToBase() wrong
Added file: http://bugs.python.org/file23367/pynumber-tobase-doc.patch

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



[issue1673007] urllib2 requests history + HEAD support

2011-10-10 Thread Senthil Kumaran

Senthil Kumaran sent...@uthcode.com added the comment:

Hi Ezio, I had probably overlooked this one. But It's a very interesting one
for  me. Do you mind if I commit it ?
On Oct 10, 2011 7:20 PM, Ezio Melotti rep...@bugs.python.org wrote:


 Ezio Melotti ezio.melo...@gmail.com added the comment:

 Attached an updated patch that addresses the comments of Éric in the review
 and adds an entry to the whatsnew.

 --
 assignee: orsenthil - ezio.melotti
 keywords: +needs review
 nosy:  -BreamoreBoy
 stage: patch review - commit review
 Added file: http://bugs.python.org/file23366/issue1673007.diff

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue1673007
 ___
 ___
 Python-bugs-list mailing list
 Unsubscribe:
 http://mail.python.org/mailman/options/python-bugs-list/senthil%40uthcode.com



--

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



[issue13143] os.path.islink documentation is ambiguous

2011-10-10 Thread Jason R. Coombs

Jason R. Coombs jar...@jaraco.com added the comment:

Thanks Garen for the detailed analysis and writeup. The short answer to your 
question is supported by the Python runtime. Allow me to provide a bit of 
history.

Symlink awareness under Windows was added to Python in Python 3.2, so the 
behavior you see in Python 2.7 is somewhat historical - in particular, islink 
was implemented to always return False. In hindsight, this decision was 
probably a poor one, because it doesn't allow for forward compatibility.

Unfortunately, due to the compatibility rules of Python versions, this cannot 
change. The semantic meaning of ntpath.islink (and thus os.path.islink on 
Windows) cannot change.

The suggestion to update the documentation to reflect this behavior is  a good 
one. I will extend the Python 3.1 and earlier docs to clarify this detail.

One suggestion for the client: to accurately determine if the Python runtime 
supports symlinks, check hasattr(os, 'symlink'), whereafter you'll know if the 
runtime supports symlinks and whether os.link will return anything other than 
False.

--
assignee:  - jason.coombs

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



[issue13062] Introspection generator and function closure state

2011-10-10 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

 perhaps 'getclosurevars' would do as the name?

I like vars.  Updated patch attached.

--
Added file: http://bugs.python.org/file23368/issue13062-3.patch

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



[issue13143] os.path.islink documentation is ambiguous

2011-10-10 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

 Symlink awareness under Windows was added to Python in Python 3.2

If they are not available on Windows with 2.7, the doc should get an 
availability: unix or something similar (depending on where they are actually 
supported), or mention explicitly symlink for Windows are not supported.

 I will extend the Python 3.1 and earlier docs to clarify this detail.

3.1 only gets security fixes, so only 2.7/3.2/default should be updated.

--
components: +Documentation
nosy: +ezio.melotti
stage:  - needs patch
versions: +Python 3.3

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



[issue1673007] urllib2 requests history + HEAD support

2011-10-10 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

I made some more comments.

--

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



[issue11776] types.MethodType() params and usage is not documented

2011-10-10 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
keywords: +easy
versions: +Python 2.7, Python 3.3

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



[issue3902] Packages containing only extension modules have to contain __init__.py

2011-10-10 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

You did not reply to my first question on apiref.rst, and you did not rewrap 
your lines to 80 chars :)

--

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



[issue13055] Distutils tries to handle null versions but fails

2011-10-10 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 The bug was encountered while trying to install a package. As it turns
 out, a dependency was incorrectly installed, resulting in a null
 version being passed around which quickly caused a crash in setup.py.
 While this is definitely not a normal circumstance, the fact that this
 bug existed made finding the issue substantially more time consuming.
I agree.  You don’t happen to have the log available, do you?

 If the constructor of the LooseVersion can accept None, then so should
 its other members.
Sure.  From a quick glance, we need to fix __str__ and _cmp.

--
keywords: +easy -patch
stage: test needed - needs patch

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



[issue2945] bdist_rpm does not list dist files (should effect upload)

2011-10-10 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Looks good.  Do you have rpm on your machine?  If yes, have you run the tests 
successfully?

--
stage: needs patch - patch review

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



[issue12436] Missing items in installation/setup instructions

2011-10-10 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Thanks, I will take all contributions and suggestions and propose one patch.

--
assignee: docs@python - eric.araujo

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



[issue12602] Missing cross-references in Doc/using

2011-10-10 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 For new doc editors, it would be nicer if the filename (directory name, 
 actually)
 had been changed to 'py_setup' or even 'py_usage'.
py_setup would conflict with pysetup, the installer part of 
distutils2/packaging.  py_ seems redundant to me, we are in the Python docs.

 Looking in the first chapter, which you finally referenced, I do see an entry 
 for
 'script', with the brackets, that can be both a target and container of 
 links. That
 usage, with a generic argument name in angle brackets, may be unique in the 
 docs. (I
 looked at trace, profile, pydoc, timeit, test, and doctest docs.) So don't be 
 so
 surprised that others are not familiar with it. 
I however am familiar with the use of brackets, $SHELL-LIKE-DOLLAR, 
OPTPARSE-LIKE-ALLCAPS or even {str-format-like-braces} to mark up 
metavariables.  “Use python -m module or python -c YOUR CODE HERE or python 
path/to/script” is no problem; maybe it is because other documentation (man 
pages?) I’m familiar with use it.  (I even see them in email, like in “$deity 
knows etc.”)

 +1 on the links suggested in the original message.
I’ll put up a patch for review.

 -1 on a link to the tracker issue.
I’ll see if I can add a few lines with the gist of the bug report, then.

--
assignee:  - eric.araujo

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



[issue13062] Introspection generator and function closure state

2011-10-10 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

In reviewing Meador's patch (which otherwise looks pretty good), I had a 
thought about the functionality and signature of getclosurevars().

Currently, it equates closure to nonlocal scope, which isn't really true - 
the function's closure is really the current binding of *all* of its free 
variables, and that includes globals and builtins in addition to the lexically 
scoped variables from outer scopes.

So what do people think about this signature:

  ClosureVars = namedtuple(ClosureVars, nonlocals globals builtins unbound)
  def getclosurevars(func):
Returns a named tuple of dictionaries of the current nonlocal, global 
and builtin references as seen by the body of the function. A final set of 
unbound names is also provided.
# figure out nonlocal_vars (current impl)
# figure out global_vars (try looking up names in f_globals)
# figure out builtin_vars (try looking up names in builtins)
# any leftover names go in unbound_vars
return ClosureVars(nonlocal_vars, global_vars, builtin_vars, unbound_vars)

Also, something that just occurred to me is that getclosurevars() should work 
for already instantiated generator iterators as well as generator functions, so 
the current typecheck may need to be made a bit more flexible.

--

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



[issue12393] Packaging should provide support for extensible categories

2011-10-10 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

 Can you add tests?

https://bitbucket.org/vinay.sajip/pythonv/changeset/f7c5098e3c3b

--

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



[issue13119] Newline for print() is \n on Windows, and not \r\n as expected

2011-10-10 Thread M. Zilmer

M. Zilmer mzdkm...@gmail.com added the comment:

Just to make it clear: I have not observed any problems on the Windows terminal 
(cmd) with \n newline, but at least Notepad does not break lines correctly if 
only \n is used.

--

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



[issue3902] Packages containing only extension modules have to contain __init__.py

2011-10-10 Thread Mike Hoy

Mike Hoy mho...@gmail.com added the comment:

Responded to first question in apiref and uploaded a new patch that wraps lines 
at 80 characters.

--
Added file: http://bugs.python.org/file23369/apiref-setupscript-v3.diff

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



[issue8087] Unupdated source file in traceback

2011-10-10 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +eric.snow

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



[issue12602] Missing cross-references in Doc/using

2011-10-10 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

I was not necessary suggesting that the filename actually be changed, just that 
the mapping between docs and filenames is not always obvious. I will somedays 
look at the dev docs doc page and see if I have any further suggestions to help.

Add 'in the Python doc context' after 'not familiar with it'. I *am* familiar 
with text in monofont ascii text and use it, for instance, in newsgroup 
posts. But unlike man pages, the Python docs are not so restricted and, except 
in this instance, use italics for parameter names. I suggest that it do so in 
this instance also, using *script* (in bold-faced italic) as the entry title.

--

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



[issue13146] Writing a pyc file is not atomic

2011-10-10 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

One of the buildbots recently showed the following failure:

==
ERROR: test_rapid_restart 
(test.test_multiprocessing.WithProcessesTestManagerRestart)
--
Traceback (most recent call last):
  File 
/var/lib/buildslave/3.x.murray-gentoo/build/Lib/test/test_multiprocessing.py, 
line 1442, in test_rapid_restart
queue = manager.get_queue()
  File 
/var/lib/buildslave/3.x.murray-gentoo/build/Lib/multiprocessing/managers.py, 
line 670, in temp
token, exp = self._create(typeid, *args, **kwds)
  File 
/var/lib/buildslave/3.x.murray-gentoo/build/Lib/multiprocessing/managers.py, 
line 568, in _create
conn = self._Client(self._address, authkey=self._authkey)
  File 
/var/lib/buildslave/3.x.murray-gentoo/build/Lib/multiprocessing/connection.py,
 line 778, in XmlClient
import xmlrpc.client as xmlrpclib
  File /var/lib/buildslave/3.x.murray-gentoo/build/Lib/xmlrpc/client.py, line 
137, in module
import http.client
  File /var/lib/buildslave/3.x.murray-gentoo/build/Lib/http/client.py, line 
69, in module
import email.parser
  File /var/lib/buildslave/3.x.murray-gentoo/build/Lib/email/parser.py, line 
12, in module
from email.feedparser import FeedParser
  File /var/lib/buildslave/3.x.murray-gentoo/build/Lib/email/feedparser.py, 
line 28, in module
from email import policy
EOFError: EOF read where not expected

(http://www.python.org/dev/buildbot/all/builders/x86%20Gentoo%203.x/builds/942/steps/test/logs/stdio)

EOF read where not expected comes from reading a pyc file in marshal.c. It is 
raised when the pyc file is somehow truncated or incomplete. Writing and 
reading the same pyc file is protected by the import lock when in a single 
interpreter, but not when running several Python processes at the same time 
(which test_multiprocessing obviously does).

Under POSIX, import.c could do the traditional write-then-rename dance which 
guarantees that the file contents appear atomically.
And so could importlib.

--
components: Interpreter Core
messages: 145313
nosy: brett.cannon, ncoghlan, pitrou, r.david.murray
priority: normal
severity: normal
status: open
title: Writing a pyc file is not atomic
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

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



[issue12659] Add tests for packaging.tests.support

2011-10-10 Thread Francisco Martín Brugué

Francisco Martín Brugué franci...@email.de added the comment:

The patch is updated. Let me know if I've understood your review.
Thanks !

--
Added file: http://bugs.python.org/file23370/issue12659_v3.patch

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



[issue13062] Introspection generator and function closure state

2011-10-10 Thread Ron Adam

Changes by Ron Adam ron3...@gmail.com:


--
nosy: +ron_adam

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



[issue13055] Distutils tries to handle null versions but fails

2011-10-10 Thread Ben Gamari

Ben Gamari bgam...@gmail.com added the comment:

Sorry, no log is available.

--

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



[issue13147] Multiprocessing Pool.map_async() does not have an error_callback parameter

2011-10-10 Thread Jakub Gedeon

New submission from Jakub Gedeon kazagis...@gmail.com:

Multiprocessing Pool.map_async() does not have an error_callback paramter as 
described here 
http://docs.python.org/library/multiprocessing.html#multiprocessing.pool.multiprocessing.Pool.map_async

I assume this is an old configuration that no longer works... I tried to call 
that parameter by name and I got a Type Error, plus the actual documentation 
does not mention it at all (and it is missing from similar functions). 
Recommend it be removed from the documentation, or else better described and 
implemented.

--
assignee: docs@python
components: Documentation
messages: 145316
nosy: Jakub.Gedeon, docs@python
priority: normal
severity: normal
status: open
title: Multiprocessing Pool.map_async() does not have an error_callback 
parameter
versions: Python 2.7

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



[issue6715] xz compressor support

2011-10-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

*Very* good news for lzma on windows: The precompiled static library liblzma.a 
works very well with MSVC (tested with VS2008 on Windows XP, 32bit).  This was 
a surprise for me...

Here is a patch for the win32 build files, to be applied after Nadeem's.
I did not update the svn external repository, for my local copy I simply 
extracted xz-5.0.3-windows.zip.
Tests pass in release and debug builds, and depends.exe shows no special 
requirements for _lzma.pyd.  I could not test win64.

Nadeem, in test.support precisionbigmemtest was recently renamed to bigmemtest, 
could you update your patch?

--
Added file: http://bugs.python.org/file23371/lzma-win32.diff

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



[issue12602] Missing cross-references in Doc/using

2011-10-10 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Don't feel bad about not recognising the context - this stuff wasn't documented 
at all for a long time, and it wasn't until Georg pointed me to the usage docs 
that I realised adding it there would be the right place. I should have 
remembered that and been less cryptic when creating this issue.

It may suggest a meta-issue though - perhaps 'Documenting Python' should grow a 
devguide-style description of the Docs layout in source control, with a pointer 
from the devguide's directory layout description [1]?

[1] http://docs.python.org/devguide/setup.html#directory-structure

--

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



[issue13148] simple bug in mmap size check

2011-10-10 Thread Maxim Yanchenko

New submission from Maxim Yanchenko maxim.yanche...@gs.com:

The condition contradicts the exception text:
if (offset = st.st_size) {
PyErr_SetString(PyExc_ValueError,
mmap offset is greater than file size);
return NULL;
}
The condition should be changed to (offset  st.st_size), similar to the later 
condition which is correct:
} else if (offset + (size_t)map_size  st.st_size) {
PyErr_SetString(PyExc_ValueError,
mmap length is greater than file size);
return NULL;
}

The patch is attached.

--
components: Library (Lib)
files: mmap-greater.patch
keywords: patch
messages: 145319
nosy: jazzer
priority: normal
severity: normal
status: open
title: simple bug in mmap size check
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file23372/mmap-greater.patch

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



[issue8065] Memory leak in readline.get_current_history_length

2011-10-10 Thread Garrett Cooper

Garrett Cooper yaneg...@gmail.com added the comment:

As a note for future reference, FreeBSD/NetBSD/OpenBSD doesn't use the term 
bug, but instead uses the term problem report (the NetBSD website says 
bug though BTW).

The PR system for NetBSD can be accessed here: 
http://www.netbsd.org/cgi-bin/sendpr.cgi?gndb=netbsd .

--
nosy: +yaneurabeya

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



[issue13148] simple bug in mmap size check

2011-10-10 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Well, you have to understand what this code does: it tries to prevent 
non-meaningful offsets. If the offset is equal to the file size, mapping from 
that offset would not map anything in the file (and the system call may 
actually fail).

--
nosy: +pitrou
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue13149] optimization for append-only StringIO

2011-10-10 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

io.StringIO is quite slower than ''.append() when used for mass concatenation 
(around 5x slower). This patch brings it to similar performance by deferring 
construction of the internal buffer until needed.

The problem is that it's very easy to disable the optimization by calling a 
method other than write() and getvalue().

--
components: IO
files: stringio.patch
keywords: patch
messages: 145322
nosy: haypo, pitrou
priority: normal
severity: normal
status: open
title: optimization for append-only StringIO
type: performance
versions: Python 3.3
Added file: http://bugs.python.org/file23373/stringio.patch

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



[issue13148] simple bug in mmap size check

2011-10-10 Thread Maxim Yanchenko

Maxim Yanchenko maxim.yanche...@gs.com added the comment:

First of all, it doesn't fail (at least on Linux), I tested it before posting.

And the latest, it's not like I'm just stalking around and reading Python 
sources for fun. It's a real and pretty valid case, I hit it while upgrading 
our production code to python 2.7.
I'm using NumPy (linear algebra module) that uses Python's core mmap module 
under the hood.
In NumPy, it's pretty valid to have arrays of size 0.
I have a file with a fixed-size header that holds size of the array and some 
other meta-data. I mmap this file as a NumPy array using the offset equal to 
header size. Of course, if there is no data in the array then the file will be 
just header, and the offset will be equal to the size of the file - here is 
where this bug hits us as I can't load this file with Python 2.7.2 anymore 
(while I was able to with Python 2.5).
This patch fixes this and everything works as expected, giving an array with 
zero dimensions ('shape' in terms of NumPy):
 x.shape
(0,)
 x.size
0

Please kindly consider applying the patch.

--
resolution: invalid - 
status: closed - open

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



[issue13148] simple bug in mmap size check

2011-10-10 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I don't think it makes sense to accept mmap'ing empty contents when at offset 
n but not at offset n + 1. Either we remove the check entirely and let 
people deal with the consequences, or we keep the check as-is.

--
nosy: +neologix
stage: committed/rejected - 

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



[issue13148] simple bug in mmap size check

2011-10-10 Thread Maxim Yanchenko

Maxim Yanchenko maxim.yanche...@gs.com added the comment:

Well, n+1 is clearly outside the file, wile n is within and therefore valid.

Also, if your position is to forbid zero-size mmapping completely, then the 
checks inside if (map_size == 0) { don't make any sense, especially as they 
may or may fail.
From the existing code, zero-size mmapping is OK as long as offset is OK, so 
the question is whether we consider offset pointing to the end of the file OK. 
To me, it's fine and valid, and there are valid cases like NumPy's zero-size 
arrays, hence the proposed patch.

Removing the check completely is a viable option too, it was already requested 
for special files:
http://bugs.python.org/issue12556

I believe users should have an ability to enjoy whatever their OS provides, and 
deal with the consequences as you said.

--

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



[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

2011-10-10 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


Removed file: http://bugs.python.org/file23365/issue12753-4.diff

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



[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

2011-10-10 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


Added file: http://bugs.python.org/file23374/issue12753-4.diff

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



[issue13146] Writing a pyc file is not atomic

2011-10-10 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Here is a patch for import.c.

--
keywords: +patch
Added file: http://bugs.python.org/file23375/importrename.patch

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



[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

2011-10-10 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

(I had to re-upload the patch a couple of time to get the review button to 
work.  Apparently if there are some conflicts rietveld fails to apply the 
patch, whereas hg is able to merge files without problems here.  Sorry for the 
noise.)

--

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



[issue1673007] urllib2 requests history + HEAD support

2011-10-10 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
assignee: ezio.melotti - orsenthil

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



[issue13150] Most of Python's startup time is sysconfig

2011-10-10 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

sysconfig is imported and used by site.py.

$ time ./python -S -c ''

real0m0.019s
user0m0.013s
sys 0m0.005s

$ time ./python -S -c 'import sysconfig'

real0m0.047s
user0m0.046s
sys 0m0.002s

$ time ./python -S -c 'import sysconfig; sysconfig.get_path(purelib)'

real0m0.053s
user0m0.047s
sys 0m0.005s

$ time ./python -c ''

real0m0.058s
user0m0.054s
sys 0m0.003s

--
messages: 145328
nosy: eric.araujo, ncoghlan, pitrou, tarek, terry.reedy
priority: normal
severity: normal
status: open
title: Most of Python's startup time is sysconfig
type: performance
versions: Python 3.3

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



[issue13150] Most of Python's startup time is sysconfig

2011-10-10 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue1673007] urllib2 requests history + HEAD support

2011-10-10 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

We have discussed the API a bit on IRC and these are the outcomes:

1) should method always have priority or should 'POST' always be used whenever 
data is passed?
2) if the method is e.g. 'GET' and data is passed, should an error be raised?
3) should Request.method be private?
4) should the value of Request.method be initialized in the __init__ or can it 
also be None?
5) if the value of Request.method is always initialized, should we deprecate 
get_method?

IMHO

  r = Request(url, data, method=foo)

should behave like

  class FooRequest(Request):
  def get_method(self):
  return foo
  r = FooRequest(url, data)

when foo is not None and

  class FooRequest(Request): pass
  r = FooRequest(url, data)

when foo is None, so the answers to the 5 questions would be

1) method always has the highest priority, data is used to decide between GET 
and POST when method is None;
2) data is simply ignored if the method doesn't use it -- no errors are raised;
3) maybe, currently is not (see below);
4) method matches the value passed to the constructor, defaulting to None;
5) since it's not initialized, get_method shouldn't be deprecated;

This is also what the patch implements.

Regarding 3), one might look at Request.method and see None instead of 
GET/POST, and this might be confusing.  We could document that get_method() 
should be used instead to see what method will be actually used or make 
Request.method private and avoid the problem.  If we do so there won't be a way 
to change the method after instance creation (but that wasn't even supported 
before[0], so it's probably not a problem).  OTOH, the other args (e.g. data) 
are available and documented.  I'm fine with either documenting that 
get_method() should be used instead or making Request.method private.

Another approach is to move the get_method() logic in the __init__, set 
self.method to method (if specified) or either POST (if there are data) or GET. 
 Then have get_method() simply return self.method (and possibly deprecate it).

[0]: it's actually possible to replace the get_method() method, but if 
Request.method is public one could set it to a new value or to None to restore 
the normal behavior (GET or POST depending on data).

--

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



[issue12602] Missing cross-references in Doc/using

2011-10-10 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

That was the page I said I would look at. My suggest is that one or more of the 
directory entries could have either a bit more information about the directory 
or a More info link to a separate page. As a remember, files for modules were 
named after the module and easy to find. Those could be disposed of in one 
sentence. But files for the manuals were less so and could use more info.

My memory of Objects is that most files were obvious but, again, a few were/are 
not.

--

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



[issue1673007] urllib2 requests history + HEAD support

2011-10-10 Thread Senthil Kumaran

Senthil Kumaran sent...@uthcode.com added the comment:

Our discussion stemmed from this point. If you look at the change proposed, 
Request class is taking a new parameter by name 'method' and it is initialized 
to None:

 class Request:

 def __init__(self, url, data=None, headers={},
- origin_req_host=None, unverifiable=False):
+ origin_req_host=None, unverifiable=False,
+ method=None):

But that actually defaults to GET method in terms of HTTP request for often 
used scenarios where the only required parameter (url) is sent.

This happens in the get_method call:

 def get_method(self):
-if self.data is not None:
+Return a string indicating the HTTP request method.
+if self.method is not None:
+return self.method
+elif self.data is not None:
 return POST
 else:
 return GET

Since, it is understood that the default action of Request(url) is to do a GET, 
I proposed that we have Request's method parameter default to GET instead of 
None, so the change would look like:

 class Request:

 def __init__(self, url, data=None, headers={},
- origin_req_host=None, unverifiable=False):
+ origin_req_host=None, unverifiable=False,
+ method=GET):

And it is more meaningful when someone is looking at the Request  signature. 
Specifying method=None and implicitly meaning it as GET for normal situations 
was not intuitive to me. (This is not case when we do not pass an explicit 
method arg).

At this point, Ezio's summary of API changes discussed becomes interesting.  I 
read again and it seems to me that, the assumption is get_method is an 
important method which determines what method should be used and method should 
be given preference over data.

My point is, get_method is an useful, helper function that is helpful is 
sending the correct method to the http.client code which does the actual task.  
In the current situation, get_method determines based on data parameter 
should it send a GET or a POST, but if we start using method=arg then, 
get_method should just return what was initialized by the method arg 
(defaulting to GET).

2) The next problem comes when a user has specified both data and method=GET. 
This becomes an invalid scenario, but a decision has been to taken as what 
should be given preference? 

- As the user has sent data, should the request be considered a POST?

- But user specified it as GET (intentionally or by mistake), so should the 
data not be used and Request should do only a GET?

- Or should we throw an error?

My personal on this is -1 on throwing an error and when data is sent, just do 
the POST (data overrides method).

BTW, this needs to discussed irrespective of point 1). But having method=GET 
could give raise to his scenario more often. A person would just send data and 
forget about changing the method to POST.

Coming to specific questions which Ezio pointed:

My take:

1) should method always have priority or should 'POST' always be used whenever 
data is passed?

If data is passed use POST.

2) if the method is e.g. 'GET' and data is passed, should an error be raised?

Nope, give data the priority and do POST. (As urllib is currently doing)

3) should Request.method be private?

Not necessarily, it should  be public.


4) should the value of Request.method be initialized in the __init__ or can it 
also be None?

My take - It should be initialized to default (GET), instead of None.

5) if the value of Request.method is always initialized, should we deprecate 
get_method?

This is an interesting question. get_method essentially becomes less useful or 
it could serve as an arbiter when data and GET is sent and may be used as 
reliable way to get the Request's method. It should not be deprecated.

--

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