PyPy 1.4 released

2010-11-27 Thread Maciej Fijalkowski
===
PyPy 1.4: Ouroboros in practice
===

We're pleased to announce the 1.4 release of PyPy. This is a major breakthrough
in our long journey, as PyPy 1.4 is the first PyPy release that can translate
itself faster than CPython.  Starting today, we are using PyPy more for
our every-day development.  So may you :) You can download it here:

http://pypy.org/download.html

What is PyPy


PyPy is a very compliant Python interpreter, almost a drop-in replacement
for CPython. It's fast (`pypy 1.4 and cpython 2.6`_ comparison)

Among its new features, this release includes numerous performance improvements
(which made fast self-hosting possible), a 64-bit JIT backend, as well
as serious stabilization. As of now, we can consider the 32-bit and 64-bit
linux versions of PyPy stable enough to run `in production`_.

Numerous speed achievements are described on `our blog`_. Normalized speed
charts comparing `pypy 1.4 and pypy 1.3`_ as well as `pypy 1.4 and cpython 2.6`_
are available on benchmark website. For the impatient: yes, we got a lot faster!

More highlights
===

* PyPy's built-in Just-in-Time compiler is fully transparent and
  automatically generated; it now also has very reasonable memory
  requirements.  The total memory used by a very complex and
  long-running process (translating PyPy itself) is within 1.5x to
  at most 2x the memory needed by CPython, for a speed-up of 2x.

* More compact instances.  All instances are as compact as if
  they had ``__slots__``.  This can give programs a big gain in
  memory.  (In the example of translation above, we already have
  carefully placed ``__slots__``, so there is no extra win.)

* `Virtualenv support`_: now PyPy is fully compatible with
virtualenv_: note that
  to use it, you need a recent version of virtualenv (= 1.5).

* Faster (and JITted) regular expressions - huge boost in speeding up
  the `re` module.

* Other speed improvements, like JITted calls to functions like map().

.. _virtualenv: http://pypi.python.org/pypi/virtualenv
.. _`Virtualenv support`:
http://morepypy.blogspot.com/2010/08/using-virtualenv-with-pypy.html
.. _`in production`:
http://morepypy.blogspot.com/2010/11/running-large-radio-telescope-software.html
.. _`our blog`: http://morepypy.blogspot.com
.. _`pypy 1.4 and pypy 1.3`:
http://speed.pypy.org/comparison/?exe=1%2B41,1%2B172ben=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20env=1hor=falsebas=1%2B41chart=normal+bars
.. _`pypy 1.4 and cpython 2.6`:
http://speed.pypy.org/comparison/?exe=2%2B35,1%2B172ben=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20env=1hor=falsebas=2%2B35chart=normal+bars

Cheers,

Carl Friedrich Bolz, Antonio Cuni, Maciej Fijalkowski,
Amaury Forgeot d'Arc, Armin Rigo and the PyPy team
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

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


Camelot 10.11.27 : leverage Python, QT and SQLAlchemy

2010-11-27 Thread erikj
Dear all,

Camelot 10.11.27 has been released.

Camelot is an open source RAD framework that leverages Python,
Sqlalchemy and Qt to
build database applications.  Inspired by the Django admin interface,
Camelot allows a
developer to define the database model and Camelot will create the
views.

Homepage : www.python-camelot.com
Demonstration video : http://www.youtube.com/watch?v=HZ5i257N6cc

Regards,

Erik

New in this release :

- tab based desktop
- faster table view
- improved search queries
- much more dynamic field attributes : tooltip, background_color,
  editable, choices, prefix, suffix, arrow
- SQLAlchemy 0.6.x support
- Matplotlib integration
- move to new style signal/slot connections
- frozen columns in a table view
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

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


Re: Newbie question about python garbage collection when keeping only a reference to an object's member

2010-11-27 Thread TuckerTherese
Some specialists tell that a href=http://bestfinance-blog.com;loan/a help 
people to live their own way, because they are able to feel free to buy 
necessary things. Moreover, various banks offer small business loan for young 
and old people. 


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


Re: Kind of plugin system

2010-11-27 Thread Rainer Mansfeld

Am 26.11.2010 18:46, schrieb Gaëtan Podevijn:

I need to get some informations from files stored on my filesystem, Flickr
and Picasa. So the idea is to create a class (for instance,
InformationsProvider) that provides common methods for those three
sources, then, for each source, I create a class that inherits from
InformationsProvider such as InformationsLocalProvider,
InformationsFlickrProvider and InformationPicasaProvider. It is clearly
needed because the method to get the informations is totally different for
each source (the connection with flickr or picasa for exemple).

However, I'd like, in the future, to be able to add new source and thus,
just add a new class that implements the methods from Provider. The thing
is, I'd like to add only one class, and that the rest of the application is
able to use that class without really knowing how many class there are.

I'd have something like :
for each provider that exists: get the informations file

and if I add a new .py that implements a new provider (say Delicious of
GMail), the code above takes account of the new class. It must be dynamic.


Hello Gaëtan,

if all your classes are direct descendants of InformationsProvider 
you might

get away with looping over InformationsProvider.__subclasses__().
See http://docs.python.org/library/stdtypes.html#class.__subclasses__

Greetings

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


Re: Needed: Real-world examples for Python's Cooperative Multiple Inheritance

2010-11-27 Thread Mark Wooding
John Nagle na...@animats.com writes:

 On 11/26/2010 4:21 PM, Mark Wooding wrote:
  John Naglena...@animats.com  writes:
  @This catches the case where two classed both inherit from, say
  threading.thread, each expecting to have a private thread.
 
  Why on earth would anyone do such a bizarre thing?  If you want a
  private thread, then attach one as an attribute.  Inheriting is simply
  madness.

 This must be from someone who hasn't used threads in Python.

Wrong again.

 The usual way to write a thread in Python is to subclass
 threading.thread.  The subclass provides a run function, which
 will be called from the new thread.

Yes, it is.  Does that conflict with what I wrote?  No.

If you want you class to have a private thread, make /another/ class to
represent the behaviour of this private thread, and attach an instance
of this to the first class.  Or you can pass a closure or a bound method
to the thread constructor.  (That's probably cleaner, actually, but
doesn't fit culturally.)

  If you stopped whining about how Python's object system might
  theoretically go wrong if you try to use it like it was C++ and
  started thinking about how to actually make effective use of the
  features it offers -- features which long predate Python, and have
  been thought about over many years, in languages such as Zetalisp,
  Common Lisp, Dylan, Scheme, and variants of Smalltalk -- you might
  got on much better.

Ah, fanboys.

Not exactly.  I collect programming languages like some people collect
postage stamps; it gives one a useful perspective.  I mentioned those
languages because they seem most historically relevant.  Zetalisp's
`Flavors' system introduced multiple inheritance; Common Lisp and Dylan
fix the linearization properly (eventually culminating in the C3
linearization algorithm); Scheme has no standardized object system, but
there are a number of -- mainly CLOS-like -- object systems available;
and Smalltalk is both the classic dynamic object-oriented language and a
single-dispatch contrast to the CLOS/Dylan generic-functions approach.

 Of those, I've written code in Common Lisp, Scheme, and Smalltalk.
 Most of the LISP variants really did objects very well; objects were
 an afterthought.  Smalltalk went a bit too far in the other direction;
 the everything is an object mindset was overdoing it.

CLOS actually does a remarkable integration job, bringing the existing
types into the object system; but, yes, the seams are still visible,
because you can't subclass some of the classes.

 Python is reasonably well balanced in the object area.  Everything
 isn't an object.  There are explicit classes, unlike the
 instance-copying model of Self and Javascript.

Is that a major win?  Self's prototype-based approach seems quite
capable of expressing anything you might want to express with classes,
and a few other things besides.  (The implementation works by attempting
to deduce class structures dynamically, so there's an isomorphism here,
of a sort, but the dynamism would make inventing classes on the fly
rather inconvenient.)  There's a significant difference between
Javascript and Self, by the way: a Self object can have multiple
`parent' slots, consequently with a form of multiple inheritance, while
Javascript is limited to single inheritance (unless you fake it up).

 However, multiple inheritance is something of a mess, as the original
 starter of this thread found when he tried to document how to use it.

Python's object system certainly isn't ideal.

The main problem that I see is that dynamic delegation with `super' is
hideously inconvenient to use, which means that programmers will tend
towards C++'s static delegation instead.

The Python object construction protocol (__new__ and __init__) is
somewhat simplistic; constructing instances of multiply inherited
classes in general requires a somewhat complicated dance with *args and
**kw arguments -- and you lose the ability to reject unknown arguments
-- which again leads to programmers taking shortcuts.

Most of the rest of the object system seems pretty sound to me.

 If you have real trouble writing documentation for a feature, it's
 usually because the feature is badly designed.

It might be that it was misunderstood.

There seem to be two obvious ways of learning a programming language.
One is to try and interpret its concepts in terms of concepts that you
already understand.  This works, but you end up having to `translate'
between the new language; if the translation is imperfect then you'll be
confused or frustrated.  There's a constant temptation to force one's
existing conceptual framework onto the new language -- to use it as if
it worked just like something else one is more familiar with that
doesn't quite work `right'.  The new language is `broken Blub with funny
syntax'.

The other is to try to understand it on its own terms.  This is the
harder road that leads to mastery.

-- [mdw]
-- 

Re: inverse of a matrix with Fraction entries

2010-11-27 Thread Mark Wooding
casevh cas...@gmail.com writes:

 I coded a quick matrix inversion function and measured running times
 using GMPY2 rational and floating point types. For the floating point
 tests, I used a precision of 1000 bits. With floating point values,
 the running time grew as n^3. With rational values, the running time
 grew as n^4*ln(n).

Did you clear the denominators before you started?

-- [mdw]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Using Python for a demonstration in historical linguistics

2010-11-27 Thread Vlastimil Brom
2010/11/27 Dax Bloom bloom@gmail.com:
 On Nov 6, 6:41 am, Vlastimil Brom vlastimil.b...@gmail.com wrote:
 2010/11/6 Dax Bloom bloom@gmail.com:
 ...
 Rask_Grimm_re = ur[bdgptk]ʰ?
 Rask_Grimm_dct = {ub:up, ubʰ: ub, ut: uþ, } # ...

 def repl_fn(m):
     return Rask_Grimm_dct.get(m.group(), m.group())

 ie_txt = u bʰrāter ... 
 almost_germ_txt = re.sub(Rask_Grimm_re, repl_fn, ie_txt)
 print u%s  %s % (ie_txt, almost_germ_txt) # vowel changes etc. TBD

 

  bʰrāter ...    brāþer ...

 hth,
   vbr
 ...
 Hello Vlastimil,

 Could you please explain what the variables %s and % mean and how to
 implement this part of the code in a working python program? I can't
 fully appreciate Peter's quote on rules


 Best regards,

 Dax Bloom

Hi, the mentioned part is called string interpolation;
the last line is equivalent to
print u%s  %s % (ie_txt, almost_germ_txt) # vowel changes etc. TBD
is equivalent to the simple string concatenation:
print ie_txt+ u   + almost_germ_txt
see:
http://docs.python.org/library/stdtypes.html#string-formatting-operations

The values of the tuple (or eventually dict or another mapping) given
after the modulo operator % are inserted at the respective positions
(here %s) of the preceding string (or unicode);
some more advanced adjustments or conversions are also possible here,
which aren't needed in this simple case.

(There is also another string formatting mechanism in the newer
versions of python
http://docs.python.org/library/string.html#formatstrings
which may be more suitable for more complex tasks.)

The implementation depends on the rest of your program and the
input/output of the data, you wish to have (to be able to print the
output with rather non-trivial characters, you will need the unicode
enabled console (Idle is a basic one available with python).
Otherwise the sample is self contained and should be runnable as is;
you can add other needed items to Rask_Grimm_dct and all substrings
matching Rask_Grimm_re will be replaced in one pass.
You can also add a series of such replacements (re pattern and a dict
of a ie: germ pairs), of course only for context-free changes.
On the other hand, I have no simple idea how th deal with Verner's Law
and the like (even if you passed the accents in the PIE forms); well
besides a lexicographic approach, where you would have to identify the
word stems to decide the changes to be applied.

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


Re: MATLAB to Python?

2010-11-27 Thread Victor Eijkhout
MATLABdude matlab.d...@mbnet.fi wrote:

 Also the
 values themselves are not identical compared to the values of the
 MATLAB program.

In numerical analysis there is no such thing as identical. If they
differ by 1.e-10 I'd call it close enough. The difference comes from
differing numerical methods.

Victor.
-- 
Victor Eijkhout -- eijkhout at tacc utexas edu
-- 
http://mail.python.org/mailman/listinfo/python-list


Convert QStingList to Python list

2010-11-27 Thread Peter Chant
The following code generates a QStringList:

fileNames = QFileDialog.getOpenFileNames(None,Chose raw file,.,)

Printing it:

print Files selected +QStringList(fileNames)

Results in:

TypeError: cannot concatenate 'str' and 'QStringList' objects

Any idea how to convert a QStingList into a python list?  pythonQtConv seems 
to come up in google but I've no idea how to import or invoke it.

Thoughts?

Pete


-- 
http://www.petezilla.co.uk
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Convert QStingList to Python list

2010-11-27 Thread Peter Otten
Peter Chant wrote:

 The following code generates a QStringList:
 
 fileNames = QFileDialog.getOpenFileNames(None,Chose raw file,.,)
 
 Printing it:
 
 print Files selected +QStringList(fileNames)

You say that fileNames already is a QStringList. Why are you trying to 
convert it to a QStringList then?
Anyway, it wouldn't work with a python list either. 

 Results in:
 
 TypeError: cannot concatenate 'str' and 'QStringList' objects
 
 Any idea how to convert a QStingList into a python list?  pythonQtConv
 seems to come up in google but I've no idea how to import or invoke it.
 
 Thoughts?

Try it out yourself in the interactive interpreter. Here's a sample session:

 files = QStringList([alpha.txt, beta.txt])
 print files
PyQt4.QtCore.QStringList object at 0x7f64cb73e668
 print list(files)
[PyQt4.QtCore.QString(u'alpha.txt'), PyQt4.QtCore.QString(u'beta.txt')]
 print [str(f) for f in files]
['alpha.txt', 'beta.txt']
 print Selected files:, , .join(str(f) for f in files)
Selected files: alpha.txt, beta.txt
 files = QStringList([uäöü.txt, beta.txt])
 print Selected files:, , .join(str(f) for f in files)
Selected files:
Traceback (most recent call last):
  File stdin, line 1, in module
  File stdin, line 1, in genexpr
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: 
ordinal not in range(128)
 print Selected files:, , .join(unicode(f) for f in files)
Selected files: äöü.txt, beta.txt

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


Re: inverse of a matrix with Fraction entries

2010-11-27 Thread casevh
On Nov 27, 4:00 am, m...@distorted.org.uk (Mark Wooding) wrote:
 casevh cas...@gmail.com writes:
  I coded a quick matrix inversion function and measured running times
  using GMPY2 rational and floating point types. For the floating point
  tests, I used a precision of 1000 bits. With floating point values,
  the running time grew as n^3. With rational values, the running time
  grew as n^4*ln(n).

 Did you clear the denominators before you started?

 -- [mdw]

No. It more of an exercise in illustrating the difference between
arithmetic operations that have a constant running time versus those
that have an n*ln(n) or worse running time.

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


Re: Convert QStingList to Python list

2010-11-27 Thread Peter Chant
Peter Otten wrote:

 
 Try it out yourself in the interactive interpreter. Here's a sample
 session:
 

Peter,

thanks.  I've got some way to go with python and have only just started 
looking at Qt, your help has been very useful.

Pete

-- 
http://www.petezilla.co.uk
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Kind of plugin system

2010-11-27 Thread Marc-Andre Belzile
I guess you could just define an entry-point in your source provider files that 
would return a specific instance of an InformationProvider class. This 
entry-point would be called by your main app (maybe at startup time or during 
an update phase).

There are plenty of articles on the web about python plugins that could help 
you out, such as this one:

 http://wehart.blogspot.com/2009/01/python-plugin-frameworks.html

-mab



From: python-list-bounces+marc-andre.belzile=autodesk@python.org 
[mailto:python-list-bounces+marc-andre.belzile=autodesk@python.org] On 
Behalf Of Gaëtan Podevijn
Sent: Friday, November 26, 2010 12:46 PM
To: python-list@python.org
Subject: Kind of plugin system

Hello,

Here is my problem.

I need to get some informations from files stored on my filesystem, Flickr and 
Picasa. So the idea is to create a class (for instance, InformationsProvider) 
that provides common methods for those three sources, then, for each source, I 
create a class that inherits from InformationsProvider such as 
InformationsLocalProvider, InformationsFlickrProvider and 
InformationPicasaProvider. It is clearly needed because the method to get the 
informations is totally different for each source (the connection with flickr 
or picasa for exemple).

However, I'd like, in the future, to be able to add new source and thus, just 
add a new class that implements the methods from Provider. The thing is, I'd 
like to add only one class, and that the rest of the application is able to use 
that class without really knowing how many class there are.

I'd have something like :
for each provider that exists: get the informations file

and if I add a new .py that implements a new provider (say Delicious of GMail), 
the code above takes account of the new class. It must be dynamic.

Could you help me with that ? I hope I was clear enough.

Thanks a lot,

Gaëtan


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


Re: Scheme as a virtual machine?

2010-11-27 Thread Raffael Cavallaro

On 2010-11-25 11:30:12 -0500, Mario S. Mommer said:


In the realm of pure logic, ad hominems are logically invalid,
period.


We don't live in the realm of pure logic (whatever that would mean - 
pretty sure no human beings exist in the realm of pure logic, so there 
is no homo hominis to make an ad hominem argument against in the land 
of pure logic...)


Here in the real world, no amount of the rigid application of pure 
logic is going to substitute for the very necessary social skill of 
inferring the motives of a participant to a debate.


Again, not all ad hominem arguments are ad hominem fallacies. JH has 
repeatedly trumpeted the virtues of languages whose adoption by others 
brings him financial gain, and repeatedly made pejorative statements 
about other languages in newsgroups for these other langauges, in a 
clear attempt to drum up clients for his training consultancy.


Pure logic alone won't help you here; the ordinary human social skill 
of inferring a person's motives does.


warmest regards,

Ralph


--
Raffael Cavallaro

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


Re: AIX 5.3 - Enabling Shared Library Support Vs Extensions

2010-11-27 Thread Anurag Chourasia
Hi Stefan,

I followed your suggestion and configured LDFLAGS but the make step fails
for another error now.

My configuration options are as follows

./configure --enable-shared --disable-ipv6 --with-gcc=gcc CPPFLAGS=-I
/opt/freeware/include -I /opt/freeware/include/readline -I
/opt/freeware/include/ncurses LDFLAGS=-L. -L/usr/local/lib

Below is the transcript from the make step.
++
running build
running build_ext
ldd: /lib/libreadline.a: File is an archive.
INFO: Can't locate Tcl/Tk libs and/or headers
building '_struct' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -I. -I/u01/home/apli/wm/GDD/Python-2.6.6/./Include -I.
-IInclude -I./Include -I/opt/freeware/include
-I/opt/freeware/include/readline -I/opt/freeware/include/ncurses
-I/usr/local/include -I/u01/home/apli/wm/GDD/Python-2.6.6/Include
-I/u01/home/apli/wm/GDD/Python-2.6.6 -c
/u01/home/apli/wm/GDD/Python-2.6.6/Modules/_struct.c -o
build/temp.aix-5.3-2.6/u01/home/apli/wm/GDD/Python-2.6.6/Modules/_struct.o
./Modules/ld_so_aix gcc -pthread -bI:Modules/python.exp -L. -L/usr/local/lib
build/temp.aix-5.3-2.6/u01/home/apli/wm/GDD/Python-2.6.6/Modules/_struct.o
-L. -L/usr/local/lib -lpython2.6 -o build/lib.aix-5.3-2.6/_struct.so
*Fatal Python error: Interpreter not initialized (version mismatch?)*
*make: 1254-059 The signal code from the last command is 6.*
++

The last command that i see above (ld_so_aix) seems to have completed as the
file _struct.so exists after this command and hence I am not sure which step
is failing.

There is no other Python version on my machine.

Please guide.

On Thu, Nov 25, 2010 at 3:41 PM, Stefan Krah stefan-use...@bytereef.orgwrote:

 Anurag Chourasia anurag.choura...@gmail.com wrote:
  When I configure python to enable shared libraries, none of the
 extensions are getting built during the make step due to this error.
 
  building 'cStringIO' extension
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall
  -Wstrict-prototypes -I. -I/u01/home/apli/wm/GDD/Python-2.6.6/./Include
 -I.
  -IInclude -I./Include -I/opt/freeware/include
  -I/opt/freeware/include/readline -I/opt/freeware/include/ncurses
  -I/usr/local/include -I/u01/home/apli/wm/GDD/Python-2.6.6/Include
  -I/u01/home/apli/wm/GDD/Python-2.6.6 -c
  /u01/home/apli/wm/GDD/Python-2.6.6/Modules/cStringIO.c -o
 
 build/temp.aix-5.3-2.6/u01/home/apli/wm/GDD/Python-2.6.6/Modules/cStringIO.o
  ./Modules/ld_so_aix gcc -pthread -bI:Modules/python.exp
 
 build/temp.aix-5.3-2.6/u01/home/apli/wm/GDD/Python-2.6.6/Modules/cStringIO.o
  -L/usr/local/lib *-lpython2.6* -o build/lib.aix-5.3-2.6/cStringIO.so
   

 Try these flags: -L. -L/usr/local/lib


 If this solves the problem and the issue is also present in Python-2.7,
 you should report a bug at http://bugs.python.org/ .


 Stefan Krah




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


Python make fails with error Fatal Python error: Interpreter not initialized (version mismatch?)

2010-11-27 Thread Anurag Chourasia
Hi All,

During the make step of python, I am encountering a weird error. This is on
AIX 5.3 using gcc as the compiler.

My configuration options are as follows

./configure --enable-shared --disable-ipv6 --with-gcc=gcc CPPFLAGS=-I
/opt/freeware/include -I /opt/freeware/include/readline -I
/opt/freeware/include/ncurses LDFLAGS=-L. -L/usr/local/lib


Below is the transcript from the make step.
++
running build
running build_ext
ldd: /lib/libreadline.a: File is an archive.
INFO: Can't locate Tcl/Tk libs and/or headers
building '_struct' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -I. -I/u01/home/apli/wm/GDD/Python-2.6.6/./Include -I.
-IInclude -I./Include -I/opt/freeware/include
-I/opt/freeware/include/readline -I/opt/freeware/include/ncurses
-I/usr/local/include -I/u01/home/apli/wm/GDD/Python-2.6.6/Include
-I/u01/home/apli/wm/GDD/Python-2.6.6 -c
/u01/home/apli/wm/GDD/Python-2.6.6/Modules/_struct.c -o
build/temp.aix-5.3-2.6/u01/home/apli/wm/GDD/Python-2.6.6/Modules/_struct.o
./Modules/ld_so_aix gcc -pthread -bI:Modules/python.exp -L. -L/usr/local/lib
build/temp.aix-5.3-2.6/u01/home/apli/wm/GDD/Python-2.6.6/Modules/_struct.o
-L. -L/usr/local/lib -lpython2.6 -o build/lib.aix-5.3-2.6/_struct.so
*Fatal Python error: Interpreter not initialized (version mismatch?)*
*make: 1254-059 The signal code from the last command is 6.*
++

The last command that i see above (ld_so_aix) seems to have completed as the
file _struct.so exists after this command and hence I am not sure which step
is failing.

There is no other Python version on my machine.

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


What's wrong with my logging configuration

2010-11-27 Thread rambius
Hello,

I am using python logging and as of today it stopped working. Here is
my program:

#!/usr/bin/env python

import base64
import getpass
import httplib
import logging
import logging.config
import sys
import urlparse


logging.config.fileConfig('logging.config')
logger = logging.getLogger(sys.argv[0])


def main():
from optparse import OptionParser

usage = '%prog -u user [options] url'
parser = OptionParser(usage=usage)
parser.add_option('-u', '--user',
  help='The user that will be authenticated')

(options, args) = parser.parse_args()
if len(args) != 1:
logger.error('Please provide a url')
sys.exit(1)
url = args[0]

if not options.user:
logger.error('Please provide a user')
sys.exit(2)

password = getpass.getpass('Password: ')


if __name__ == '__main__':
main()


Here is my logging.config:

[loggers]
keys=root

[handlers]
keys=console,file

[formatters]
keys=consolefmt,filefmt

[formatter_consolefmt]
format=%(name)-12s: %(levelname)-8s %(message)s
class=logging.Formatter

[formatter_filefmt]
format=%(asctime)s %(name)-12s %(levelname)-8s %(message)s
datefmt=%d/%m/%Y %H:%M:%S

[handler_console]
class=StreamHandler
level=INFO
formatter=consolefmt
args=(sys.stdout,)

[handler_file]
class=FileHandler
level=DEBUG
formatter=filefmt
args=('dav.log', 'a')

[logger_root]
level=NOTSET
handlers=console,file

Yesterday, it was working and I have not touched it - logging has been
working for months. This morning it stopped working and I was
debugging it for half a day and I am clueless. It does not the errors
neither on the console nor in the log file.

I will appreciate any help! Thank you in advance!

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


Re: What's wrong with my logging configuration

2010-11-27 Thread rambius
On Nov 27, 4:07 pm, rambius rambiusparkisan...@gmail.com wrote:
 Hello,

 I am using python logging and as of today it stopped working. Here is
 my program:
 

I forgot to give my environment:

$ uname -a
Darwin arielmac.lan 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov  5
23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386
$ python -V
Python 2.6.6

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


Re: What's wrong with my logging configuration

2010-11-27 Thread rambius
Hello,

I was able to reproduce the problem with even a smaller program:

#!/usr/bin/env python

import logging
import logging.config

logging.config.fileConfig('logging.config')
logger = logging.getLogger('test')

def main():
logger.fatal('test1')
import optparse
logger.fatal('test2')

if __name__ == '__main__':
main()

When I run this program the logger statement after 'import optparse'
does not appear. The first logger statement before optparse does
appear. Has anyone experienced similar behaviour?

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


Re: What's wrong with my logging configuration

2010-11-27 Thread Ben Finney
rambius rambiusparkisan...@gmail.com writes:

 When I run this program the logger statement after 'import optparse'
 does not appear. The first logger statement before optparse does
 appear. Has anyone experienced similar behaviour?

I use the same config file (from your first message) and your shorter
program, and I see this output:

=
test: CRITICAL test1
test: CRITICAL test2
=

-- 
 \  “I have a large seashell collection, which I keep scattered on |
  `\the beaches all over the world. Maybe you've seen it.” —Steven |
_o__)   Wright |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What's wrong with my logging configuration

2010-11-27 Thread rambius
Hello Ben,

On what environment did you try it?

On Nov 27, 5:09 pm, Ben Finney ben+pyt...@benfinney.id.au wrote:
 rambius rambiusparkisan...@gmail.com writes:
  When I run this program the logger statement after 'import optparse'
  does not appear. The first logger statement before optparse does
  appear. Has anyone experienced similar behaviour?

 I use the same config file (from your first message) and your shorter
 program, and I see this output:

 =
 test        : CRITICAL test1
 test        : CRITICAL test2
 =


This is so strange. If I import optparse outside of main() it works.
If I import it between the two logging statement, the second one does
not appear.

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


Re: Matlab equivalent syntax in Python

2010-11-27 Thread Robert Kern

On 2010-11-26 18:23 , Akand Islam wrote:

On Nov 26, 3:50 pm, Cameron Simpsonc...@zip.com.au  wrote:

On 26Nov2010 13:15, Akand Islamsohel...@gmail.com  wrote:
| Thanks for your posting. Like, here is the following Matlab codes
| which I am trying to transform into Python. Here you
| will find profile clear, profile on, profile off, profile resume,
| profile viewer, and drawnow syntaxes. So, what will be these
| equivalents
| in Python?

I would start by looking at the profile python module:

  http://docs.python.org/library/profile.html#module-profile

Cheers,
--
Cameron Simpsonc...@zip.com.au  DoD#743http://www.cskk.ezoshosting.com/cs/

Their are thre mistakes in this sentence.
 - Rob Ray DoD#3r...@linden.msvu.ca


Dear Cameron Simpson,
Thanks for co-operation. I have gone through the link, however, I am
not much clear. Can you please show me some python syntaxes which
contain Matlab like profile on.., drawnow.. and so forth?


Perhaps you could explain what those MATLAB commands do. Not everyone here is 
familiar with MATLAB. For the most part, an API like profile on; profile off 
is inappropriate for the profile Python module. It profiles the times each 
function call takes, not each line. Turning it on and off doesn't make much 
sense. The API described in the above link is better for what it does.


If you want to visualize the profile, you may want to try RunSnakeRun:

  http://www.vrplumber.com/programming/runsnakerun/

If you want line-by-line profiling, you may want to check out my package, 
line_profiler:


  http://pypi.python.org/pypi/line_profiler/

Again, we don't turn it on and off like you might do in MATLAB. Just follow the 
directions and give up trying to find a correspondence with the MATLAB commands.


--
Robert Kern

I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth.
  -- Umberto Eco

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


Re: Needed: Real-world examples for Python's Cooperative Multiple Inheritance

2010-11-27 Thread Steven D'Aprano
On Fri, 26 Nov 2010 23:24:30 -0800, John Nagle wrote:
 On 11/26/2010 4:21 PM, Mark Wooding wrote:
[...]
 @This catches the case where two classed both inherit from, say
 threading.thread, each expecting to have a private thread.

 Why on earth would anyone do such a bizarre thing?  If you want a
 private thread, then attach one as an attribute.  Inheriting is simply
 madness.
 
 This must be from someone who hasn't used threads in Python.
 
 The usual way to write a thread in Python is to subclass
 threading.thread.  The subclass provides a run function, which will
 be called from the new thread.

Wanting a private thread, and writing a thread, are not the same. Of 
course you have to subclass threading.thread to write a thread. But if 
you want a private thread, there's no need to subclass thread just to get 
one. You would add a thread as an attribute, exactly as you would add a 
list or a dict or an int as an attribute if you wanted a private list or 
dict or int. Trying to juggle access from *multiple* classes to a 
*private* thread doesn't seem sensible, which was Mark's point.



 If you
 stopped whining about how Python's object system might theoretically go
 wrong if you try to use it like it was C++ and started thinking about
 how to actually make effective use of the features it offers --
 features which long predate Python, and have been thought about over
 many years, in languages such as Zetalisp, Common Lisp, Dylan, Scheme,
 and variants of Smalltalk -- you might got on much better.
 
 Ah, fanboys.
 
 Of those, I've written code in Common Lisp, Scheme, and Smalltalk.
 Most of the LISP variants really did objects very well; objects were an
 afterthought.

Describing something as an afterthought is normally meant as a 
pejorative. To say that Lisp really did objects very well *and* that 
they were afterthoughts seems like a contradiction.



 Smalltalk went a bit too far in the other direction; the
 everything is an object mindset was overdoing it.
 
 Python is reasonably well balanced in the object area.
 Everything isn't an object.

I don't understand what you mean by this. Can you give an example of a 
thing in Python that is not an object?



 There are explicit classes, unlike the
 instance-copying model of Self and Javascript.  However, multiple
 inheritance is something of a mess, as the original starter of this
 thread found when he tried to document how to use it.
 
 If you have real trouble writing documentation for a feature, it's
 usually because the feature is badly designed.

The problem isn't writing documentation for the feature, but coming up 
with real-world use-cases. The documentation for super and the MRO is 
extensive and detailed. It's also complicated, because multiple 
inheritance is complicated. But it seems that multiple inheritance might 
not be that useful outside of a small number of cases.


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


Comparing floats

2010-11-27 Thread kj



I'm defining a class (Spam) of objects that are characterized by
three parameters, A, B, C, where A and C are n-tuples of floats
and B is an n*n tuple-of-tuples of floats.  I'm defining a limited
multiplication for these objects, like this:

Spam(A, B, C) * Spam(D, E, F) = Spam(A, dot(B, E), F)
  if and only if C == D.

(Here dot(B, E) represents the matrix multiplication of B and E).

In other words, this multiplication is defined only for the case
where the last parameter of the first object is equal to first
parameter of the second object.  An exception should be thrown if
one attempts to multiply two objects that fail to meet this
requirement.

Therefore, to implement this multiplication operation I need to
have a way to verify that the float tuples C and D are equal.
Certainly, I want to do this in in a way that takes into account
the fact machine computations with floats can produce small
differences between numbers that are notionally the same.  E.g.
(in Python 2.6.1 at least):

 49.0 * (1.0/49.0)
0.99989
 1.0 == 49.0 * (1.0/49.0)
False

The only approach I know of is to pick some arbitrary tolerance
epsilon (e.g. 1e-6) and declare floats x and y equal iff the absolute
value of x - y is less than epsilon.

Does the Python standard library provide any better methods for
performing such comparisons?

I understand that, in Python 2.7 and 3.x = 3.1, when the interactive
shell displays a float it shows the shortest decimal fraction that
rounds correctly back to the true binary value.  Is there a way
to access this rounding functionality from code that must be able
to run under version 2.6? (The idea would be to implement float
comparison as a comparison of the rounded versions of floats.)

Absent these possibilities, does Python provide any standard value
of epsilon for this purpose?

TIA!

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


Re: inverse of a matrix with Fraction entries

2010-11-27 Thread Steven D'Aprano
On Fri, 26 Nov 2010 19:21:47 -0800, casevh wrote:

 On Nov 26, 2:11 pm, Steven D'Aprano steve
 +comp.lang.pyt...@pearwood.info wrote:
 On Fri, 26 Nov 2010 12:54:12 -0800, John Nagle wrote:
  For ordinary number crunching,
  rational arithmetic is completely inappropriate.

 Why?

 --
 Steven
 As you perform repeated calculations with rationals, the size of the
 values (usually) keep growing. (Where size is measured as the length of
 numerator and denominator.) The speed and memory requirements are no
 longer constant.

You're not comparing apples with apples. You're comparing arbitrary 
precision calculations with fixed precision calculations. If you want 
fixed memory requirements, you should use fixed-precision rationals. Most 
rationals I know of have a method for limiting the denominator to a 
maximum value (even if not necessarily convenient).

On the other hand, if you want infinite precision, there are floating 
point implementations that offer that too. How well do you think they 
perform relative to rationals? (Hint: what are the memory requirements 
for an infinite precision binary float equal to fraction(1, 3)? *wink*)

Forth originally didn't offer floats, because there is nothing you can do 
with floats that can't be done slightly less conveniently but more 
accurately with a pair of integers treated as a rational. Floats, after 
all, *are* rationals, where the denominator is implied rather than 
explicit.

I suspect that if rational arithmetic had been given half the attention 
that floating point arithmetic has been given, most of the performance 
difficulties would be significantly reduced. Perhaps not entirely 
eliminated, but I would expect that for a fixed precision calculation, we 
should have equivalent big-Oh behaviour, differing on the multiplicative 
factors.

In any case, the real lesson of your benchmark is that infinite precision 
is quite costly, no matter how you implement it :)



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


Re: Comparing floats

2010-11-27 Thread Terry Reedy

On 11/27/2010 5:55 PM, kj wrote:


Therefore, to implement this multiplication operation I need to
have a way to verify that the float tuples C and D are equal.


I might try the average relative difference:
sum(abs((i-j)/(i+j)) for i,j in zip(C,D))/n # assuming lengths constant


Certainly, I want to do this in in a way that takes into account
the fact machine computations with floats can produce small
differences between numbers that are notionally the same.


The problem is that the appropriate value may depend on the application 
and the source of the floats. If they are measured to 3 decimal places, 
you need a large value. If they are calculated, you need much smaller.


--
Terry Jan Reedy

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


Re: What's wrong with my logging configuration

2010-11-27 Thread rambius
Hello,

I found the culprit. Yesterday I added a file called copy.py. It
clashed with the python built-in module copy and caused that nasty
error.

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


Re: inverse of a matrix with Fraction entries

2010-11-27 Thread casevh
On Nov 27, 3:08 pm, Steven D'Aprano steve
+comp.lang.pyt...@pearwood.info wrote:
 On Fri, 26 Nov 2010 19:21:47 -0800, casevh wrote:
  On Nov 26, 2:11 pm, Steven D'Aprano steve
  +comp.lang.pyt...@pearwood.info wrote:
  On Fri, 26 Nov 2010 12:54:12 -0800, John Nagle wrote:
   For ordinary number crunching,
   rational arithmetic is completely inappropriate.

  Why?

  --
  Steven
  As you perform repeated calculations with rationals, the size of the
  values (usually) keep growing. (Where size is measured as the length of
  numerator and denominator.) The speed and memory requirements are no
  longer constant.

 You're not comparing apples with apples. You're comparing arbitrary
 precision calculations with fixed precision calculations. If you want
 fixed memory requirements, you should use fixed-precision rationals. Most
 rationals I know of have a method for limiting the denominator to a
 maximum value (even if not necessarily convenient).

 On the other hand, if you want infinite precision, there are floating
 point implementations that offer that too. How well do you think they
 perform relative to rationals? (Hint: what are the memory requirements
 for an infinite precision binary float equal to fraction(1, 3)? *wink*)

 Forth originally didn't offer floats, because there is nothing you can do
 with floats that can't be done slightly less conveniently but more
 accurately with a pair of integers treated as a rational. Floats, after
 all, *are* rationals, where the denominator is implied rather than
 explicit.

 I suspect that if rational arithmetic had been given half the attention
 that floating point arithmetic has been given, most of the performance
 difficulties would be significantly reduced. Perhaps not entirely
 eliminated, but I would expect that for a fixed precision calculation, we
 should have equivalent big-Oh behaviour, differing on the multiplicative
 factors.

 In any case, the real lesson of your benchmark is that infinite precision
 is quite costly, no matter how you implement it :)

 --
 Steven

I think most users are expecting infinite precision when they use
rationals. Trying to explain limited precision rational arithmetic
might be interesting.

Knuth described floating-slash arithmetic that used a fixed number
of bits for both the numerator and denominator and a rounding
algorithm that prefers simple fractions versus more complex
fractions. IIRC, the original paper was from the 1960s.

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


Re: Comparing floats

2010-11-27 Thread Arnaud Delobelle
Terry Reedy tjre...@udel.edu writes:

 On 11/27/2010 5:55 PM, kj wrote:

 Therefore, to implement this multiplication operation I need to
 have a way to verify that the float tuples C and D are equal.

 I might try the average relative difference:
 sum(abs((i-j)/(i+j)) for i,j in zip(C,D))/n # assuming lengths constant

That'll throw an exception if i == -j.  You could replace (i+j) with
math.hypot(i, j) or abs(i)+abs(j) but it will still fail when i == j ==
0.

-- 
Arnaud

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


Re: inverse of a matrix with Fraction entries

2010-11-27 Thread Steven D'Aprano
On Sat, 27 Nov 2010 15:44:38 -0800, casevh wrote:

 I think most users are expecting infinite precision when they use
 rationals. Trying to explain limited precision rational arithmetic might
 be interesting.

Most users are expecting infinite precision decimals when they use 
floats, and get surprised and dismayed by things like these:

 sum([0.1]*10) == 1
False

 0.1 + 1e50 + 0.1 - 1e50
0.0

 a, b, c = 0.1, 0.7, 0.3
 a*b + a*c == a*(b+c)
False


Trying to explain arithmetic on computers is interesting, no matter what 
you use.


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


Re: What's wrong with my logging configuration

2010-11-27 Thread Ben Finney
rambius rambiusparkisan...@gmail.com writes:

 On what environment did you try it?

I get the same results with both Python 2 and Python 3 on GNU+Linux:

=
$ python
Python 2.6.6 (r266:84292, Oct  9 2010, 13:53:14)
[…]

$ python3
Python 3.1.3rc1 (r313rc1:86453, Nov 14 2010, 05:49:40)
[…]
=

 This is so strange. If I import optparse outside of main() it works.
 If I import it between the two logging statement, the second one does
 not appear.

Troubleshooting questions:

Is there a rogue module in your project tree that, by being named the
same as one of the standard library modules, shadows that module?

Does the same problem behaviour occur if you import some other module in
place of ‘optparse’?

Can you reduce the content of your ‘logging.config’ and still see the
same problem behaviour (i.e. do you really have the minimum complete
example yet)? What is the minimal config file that still results in the
same behaviour for you?

-- 
 \ “Welchen Teil von ‘Gestalt’ verstehen Sie nicht?  [What part of |
  `\‘gestalt’ don't you understand?]” —Karsten M. Self |
_o__)  |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What's wrong with my logging configuration

2010-11-27 Thread Ben Finney
rambius rambiusparkisan...@gmail.com writes:

 I found the culprit. Yesterday I added a file called copy.py. It
 clashed with the python built-in module copy and caused that nasty
 error.

You may be glad to know that newer versions of Python can distinguish
absolute imports from relative imports, to address this very problem
URL:http://www.python.org/dev/peps/pep-0328/.

-- 
 \“I don't accept the currently fashionable assertion that any |
  `\   view is automatically as worthy of respect as any equal and |
_o__)   opposite view.” —Douglas Adams |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Comparing floats

2010-11-27 Thread Steven D'Aprano
On Sat, 27 Nov 2010 22:55:10 +, kj wrote:

[...]
 Therefore, to implement this multiplication operation I need to have a
 way to verify that the float tuples C and D are equal. 

That C and D are tuples of floats is irrelevant. The problem boils down 
to testing floats for equality.

It's easy to test two floats for equality, that's exactly what == does, 
but two floats which should be equal might not be due to calculation 
errors. To work around this, we loosen the definition of equal to give 
some allowance for rounding errors. Unfortunately, you need to decide 
what you mean by two floats are equal, since that will depend on the 
semantics of your problem and data. There is no standard answer that 
applies everywhere.

I suggest you leave it up to the user to decide what tolerance their data 
can support, and offer a sensible default for cases that they don't know 
or don't care.

This might be useful for you, or at least give you some ideas:

http://code.activestate.com/recipes/577124-approximately-equal/



[...]
 The only approach I know of is to pick some arbitrary tolerance epsilon
 (e.g. 1e-6) and declare floats x and y equal iff the absolute value of x
 - y is less than epsilon.

The four basic approaches are:

(1) Is the absolute difference between the values = some tolerance?
(2) Is the relative difference between the values = some tolerance?
(3) Round the two values to a fixed number of decimal places, then 
compare for equality. This is a variation on (1) above.
(4) How many differences in the least significant bits of the two values 
do we accept?



 I understand that, in Python 2.7 and 3.x = 3.1, when the interactive
 shell displays a float it shows the shortest decimal fraction that
 rounds correctly back to the true binary value.  Is there a way to
 access this rounding functionality from code that must be able to run
 under version 2.6? (The idea would be to implement float comparison as a
 comparison of the rounded versions of floats.)

How do you expect to access code in the Python 2.7 interpreter from 
Python 2.6? If you have 2.7 available, just use 2.7 :)

It is a standard, royalty-free algorithm that you can find on the 
Internet somewhere. Worst case, you could copy it from the Python 2.7 
source code, re-write it in Python if need be, and distribute it in your 
own application. But I don't think it will help you, since it isn't 
dealing with the fundamental problem that:

* equality between two floats is well-defined, but not useful

* equality given some tolerance is useful, but not well-defined (there is 
no tolerance that is always best, and there is no general way to decide 
whether absolute or relative error is more important)



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


Re: Needed: Real-world examples for Python's Cooperative Multiple Inheritance

2010-11-27 Thread Steve Holden
On 11/27/2010 4:34 PM, Steven D'Aprano wrote:
[...]
 The problem isn't writing documentation for the feature, but coming up 
 with real-world use-cases. The documentation for super and the MRO is 
 extensive and detailed. It's also complicated, because multiple 
 inheritance is complicated. But it seems that multiple inheritance might 
 not be that useful outside of a small number of cases.

It isn't. Even inheritance itself isn't as useful as it at first
appears, and composition turns out in practice to be much more useful.
That goes double for multiple inheritance.

regards
 Steve
-- 
Steve Holden   +1 571 484 6266   +1 800 494 3119
PyCon 2011 Atlanta March 9-17   http://us.pycon.org/
See Python Video!   http://python.mirocommunity.org/
Holden Web LLC http://www.holdenweb.com/

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


ANJELINA JOLIE - KATE WINSLET HOT PICTURES AND PROFILES HERE

2010-11-27 Thread cinema
http://www.cinemaulagam.org

http://www.cinemaulagam.org

http://www.cinemaulagam.org

http://www.cinemaulagam.org

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


Re: Matlab equivalent syntax in Python

2010-11-27 Thread Akand Islam
On Nov 27, 4:38 pm, Robert Kern robert.k...@gmail.com wrote:
 On 2010-11-26 18:23 , Akand Islam wrote:









  On Nov 26, 3:50 pm, Cameron Simpsonc...@zip.com.au  wrote:
  On 26Nov2010 13:15, Akand Islamsohel...@gmail.com  wrote:
  | Thanks for your posting. Like, here is the following Matlab codes
  | which I am trying to transform into Python. Here you
  | will find profile clear, profile on, profile off, profile resume,
  | profile viewer, and drawnow syntaxes. So, what will be these
  | equivalents
  | in Python?

  I would start by looking at the profile python module:

   http://docs.python.org/library/profile.html#module-profile

  Cheers,
  --
  Cameron Simpsonc...@zip.com.au  
  DoD#743http://www.cskk.ezoshosting.com/cs/

  Their are thre mistakes in this sentence.
           - Rob Ray DoD#3r...@linden.msvu.ca

  Dear Cameron Simpson,
  Thanks for co-operation. I have gone through the link, however, I am
  not much clear. Can you please show me some python syntaxes which
  contain Matlab like profile on.., drawnow.. and so forth?

 Perhaps you could explain what those MATLAB commands do. Not everyone here is
 familiar with MATLAB. For the most part, an API like profile on; profile off
 is inappropriate for the profile Python module. It profiles the times each
 function call takes, not each line. Turning it on and off doesn't make much
 sense. The API described in the above link is better for what it does.

 If you want to visualize the profile, you may want to try RunSnakeRun:

    http://www.vrplumber.com/programming/runsnakerun/

 If you want line-by-line profiling, you may want to check out my package,
 line_profiler:

    http://pypi.python.org/pypi/line_profiler/

 Again, we don't turn it on and off like you might do in MATLAB. Just follow 
 the
 directions and give up trying to find a correspondence with the MATLAB 
 commands.

 --
 Robert Kern

 I have come to believe that the whole world is an enigma, a harmless enigma
   that is made terrible by our own mad attempt to interpret it as though it 
 had
   an underlying truth.
    -- Umberto Eco

Dear Robert Kern,
I do appreciate your reply. Surely I will dig through your package.

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


earn 200-300% just launched new doubler 15 m ago join fast

2010-11-27 Thread bhanu
http://fast2double.com?bhanusri  join 30$ get 5$ line bonus
-- 
http://mail.python.org/mailman/listinfo/python-list


[RELEASED] Python 2.7.1

2010-11-27 Thread Benjamin Peterson
On behalf of the Python development team, I'm happy as a clam to announce the
immediate availability of Python 2.7.1.

2.7 includes many features that were first released in Python 3.1. The faster io
module, the new nested with statement syntax, improved float repr, set literals,
dictionary views, and the memoryview object have been backported from 3.1. Other
features include an ordered dictionary implementation, unittests improvements, a
new sysconfig module, auto-numbering of fields in the str/unicode format method,
and support for ttk Tile in Tkinter.  For a more extensive list of changes in
2.7, see http://doc.python.org/dev/whatsnew/2.7.html or Misc/NEWS in the Python
distribution.

To download Python 2.7.1 visit:

 http://www.python.org/download/releases/2.7.1/

The 2.7.1 changelog is at:

 http://svn.python.org/projects/python/tags/r271/Misc/NEWS

2.7 documentation can be found at:

 http://docs.python.org/2.7/

This is a production release.  Please report any bugs you find to the bug
tracker:

 http://bugs.python.org/


Enjoy!

--
Benjamin Peterson
Release Manager
benjamin at python.org
(on behalf of the entire python-dev team and 2.7.1's contributors)
-- 
http://mail.python.org/mailman/listinfo/python-list


[RELEASED] Python 3.1.3

2010-11-27 Thread Benjamin Peterson
On behalf of the Python development team, I'm happy as a lark to announce the
third bugfix release for the Python 3.1 series, Python 3.1.3.

This bug fix release features numerous bug fixes and documentation improvements
over 3.1.2.

The Python 3.1 version series focuses on the stabilization and optimization of
the features and changes that Python 3.0 introduced.  For example, the new I/O
system has been rewritten in C for speed.  File system APIs that use unicode
strings now handle paths with undecodable bytes in them. Other features include
an ordered dictionary implementation, a condensed syntax for nested with
statements, and support for ttk Tile in Tkinter.  For a more extensive list of
changes in 3.1, see http://doc.python.org/3.1/whatsnew/3.1.html or Misc/NEWS in
the Python distribution.

This is a production release. To download Python 3.1.3 visit:

 http://www.python.org/download/releases/3.1.3/

A list of changes in 3.1.3 can be found here:

 http://svn.python.org/projects/python/tags/r313/Misc/NEWS

The 3.1 documentation can be found at:

 http://docs.python.org/3.1

Bugs can always be reported to:

 http://bugs.python.org


Enjoy!

--
Benjamin Peterson
Release Manager
benjamin at python.org
(on behalf of the entire python-dev team and 3.1.3's contributors)
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue10516] Add list.clear() and list.copy()

2010-11-27 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
nosy: +eli.bendersky

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



[issue10521] str methods don't accept non-BMP fillchar on a narrow Unicode build

2010-11-27 Thread Ezio Melotti

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

I agree that s.center(char, n).encode('utf-8') should be the same on both the 
builds -- even if their len() will be different -- for the following reasons:

1) the string will eventually be encoded, and if they the result is the same on 
both builds, it will look the same too;
2) trying to keep the same len() will generate different results and it won't 
work in case of odd width like 'foo'.center(surrogate_pair, 5) because you 
can't put half surrogate.

--

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



[issue10541] regrtest.py -T broken

2010-11-27 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

Apparently something in the test changes the cwd.

Both of the following invocations work:

$ ./python.exe `pwd`/Lib/test/regrtest.py -T -N test_urllib
$ ./python.exe -m test.regrtest -T -N test_urllib

I would suggest changing the coverage target in the Makefile.

--

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



[issue9264] trace.py documentation is incomplete

2010-11-27 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

Éric, good idea - I'll do it.

--

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



[issue9264] trace.py documentation is incomplete

2010-11-27 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

There's something weird going on with cmdoption... I've applied for 
subscription to the docs mailing list, but while I'm awaiting moderator 
approval, here's the brain-dump. Suppose this option description:

.. program:: trace

.. cmdoption:: -c, --count

   Blah blah blah

And now this reference:

This is a test long :option:`--count` and then short :option:`-c`, test.

Only the -c gets linked to ..cmdoption, not --count.
If I list --count before -c in ..cmdoption, then it's the other way around. 
What makes it kinda work (link both the long and short names) is:

.. cmdoption:: -c
   --count

   Blah blah blah

But this isn't standard (although it doesn't look too bad). Actually, the 
original listing (the short name first, then the long one) is customary in the 
library docs.

--

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



[issue10242] unittest's assertItemsEqual() method makes too many assumptions about its input

2010-11-27 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Applied in r86828.

The output could still be made nicer, perhaps something along the lines of:

expected 6, got 4: 'wand of fireballs'
expected 2, got 7: 'ring of invisibility'
  . . .

--
priority: high - normal
resolution:  - fixed

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



[issue10544] yield expression inside generator expression does nothing

2010-11-27 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Hmm, what an interesting and unexpected side-effect of the efforts to hide the 
loop induction variable.

--
nosy: +rhettinger

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



[issue10516] Add list.clear() and list.copy()

2010-11-27 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

Objects/listobject.c has a static function named list_clear used internally. Is 
it possible to just expose this function as a clear() method? 

One problem is that it has this strange comment in the end:

/* Never fails; the return value can be ignored.
   Note that there is no guarantee that the list is actually empty
   at this point, because XDECREF may have populated it again! */

However, looking at the code I'm not sure the list can be cleared any more than 
the function does, and it actually deallocates the ob_item field of the list.

--

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



[issue10242] unittest's assertItemsEqual() method makes too many assumptions about its input

2010-11-27 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Attaching possible code for nicer output.

--
assignee: rhettinger - michael.foord
resolution: fixed - 
Added file: http://bugs.python.org/file19833/nice_output.diff

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



[issue10516] Add list.clear() and list.copy()

2010-11-27 Thread Xuanji Li

Xuanji Li xua...@gmail.com added the comment:

Hi, I'm also looking at listobject.c also... if we want list.clear() to behave 
exactly like del list[], we may be able to just call list_ass_slice on the 
list. Similarly for list.copy which should behave like a=l[:]

--
nosy: +xuanji

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



[issue10516] Add list.clear() and list.copy()

2010-11-27 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:


 Hi, I'm also looking at listobject.c also... if we want list.clear() to
 behave exactly like del list[], we may be able to just call list_ass_slice
 on the list. Similarly for list.copy which should behave like a=l[:]


Note that when executed to do 'del lst[:]' (i.e. with argument v set to 0
and ilow/ihigh to the maximal range of the list), list_ass_slice will just
call list_clear anyway, which is a cue that this indeed is the right way to
do it, despite the strange comment I mentioned in my message above.

--
Added file: http://bugs.python.org/file19834/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10516
___div dir=ltrbrdiv class=gmail_quoteblockquote class=gmail_quote 
style=margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); 
padding-left: 1ex;
br
Hi, I#39;m also looking at listobject.c also... if we want list.clear() to 
behave exactly like del list[], we may be able to just call list_ass_slice on 
the list. Similarly for list.copy which should behave like a=l[:]br

/blockquote/divbrNote that when executed to do #39;del lst[:]#39; (i.e. 
with argument v set to 0 and ilow/ihigh to the maximal range of the list), 
list_ass_slice will just call list_clear anyway, which is a cue that this 
indeed is the right way to do it, despite the strange comment I mentioned in my 
message above.br

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



[issue10516] Add list.clear() and list.copy()

2010-11-27 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Yes, list_clear should be called, but no, it cannot be used directly because a 
method needs a PyObject* return value.  So a wrapper method is needed that 
looks like listappend() does for list.append(). list_copy() will just look like 
list_slice() with the index fiddling removed.

--
nosy: +georg.brandl

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



[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-11-27 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

Raymond Hettinger wrote:
 
 Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
 
 Mark, can you opine on this?

Yes, I'll have a look later today.

--

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



[issue10383] test_os leaks under Windows

2010-11-27 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

Fixed original leaks in r86804, r86806 and r86804.

Fixed additional leaks in r86829.

--
components: +Extension Modules -Library (Lib), Windows
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
versions: +Python 2.7, Python 3.1

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



[issue10516] Add list.clear() and list.copy()

2010-11-27 Thread Xuanji Li

Xuanji Li xua...@gmail.com added the comment:

That's good if it's so... can you explain why list_clear doesn't guarantee that 
the list is empty? Why would XDECREF populate the list? I don't quite 
understand it.

eli: are you writing a patch for this?

--

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



[issue9264] trace.py documentation is incomplete

2010-11-27 Thread Éric Araujo

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

I noticed too that the second form given in a cmdoption directive cannot be 
linked to from an option construct.  The workaround looks like this: 
:option:`--long -l`.  This uses a generic Sphinx (or reST) property: When 
using :role:`text thing`, “thing” will be given as argument to the role but 
“text” will be displayed.  It’s very useful for references for example, if you 
don’t want title case in the middle of your sentence of if you need to rephrase 
the title: “Have a look at the :ref:`detailed explanation 
config-explanation`”.

Even if it can be worked around, can you report this Sphinx bug?

--

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



[issue10516] Add list.clear() and list.copy()

2010-11-27 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

Georg,

Thanks. Of course it should be wrapped like the others :-)

Xuanji,

Yes, I will try to get in something preliminary today.

--

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



[issue9264] trace.py documentation is incomplete

2010-11-27 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

Éric,

I sent an inquiry about this problem to the d...@python.org list. In the 
meantime, I will implement it with the workaround you suggest (I checked it 
works in this case too).

--

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



[issue10516] Add list.clear() and list.copy()

2010-11-27 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

Attaching a patch for list.clear():

1. Implements a new function in Objects/listobject.c named listclear() (to be 
consistent with the other method functions)
2. listclear() is registered in list_methods and just calls list_clear(), 
returning None
3. A documentation string is modeled after dict.clear(), but shaped a bit 
differently to follow the conventions of other list method docs.

If this look fine to the more experienced devs, things left to do are:

1. Add tests
2. Implement the .copy() method in a similar manner + tests for it

Some random observations:

1. The naming of functions/methods could be made more consistent. See, for 
example, list_reversed vs. listreverse.
2. The documentation style of list and dict methods is different for no 
apparent reason:

help({}.pop) gives:

pop(...)
D.pop(k[,d]) - v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised

While help([].pop) gives:

pop(...)
L.pop([index]) - item -- remove and return item at index (default last).
Raises IndexError if list is empty or index is out of range.

Note the '--' which separates the signature from description in the list 
version.

--
keywords: +patch
Added file: http://bugs.python.org/file19835/issue10516.1.patch

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



[issue10516] Add list.clear() and list.copy()

2010-11-27 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


Removed file: http://bugs.python.org/file19834/unnamed

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



[issue10547] FreeBSD: wrong value for LDSHARED in sysconfig

2010-11-27 Thread Stefan Krah

New submission from Stefan Krah stefan-use...@bytereef.org:

On FreeBSD, the config variable LDSHARED contains the literal '${LDFLAGS}',
causing this failure in test_distutils:


'test_get_outputs (distutils.tests.test_build_ext.BuildExtTestCase) ... gcc: ': 
No such file or directory
ERROR


The patch fixes the issue and all tests pass.


Benjamin, are you ok with the change for 2.7? I'm not sure why autoreconf
generated a bit of extra noise; I used version 2.65. Also, OpenBSD and
NetBSD should be affected as well.

--
components: Build
files: freebsd_ldshared.patch
keywords: needs review, patch
messages: 122525
nosy: benjamin.peterson, skrah
priority: normal
severity: normal
stage: patch review
status: open
title: FreeBSD: wrong value for LDSHARED in sysconfig
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file19836/freebsd_ldshared.patch

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



[issue10547] FreeBSD: wrong value for LDSHARED in sysconfig

2010-11-27 Thread Stefan Krah

Changes by Stefan Krah stefan-use...@bytereef.org:


--
keywords: +buildbot -needs review, patch

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



[issue9264] trace.py documentation is incomplete

2010-11-27 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

Attaching an updated patch for Doc/library/trace.rst in 3.2

Changed the formatting of command-line options per Éric's suggestion of using 
program/cmdoption/option combos (great idea Éric - it looks much better).

--
Added file: http://bugs.python.org/file19837/issue9264.py32.2.patch

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



[issue9509] argparse FileType raises ugly exception for missing file

2010-11-27 Thread Steven Bethard

Steven Bethard steven.beth...@gmail.com added the comment:

Tried to comment in Rietveld but it didn't work for some reason. Anyway, I 
think the argparse.py patch isn't good - changing the type error message to 
'invalid %s value: %r details: %s' will change the behavior of a bunch of 
programs, and it's not clearly for the better. Instead, you should raise an 
ArgumentTypeError instead of a ValueError, and give it whatever message you 
want there. That is, let's keep this patch local to the FileType, and not touch 
the rest of argparse.

--

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



[issue9509] argparse FileType raises ugly exception for missing file

2010-11-27 Thread SilentGhost

SilentGhost michael.mischurow+...@gmail.com added the comment:

Steven, I'm not sure why you're insisting on ArgumentTypeError, when it should 
be ArgumentError. The file name is not coerced into a different file type, but 
rather the error occurs when trying to use parameter passed.

In any way, my patch is still available. Do you not like something about it?

--

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



[issue9264] trace.py documentation is incomplete

2010-11-27 Thread Éric Araujo

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

Thanks for your work on this!

``dir/package/module.cover`` → :file:`{dir}/{package}/{module}.cover`

'' looks wrong.

``os.pathsep``: You can use :data:`os.pathsep` to get a link, I think.

+.. method:: CoverageResults.update(other)
FTR, there is a new way for doing such things: You can nest method directives 
in a class directive block.  See gettext.rst for an example.  Your patch 
needn’t change that now, not all docs have been updated, so it’s best to do as 
you did and follow the style of the rest of the file.  I propose to change it 
after your patch is committed.

+..
Stray dots at the end of the file.

The doc uses one or two spaces inconsistently.  I don’t know if it’s worth 
changing.

--

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



[issue10548] Error in setUp not reported as expectedFailure (unittest)

2010-11-27 Thread Michael Foord

New submission from Michael Foord mich...@voidspace.org.uk:

Reported by Konrad Delong.

class MyTest(unittest.TestCase):
def setUp(self):
raise Exception
@unittest.expectedFailure
def testSomething(self):
assert False, test method failed




This code will report error, not expected failure.

--
assignee: michael.foord
components: Library (Lib)
messages: 122530
nosy: michael.foord
priority: normal
severity: normal
status: open
title: Error in setUp not reported as expectedFailure (unittest)
type: behavior
versions: Python 2.7, Python 3.2

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



[issue9264] trace.py documentation is incomplete

2010-11-27 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

Attaching an updated patch following Éric's suggestions:

* ``dir/package/module.cover`` -- FIXED

* '' looks wrong -- FIXED to just 

* ``os.pathsep`` -- FIXED

* method:: CoverageResults.update(other) -- OK, let's leave it for a separate 
issue.

* Stray dots at the end of the file -- FIXED 

* The doc uses one or two spaces inconsistently.  -- not 100% what you mean 
here, but I found inconsistent separation between paragraphs (sometimes 1 blank 
line, sometimes 2), and fixed it. If you meant something else, I can fix that 
too :)

--
Added file: http://bugs.python.org/file19838/issue9264.py32.3.patch

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



[issue10516] Add list.clear() and list.copy()

2010-11-27 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
Removed message: http://bugs.python.org/msg122522

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



[issue9264] trace.py documentation is incomplete

2010-11-27 Thread Éric Araujo

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

Duh, I forgot some words: The file uses one or two dots *after full stops* 
inconsistently.  I don’t think you have to change that now, we can make it 
consistent later (or not, as it does not affect the output), as we do with line 
wrapping.  Just keep it in mind for future patches :)

Terry: I got no warnings when building the HTML and the output looks good.  +1 
on commit.

--

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



[issue10531] write tilted text in turtle

2010-11-27 Thread Joe Metcalfe

Joe Metcalfe j.g.metca...@gmail.com added the comment:

Turtle is built on top of Tk, which is currently at version 8.5 - this has no 
ability to rotate text. When Tk version 8.6 arrives it should be able to write 
rotated text (see 
http://mail.python.org/pipermail/tkinter-discuss/2010-November/002490.html) and 
turtle.py could be updated to take advantage of it.

--
nosy: +Joe.Metcalfe

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



[issue10531] write tilted text in turtle

2010-11-27 Thread Joe Metcalfe

Changes by Joe Metcalfe j.g.metca...@gmail.com:


--
versions:  -Python 3.2

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



[issue4111] Add Systemtap/DTrace probes

2010-11-27 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

Some references to keep around:

http://src.opensolaris.org/source/xref/jds/spec-files/trunk/patches/
http://src.opensolaris.org/source/xref/jds/spec-files/trunk/patches/Python26-07-dtrace.diff
http://src.opensolaris.org/source/xref/jds/spec-files/trunk/patches/Python-07-dtrace.diff

--

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



[issue10549] help(cls1) breaks when cls1 has staticmethod(cls2) attribute

2010-11-27 Thread Milko Krachounov

New submission from Milko Krachounov pyt...@milko.3mhz.net:

If I make a class B, and add staticmethod(A) as an attribute when B is another 
class, help(B) breaks. The issue appears with Python 2.6.6, trunk, 3.1.3c1, and 
py3k SVN.

Python 2.7 (trunk:86836, Nov 27 2010, 18:23:07) 
[GCC 4.4.5] on linux2
Type help, copyright, credits or license for more information.
 class A(object):
... pass
... 
 class B(object):
... attr = staticmethod(A)
... 
 help(B)
Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/milko/Среда/Python/trunk/Lib/site.py, line 453, in __call__
return pydoc.help(*args, **kwds)
  File /home/milko/Среда/Python/trunk/Lib/pydoc.py, line 1720, in __call__
self.help(request)
  File /home/milko/Среда/Python/trunk/Lib/pydoc.py, line 1767, in help
else: doc(request, 'Help on %s:')
  File /home/milko/Среда/Python/trunk/Lib/pydoc.py, line 1508, in doc
pager(render_doc(thing, title, forceload))
  File /home/milko/Среда/Python/trunk/Lib/pydoc.py, line 1503, in render_doc
return title % desc + '\n\n' + text.document(object, name)
  File /home/milko/Среда/Python/trunk/Lib/pydoc.py, line 327, in document
if inspect.isclass(object): return self.docclass(*args)
  File /home/milko/Среда/Python/trunk/Lib/pydoc.py, line 1216, in docclass
lambda t: t[1] == 'static method')
  File /home/milko/Среда/Python/trunk/Lib/pydoc.py, line 1162, in spill
name, mod, object))
  File /home/milko/Среда/Python/trunk/Lib/pydoc.py, line 327, in document
if inspect.isclass(object): return self.docclass(*args)
TypeError: docclass() takes at most 4 arguments (5 given)

Python 3.2a4+ (py3k:86836, Nov 27 2010, 18:35:01) 
[GCC 4.4.5] on linux2
Type help, copyright, credits or license for more information.
 class A:
... pass
... 
 class B:
... attr = staticmethod(A)
... 
 help(B)
Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/milko/Среда/Python/py3k/Lib/site.py, line 447, in __call__
return pydoc.help(*args, **kwds)
  File /home/milko/Среда/Python/py3k/Lib/pydoc.py, line 1713, in __call__
self.help(request)
  File /home/milko/Среда/Python/py3k/Lib/pydoc.py, line 1760, in help
else: doc(request, 'Help on %s:')
  File /home/milko/Среда/Python/py3k/Lib/pydoc.py, line 1504, in doc
pager(render_doc(thing, title, forceload))
  File /home/milko/Среда/Python/py3k/Lib/pydoc.py, line 1499, in render_doc
return title % desc + '\n\n' + text.document(object, name)
  File /home/milko/Среда/Python/py3k/Lib/pydoc.py, line 319, in document
if inspect.isclass(object): return self.docclass(*args)
  File /home/milko/Среда/Python/py3k/Lib/pydoc.py, line 1214, in docclass
lambda t: t[1] == 'static method')
  File /home/milko/Среда/Python/py3k/Lib/pydoc.py, line 1159, in spill
name, mod, object))
  File /home/milko/Среда/Python/py3k/Lib/pydoc.py, line 319, in document
if inspect.isclass(object): return self.docclass(*args)
TypeError: docclass() takes at most 4 positional arguments (5 given)

--
components: Library (Lib)
messages: 122535
nosy: milko.krachounov
priority: normal
severity: normal
status: open
title: help(cls1) breaks when cls1 has staticmethod(cls2) attribute
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

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



[issue10549] help(cls1) breaks when cls1 has staticmethod(cls2) attribute

2010-11-27 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

Confirmed in py3k.

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

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



[issue10499] Modular interpolation in configparser

2010-11-27 Thread Łukasz Langa

Łukasz Langa luk...@langa.pl added the comment:

Patch reposted here for review: http://codereview.appspot.com/3309043/

--

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



[issue10549] help(cls1) breaks when cls1 has staticmethod(cls2) attribute

2010-11-27 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

The fix is simple:


--- Lib/pydoc.py(revision 86824)
+++ Lib/pydoc.py(working copy)
@@ -1110,7 +1110,7 @@
 result = result + self.section('FILE', file)
 return result
 
-def docclass(self, object, name=None, mod=None):
+def docclass(self, object, name=None, mod=None, *ignored):
 Produce text documentation for a given class object.
 realname = object.__name__
 name = name or realname

I think this is the right thing to do because HTMLDoc.docclass() has the 
following signature.


def docclass(self, object, name=None, mod=None, funcs={}, classes={},
 *ignored):

--
stage: needs patch - unit test needed

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



[issue10549] help(cls1) breaks when cls1 has staticmethod(cls2) attribute

2010-11-27 Thread Éric Araujo

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


--
nosy: +eric.araujo, ncoghlan, ron_adam
versions:  -Python 2.6

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



[issue10550] Windows: leak in test_concurrent_futures

2010-11-27 Thread Stefan Krah

New submission from Stefan Krah stefan-use...@bytereef.org:

C:\Users\stefan\svn\py3k_64PCbuild\amd64\python_d.exe Lib\test\regrtest.py -R 
: test_concurrent_futures
[1/1] test_concurrent_futures
beginning 9 repetitions
123456789
.
test_concurrent_futures leaked [6912, 6912, 6912, 6912] references, sum=27648
1 test failed:
test_concurrent_futures
[195615 refs]

--
components: Extension Modules
messages: 122539
nosy: skrah
priority: normal
severity: normal
status: open
title: Windows: leak in test_concurrent_futures
type: resource usage
versions: Python 3.2

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



[issue10520] Build with --enable-shared fails

2010-11-27 Thread Łukasz Langa

Łukasz Langa luk...@langa.pl added the comment:

Roumen's patch fixes a regression where readline extension would fail to build 
on Mac OS X 10.6.5.

--
nosy: +lukasz.langa
resolution: fixed - 
stage:  - commit review
status: closed - open

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



[issue10550] Windows: leak in test_concurrent_futures

2010-11-27 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

posixmodule_listdir.patch fixes a leak in test_macpath. test_concurrent_futures 
still leaks.

--
keywords: +patch
Added file: http://bugs.python.org/file19839/posixmodule_listdir.patch

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



[issue10551] mimetypes reading from registry in windows completely broken

2010-11-27 Thread Kovid Goyal

New submission from Kovid Goyal ko...@kovidgoyal.net:

Hi,

I am the primary developer of calibre (http:/calibre-ebook.com) and yesterday I 
released an upgrade of calibre based on python 2.7. Here is a small sampling of 
all the diverse errors that my users experienced, related to reading mimetypes 
from the registry:

1. Permission denied if running from non privileged account
Traceback (most recent call last):
File site.py, line 103, in main
File site.py, line 84, in run_entry_point
File site-packages\calibre\__init__.py, line 31, in module
File mimetypes.py, line 344, in add_type
File mimetypes.py, line 355, in init
File mimetypes.py, line 261, in read_windows_registry
WindowsError: [Error 5] Acceso denegado (Access not allowed)

The fix for this is to trap WindowsError and ignore it in mimetypes.py

2. Mishandling of encoding of registry entries

Traceback (most recent call last):  
  File site.py, line 103, in main 
  File site.py, line 84, in run_entry_point
  File site-packages\calibre\__init__.py, line 31, in module

  File mimetypes.py, line 344, in add_type

  File mimetypes.py, line 355, in init

  File mimetypes.py, line 260, in read_windows_registry   

  File mimetypes.py, line 250, in enum_types  

UnicodeDecodeError: 'utf8' codec can't decode byte 0xe0 in position 0: invalid 
continuation byte

The fix for this is to change

except UnicodeEncodeError

to

except ValueError

3. python -c import mimetypes; print mimetypes.guess_type('img.jpg')
('image/pjpeg', None)

Where the output should have been

(image/jpeg', None)

The fix for this is to load the registry entries before the default entris 
defined in mimetypes.py


Of course, IMHO, the best possible fix is to simply remove the reading of 
mimetypes from the registry. But that is up to whoever maintains this module. 

Duplicate (less comprehensive) tickets ont his isuue in your traceker already 
are: 9291, 10490, 104314

If the maintainer of this module is unable to fix these issues, let me know and 
I will submit a patch, either removing _winreg or fixing the issues 
individually.

--
components: Library (Lib)
messages: 122542
nosy: kovid
priority: normal
severity: normal
status: open
title: mimetypes reading from registry in windows completely broken
versions: Python 2.7

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



[issue10550] Windows: leak in test_concurrent_futures

2010-11-27 Thread Stefan Krah

Changes by Stefan Krah stefan-use...@bytereef.org:


--
nosy: +bquinlan

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



[issue10551] mimetypes reading from registry in windows completely broken

2010-11-27 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

The first issue you note appears to be a duplicate of Issue10162, a fix for 
which should be available in the 2.7.1 maintenance release.

The second issue appears to be a duplicate of Issue9291.  Since that issue is 
still open, I suggest any further discussion be pursued there.  You may want to 
add yourself to the nosy list of that issue.

--
components: +Windows
nosy: +brian.curtin, ned.deily
resolution:  - duplicate
status: open - closed
superseder:  - mimetypes initialization fails on Windows because of non-Latin 
characters in registry

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



[issue10541] regrtest.py -T broken

2010-11-27 Thread Antoine Pitrou

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

`make coverage` is fine, you just have to use the -m test.regrtest form when 
running the tests.

--
nosy: +pitrou
resolution:  - invalid
status: open - pending

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



[issue10541] regrtest.py -T broken

2010-11-27 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

I would like to investigate this some more.  In theory, regrtest should restore 
cwd before coverage results are written.

--
status: pending - open

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



[issue10520] Build with --enable-shared fails

2010-11-27 Thread Barry A. Warsaw

Barry A. Warsaw ba...@python.org added the comment:

r86837

--
resolution:  - fixed
status: open - closed

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



[issue10537] OS X IDLE 2.7rc1 from 64-bit installer hangs when you paste something.

2010-11-27 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

Regardless of the root cause, I really hate to see 2.7.1 go out with this 
unresolved.  As it stands, IDLE was broken in the 2.7 64-bit OS X installer for 
2.7 and, as it stands, is still broken.  And whether it is an Apple Tk problem 
or not (which remains to be determined), there are workarounds that could be 
applied - like having a 32-bit-only IDLE built with Aqua Tk 8.4 as the 32-bit 
installers do.

--
nosy: +benjamin.peterson

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



[issue10521] str methods don't accept non-BMP fillchar on a narrow Unicode build

2010-11-27 Thread Terry J. Reedy

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

After reading the additional messages here and on a similar issue Alexander 
opened after this, I seem the point of wanting to make the difference between 
the two types of builds as transparent as sensibly possible. From that 
viewpoint, rejection of composed chars is not as bad because both types of 
builds act the same.

--

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



[issue10552] Tools/unicode/gencodec.py error

2010-11-27 Thread Alexander Belopolsky

New submission from Alexander Belopolsky belopol...@users.sourceforge.net:

$ ../../python.exe gencodec.py MAPPINGS/VENDORS/MISC/ build/
converting APL-ISO-IR-68.TXT to build/apl_iso_ir_68.py and 
build/apl_iso_ir_68.mapping
converting ATARIST.TXT to build/atarist.py and build/atarist.mapping
converting CP1006.TXT to build/cp1006.py and build/cp1006.mapping
converting CP424.TXT to build/cp424.py and build/cp424.mapping
Traceback (most recent call last):
  File gencodec.py, line 421, in module
convertdir(*sys.argv[1:])
  File gencodec.py, line 391, in convertdir
pymap(mappathname, map, dirprefix + codefile,name,comments)
  File gencodec.py, line 355, in pymap
code = codegen(name,map,encodingname,comments)
  File gencodec.py, line 268, in codegen
precisions=(4, 2))
  File gencodec.py, line 152, in python_mapdef_code
mappings = sorted(map.items())
TypeError: unorderable types: NoneType()  int()

It does appear to have been updated for 3.x:

$ python2.7 gencodec.py MAPPINGS/VENDORS/MISC/ build/
Traceback (most recent call last):
  File gencodec.py, line 35, in module
UNI_UNDEFINED = chr(0xFFFE)
ValueError: chr() arg not in range(256)

--
components: Demos and Tools
messages: 122549
nosy: belopolsky, lemburg
priority: normal
severity: normal
status: open
title: Tools/unicode/gencodec.py error
type: behavior
versions: Python 3.2

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



[issue7962] Demo and Tools need to be tested and pruned

2010-11-27 Thread Alexander Belopolsky

Changes by Alexander Belopolsky belopol...@users.sourceforge.net:


--
dependencies: +Tools/unicode/gencodec.py error

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



[issue9763] Crashes upon run after syntax error encountered in OSX 10.5.8

2010-11-27 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

Adding the nosy list from Issue6628 where this problem was originally reported. 
 What's interesting about this is that IDLE 2.x does not exhibit this behavior, 
AFAICT, when using the same Apple Tk 8.4.  As there are other odd behaviors 
with IDLE 3.x on OS X, I want to investigate this further.

--
nosy: +brian89, ronaldoussoren

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



[issue6628] IDLE freezes after encountering a syntax error

2010-11-27 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

This issue was reported again in Issue9763; at the time, I overlooked your 
original report.  As there is a more recent discussion of it over there, I am 
going to close this as a duplicate and add you to the nosy list there.

--
resolution:  - duplicate
status: open - closed
superseder:  - Crashes upon run after syntax error encountered in OSX 10.5.8

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



[issue10553] Add optimize argument to builtin compile() and byte-compilation modules

2010-11-27 Thread Georg Brandl

New submission from Georg Brandl ge...@python.org:

This patch adds an optimize parameter to compile(), as discussed in 
http://mail.python.org/pipermail/python-ideas/2010-November/008784.html.

I also needed to introduce two new C APIs.  Better naming suggestions are 
welcome.

--
components: Library (Lib)
files: compile-optimize.diff
keywords: patch
messages: 122552
nosy: georg.brandl, krisvale
priority: normal
severity: normal
status: open
title: Add optimize argument to builtin compile() and byte-compilation modules
type: feature request
versions: Python 3.2
Added file: http://bugs.python.org/file19840/compile-optimize.diff

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



[issue10107] Quitting IDLE on Mac doesn't save unsaved code

2010-11-27 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

Considering the discussion on the idle-dev list back in October about this 
issue, I think this low-risk, high-benefit fix should be going into all three 
upcoming releases.

--
nosy: +benjamin.peterson, georg.brandl
priority: high - critical

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



[issue10554] Context managerment support for subprocess.Popen

2010-11-27 Thread Éric Araujo

New submission from Éric Araujo mer...@netwok.org:

I propose that __enter__ and __exit__ be added to subprocess.Popen.  __enter__ 
returns self, __exit__ closes open file descriptors.

__exit__ could also do the same checks that __del__ does (and which I don’t 
entirely understand.

See also os.popen (os._wrap_close).

--
components: Library (Lib)
keywords: easy
messages: 122554
nosy: eric.araujo
priority: normal
severity: normal
stage: needs patch
status: open
title: Context managerment support for subprocess.Popen
type: feature request
versions: Python 3.2

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



[issue10478] Ctrl-C locks up the interpreter

2010-11-27 Thread Antoine Pitrou

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

Here is a patch raising RuntimeError on reentrant calls to a buffered object. I 
haven't touched _pyio; I wonder how to do it without making it even slower.

--
keywords: +patch
Added file: http://bugs.python.org/file19841/reentrantio.patch

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



[issue1731717] race condition in subprocess module

2010-11-27 Thread James Lamanna

James Lamanna jlama...@gmail.com added the comment:

stubbing out subprocess._cleanup does not work around the problem from this 
example on 2.6.5:

import subprocess, signal
subprocess._cleanup = lambda: None

signal.signal(signal.SIGCLD, signal.SIG_IGN)
subprocess.Popen(['echo','foo']).wait()

ja...@hyla:~$ python tt.py
foo
Traceback (most recent call last):
  File tt.py, line 5, in module
subprocess.Popen(['echo','foo']).wait()
  File /usr/lib/python2.6/subprocess.py, line 1170, in wait
pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)
  File /usr/lib/python2.6/subprocess.py, line 465, in _eintr_retry_call
return func(*args)
OSError: [Errno 10] No child processes

This bug still prevents subprocess from being used inside of a daemon where 
SIGCLD is being caught to reap zombie processes.

--
nosy: +jlamanna

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



[issue10478] Ctrl-C locks up the interpreter

2010-11-27 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
stage:  - patch review
versions: +Python 2.7, Python 3.1

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



[issue3548] subprocess.pipe function

2010-11-27 Thread Éric Araujo

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

pipe.patch looks interesting to me.  I would replace **kwargs with a 
keyword-only argument named stderr, since that’s the only key used.  This 
requires more tests and docs.

--
nosy: +eric.araujo

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



[issue9264] trace.py documentation is incomplete

2010-11-27 Thread Terry J. Reedy

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

Éric, please feel free to commit (and even grab Assigned To:) when you feel 
patch is ready. You can do final review better than me.

--
versions:  -Python 3.1

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



  1   2   3   >