pyexiv2 0.3.0 released

2011-01-01 Thread Olivier Tilloy
Hello Python users and developers,

I'm pleased to announce that pyexiv2 0.3.0 [1], codename A Good Year,
was released today.

pyexiv2 is a python binding to exiv2 [2], the C++ library for
manipulation of EXIF, IPTC and XMP image metadata.
It is a python module that allows your python scripts to read *and*
write metadata (EXIF, IPTC, XMP, thumbnails) embedded in image files
(JPEG, TIFF, ...).

It is designed as a high-level interface to the functionalities offered
by libexiv2. Using python's built-in data types and standard modules, it
provides easy manipulation of image metadata.

This series remains fully backward compatible with its predecessor, the
0.2 series, which should ease the transition away from the antiquated
0.1 series.

The highlights of this release are:
 - Compiles and tested (on linux and windows) against libexiv2 0.19,
0.20, 0.21
 - ImageMetadata implements the collections.MutableMapping interface
 - Consistent API across all types of tags to access the value(s)
 - Read/write access to the EXIF thumbnail
 - Decode and encode EXIF comments according to the specified charset
 - API to (un)register custom XMP namespaces
 - API to get, set and delete the (optional) IPTC charset
 - Added pickling support to tags
 - Use fractions.Fraction when available in the standard library (Python
≥ 2.6)

Feedback, suggestions and bug reports are welcome at
https://launchpad.net/pyexiv2.

Cheers,

Olivier


[1] https://launchpad.net/pyexiv2/0.3.x/0.3
[2] http://exiv2.org
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

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


ackward 0.1

2011-01-01 Thread Austin Bingham
ackward provides a C++ interface to some of the standard Python
modules, and is aimed at simplifying some extension/embedding tasks.

This is the first release of the ackward library. It includes pretty
good support for the uuid, logging, time, and datetime modules.

Project page: http://code.google.com/p/ackward/
Download: http://ackward.googlecode.com/files/ackward-0.1.tar.bz2
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

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


Pydev 1.6.4 Released

2011-01-01 Thread Fabio Zadrozny
Hi All,

Pydev 1.6.4 has been released

Details on Pydev: http://pydev.org
Details on its development: http://pydev.blogspot.com

Release Highlights:
---

 * Improved Unittest integration:
  o Created a PyUnit view (with a red/green bar) which can be used
to see the results of tests and relaunching them
  o The default test runner now allows parallel execution
(distributing tests by module or individually)
  o The nose and py.test test runners are also supported now

 * Major Bug Fixed: existing interpreters could be corrupted when
adding a new one
 * Fixed AttributeError on console startup in Python 3.0
 * Added theming and automatic sash orientation to the pydev code coverage view
 * Patch by frigo7: When creating a new remote debugger target, the
terminated ones are removed
 * Patch by frigo7: compare editor properly showing the revision
information and fixed broken shortcuts (e.g.: ctrl+z)
 * Read-only files no longer editable in pydev actions
 * Fixed issue of remaining \r on python 3.0 on input()
 * The pydev parser is now properly dealing with bom (utf-8)
 * Assign to local: if method starts with '_', the leading '_' is not
added to the local


What is PyDev?
---

PyDev is a plugin that enables users to use Eclipse for Python, Jython
and IronPython development -- making Eclipse a first class Python IDE
-- It comes with many goodies such as code completion, syntax
highlighting, syntax analysis, refactor, debug and many others.


Cheers,

-- 
Fabio Zadrozny
--
Software Developer

Aptana
http://aptana.com/

Pydev - Python Development Environment for Eclipse
http://pydev.org
http://pydev.blogspot.com
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

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


decorator 3.3 is out

2011-01-01 Thread Michele Simionato
Thanks to the holiday period I found the time to add to the decorator
module a long-awaited feature, the ability to understand and to
preserve Python 3 function annotations. I have just released version
3.3 which implements such feature. It should be considered at an
experimental stage. If you use Python 3 and function annotations you
may want to try out the new decorator module (easy_install decorator)
and give me feedback.

See http://pypi.python.org/pypi/decorator for more.

Thanks for your time and Happy New Year to all fellows Pythonistas!

 Michele Simionato

P.S. today I have also released a new bug-fixed version of plac (see
http://pypi.python.org/pypi/plac)
-- 
http://mail.python.org/mailman/listinfo/python-list


How to port bytes formatting to Python 3.x ?

2011-01-01 Thread Baptiste Lepilleur
Hi,
I'm trying to port a small library to Python 3.x, and I'm wondering what is
the best way to port statements such as the one belows that are  frequently
found in network protocol implementation:

headerparts = (%s:%s\n % (key, value) for key, value in
headers.iteritems())
framebytes = %s\n%s\n%s\x00 % (command, .join(headerparts),
body)

Where all manipulated string are actually bytes, though value in headers
dict may be any objects.

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


How to define a bytes literal in Python 2.x for porting to Python 3.x using 2to3?

2011-01-01 Thread Baptiste Lepilleur
Hi,

I'm trying to port some network protocol library to Python 3.x, and it
defines many bytes literals as plain string.



How do you define bytes literals so that the library can be ported to Python
3.x using only 2to3? For example:



In python 2.x, I need:

self.buffer = '\n'



In python 3.x, I need:

self.buffer = b'\n'



Is there a way to mark string literals so that 2to3 automatically prefixes
them with 'b'? Is there a simpler trick?



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


Re: User input masks - Access Style

2011-01-01 Thread flebber
On Jan 1, 11:13 am, Tim Harig user...@ilthio.net wrote:
 On 2010-12-31, flebber flebber.c...@gmail.com wrote:

  On Dec 28 2010, 12:21 am, Adam Tauno Williams awill...@whitemice.org
  wrote:
  On Sun, 2010-12-26 at 20:37 -0800, flebber wrote:
   Is there anyay to use input masks in python? Similar to the function
   found in access where a users input is limited to a type, length and
   format.

  http://faq.pygtk.org/index.py?file=faq14.022.htpreq=show

  Typically this is handled by a callback on a keypress event.

  Regarding 137 of the re module, relating to the code above.

 137? I am not sure what you are referencing?

  EDIT: I just needed to use raw_input rather than input to stop this
  input error.

 Sorry, I used input() because that is what you had used in your example
 and it worked for my system.  Normally, I would have used window.getstr()
 from the curses module, or whatever the platform equivilant is, for
 getting line buffered input.

137 is the line number in the re module which refernces the match
string. In this example the timeinput.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to define a bytes literal in Python 2.x for porting to Python 3.x using 2to3?

2011-01-01 Thread Terry Reedy

On 1/1/2011 4:08 AM, Baptiste Lepilleur wrote:


Is there a way to mark string literals so that 2to3 automatically
prefixes them with 'b'? Is there a simpler trick?


Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit 
(Intel)] on win32

Type copyright, credits or license() for more information.
 b=b'abc'
 b
'abc'

The b prefix does nothing in 2.7. It was specifically added for this 
type of porting problem.


--
Terry Jan Reedy

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


Re: How to define a bytes literal in Python 2.x for porting to Python 3.x using 2to3?

2011-01-01 Thread Stefan Behnel

Terry Reedy, 01.01.2011 11:08:

On 1/1/2011 4:08 AM, Baptiste Lepilleur wrote:


Is there a way to mark string literals so that 2to3 automatically
prefixes them with 'b'? Is there a simpler trick?


Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit
(Intel)] on win32
Type copyright, credits or license() for more information.
  b=b'abc'
  b
'abc'

The b prefix does nothing in 2.7. It was specifically added for this type
of porting problem.


More precisely, it was added in Python 2.6, so older Python versions will 
consider it a syntax error.


To support older Python versions, you need to write your own wrapper 
functions for bytes literals that do nothing in Python 2 and convert the 
literal back to a bytes literal in Python 3. That's ugly, but there's no 
other way to do it.


Stefan

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


Re: How to port bytes formatting to Python 3.x ?

2011-01-01 Thread Stefan Behnel

Baptiste Lepilleur, 01.01.2011 10:01:

Hi,
I'm trying to port a small library to Python 3.x, and I'm wondering what is
the best way to port statements such as the one belows that are  frequently
found in network protocol implementation:

 headerparts = (%s:%s\n % (key, value) for key, value in
headers.iteritems())
 framebytes = %s\n%s\n%s\x00 % (command, .join(headerparts),
body)

Where all manipulated string are actually bytes, though value in headers
dict may be any objects.


See my answer in the other thread you started on this topic. You need to 
wrap the literal in a function call that converts it to a bytes literal 
when running in Python 3.


Stefan

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


Re: How to define a bytes literal in Python 2.x for porting to Python 3.x using 2to3?

2011-01-01 Thread Baptiste Lepilleur
2011/1/1 Stefan Behnel stefan...@behnel.de

 Terry Reedy, 01.01.2011 11:08:

  On 1/1/2011 4:08 AM, Baptiste Lepilleur wrote:

  Is there a way to mark string literals so that 2to3 automatically
 prefixes them with 'b'? Is there a simpler trick?


 Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit
 (Intel)] on win32
 Type copyright, credits or license() for more information.
   b=b'abc'
   b
 'abc'

 The b prefix does nothing in 2.7. It was specifically added for this type
 of porting problem.


 More precisely, it was added in Python 2.6, so older Python versions will
 consider it a syntax error.

 To support older Python versions, you need to write your own wrapper
 functions for bytes literals that do nothing in Python 2 and convert the
 literal back to a bytes literal in Python 3. That's ugly, but there's no
 other way to do it.


Thanks, I'll go that way. I guess it is an area where 3to2 would be
better...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to port bytes formatting to Python 3.x ?

2011-01-01 Thread Baptiste Lepilleur
2011/1/1 Stefan Behnel stefan...@behnel.de

 Baptiste Lepilleur, 01.01.2011 10:01:

  Hi,
 I'm trying to port a small library to Python 3.x, and I'm wondering what
 is
 the best way to port statements such as the one belows that are
  frequently
 found in network protocol implementation:
 ...

 See my answer in the other thread you started on this topic. You need to
 wrap the literal in a function call that converts it to a bytes literal when
 running in Python 3.


Is there a robust implementation of the format operator % for bytes that can
substitute %s?

I've stumbled on a bug on Mysql python 3 connector due to a buggy attempt
to replace it (see https://bugs.launchpad.net/myconnpy/+bug/691836).

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


Interesting bug

2011-01-01 Thread joy99
Dear Group,

Hope all of you are fine and spending nice new year evenings.

I get a bug in Python over the last 4 years or so, since I am using
it. The language is superb, no doubt about it. It helped me finish
many a projects, with extraordinary accuracy. But long since, I was
getting an interesting bug. In the initial days, I thought it may be
my learning error or usability error. It comes every now and then. The
bug is suppose I am calling a library or using some logical operator,
it works fine initially but if I want to copy the code to some other
modules, same line of codes do not run at all.

The remedy I do is,
(a) I take the code from file and test it in GUI, more astonishingly
in 99% of the cases I found the code llines, are correct.
Then I apply a brute force technique I rewrite the whole code again.
For small codes this technique is okay, but if I write mammoth code,
and all on a sudden some interesting behavior came out, well it really
feels bad. I keep now a days some time out that I have to do this, but
is there any definite solution? I believe there is some, as I do not
know them, as it happens, unnecessarily get upset.

I use Python on WinXP service pack2, I started to use Python2.5.1, and
now I am using Python2.6.5, IDLE as GUI.

Best Regards,
Subhabrata
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to port bytes formatting to Python 3.x ?

2011-01-01 Thread Stefan Behnel

Baptiste Lepilleur, 01.01.2011 12:53:

2011/1/1 Stefan Behnel

Baptiste Lepilleur, 01.01.2011 10:01:

I'm trying to port a small library to Python 3.x, and I'm wondering what
is the best way to port statements such as the one belows that are
frequently found in network protocol implementation:
...


See my answer in the other thread you started on this topic. You need to
wrap the literal in a function call that converts it to a bytes literal when
running in Python 3.


Is there a robust implementation of the format operator % for bytes that can
substitute %s?


Concatenation is portable and seems to suite your examples (which you 
stripped above). For more involved cases (as are also likely to occur in 
network protocol code), have a look at the struct module.


http://docs.python.org/py3k/library/struct.html

Stefan

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


Re: Interesting bug

2011-01-01 Thread Daniel Fetchinson
 Dear Group,

 Hope all of you are fine and spending nice new year evenings.

 I get a bug in Python over the last 4 years or so, since I am using
 it. The language is superb, no doubt about it. It helped me finish
 many a projects, with extraordinary accuracy. But long since, I was
 getting an interesting bug. In the initial days, I thought it may be
 my learning error or usability error. It comes every now and then. The
 bug is suppose I am calling a library or using some logical operator,
 it works fine initially but if I want to copy the code to some other
 modules, same line of codes do not run at all.

 The remedy I do is,
 (a) I take the code from file and test it in GUI, more astonishingly
 in 99% of the cases I found the code llines, are correct.
 Then I apply a brute force technique I rewrite the whole code again.
 For small codes this technique is okay, but if I write mammoth code,
 and all on a sudden some interesting behavior came out, well it really
 feels bad. I keep now a days some time out that I have to do this, but
 is there any definite solution? I believe there is some, as I do not
 know them, as it happens, unnecessarily get upset.

 I use Python on WinXP service pack2, I started to use Python2.5.1, and
 now I am using Python2.6.5, IDLE as GUI.

 Best Regards,
 Subhabrata

An AI bot is playing a trick on us.
Focus and don't let your guards down!

Cheers,
Daniel



-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: kinterbasdb error connection

2011-01-01 Thread Uwe Grauer
On 12/31/2010 04:41 PM, Ale Ghelfi wrote:
 On 09/12/2010 15:17, Uwe Grauer wrote:
 On 12/07/2010 04:35 PM, Ale Ghelfi wrote:
 (i'm under Ubuntu 10.10 amd64 and python 2.6 and kinterbasdb 3.2 )
 I try to connect my database of firebird 2.5 by kinterbasdb.
 But python return this error :


 You are not using the current kinterbasdb version.
 See:
 http://firebirdsql.org/index.php?op=develsub=python

 Uwe

 kinterbasdb 3.2.3 is the Really current version for Ubuntu 10.10 AMD64.
 Kinterbasdb 3.3.0 exists only for ubuntu 10.10 i386
 I've check in the repository.
 
 

AFAIK 3.2.3 doesn't work for FB 2.5.
If you don't get 3.3.0 from the ubuntu repositories you could
do a manual install for 3.3.0

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


Re: Interesting bug

2011-01-01 Thread joy99
On Jan 1, 6:22 pm, Daniel Fetchinson fetchin...@googlemail.com
wrote:
  Dear Group,

  Hope all of you are fine and spending nice new year evenings.

  I get a bug in Python over the last 4 years or so, since I am using
  it. The language is superb, no doubt about it. It helped me finish
  many a projects, with extraordinary accuracy. But long since, I was
  getting an interesting bug. In the initial days, I thought it may be
  my learning error or usability error. It comes every now and then. The
  bug is suppose I am calling a library or using some logical operator,
  it works fine initially but if I want to copy the code to some other
  modules, same line of codes do not run at all.

  The remedy I do is,
  (a) I take the code from file and test it in GUI, more astonishingly
  in 99% of the cases I found the code llines, are correct.
  Then I apply a brute force technique I rewrite the whole code again.
  For small codes this technique is okay, but if I write mammoth code,
  and all on a sudden some interesting behavior came out, well it really
  feels bad. I keep now a days some time out that I have to do this, but
  is there any definite solution? I believe there is some, as I do not
  know them, as it happens, unnecessarily get upset.

  I use Python on WinXP service pack2, I started to use Python2.5.1, and
  now I am using Python2.6.5, IDLE as GUI.

  Best Regards,
  Subhabrata

 An AI bot is playing a trick on us.
 Focus and don't let your guards down!

 Cheers,
 Daniel

 --
 Psss, psss, put it down! -http://www.cafepress.com/putitdown

Thanks for the suggestion. I'll keep it checked. Some useless fellows
forget their own business and poke nose into others business.
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Nagios

2011-01-01 Thread Robert

On 2010-12-31 23:57:24 -0500, Adam Skutt said:


On Friday, December 31, 2010 9:56:02 PM UTC-5, Robert H wrote:

It was forked to be written in Python, yes. The whole point (and it
wasn't a Nagios port to Tcl) was that the Tcl community (and I like the
Tcl community a lot) has a strange fixation with not reinventing the
wheel, even when the wheel would be in Tcl and it might give Tcl more
exposure. It is what it is though.

--


Perhaps because they'd rather do something useful with the tool they've 
created instead of trying to win some sort of nonexistent popularity 
contest?  What value would there be in that?


Not trying to reinvent the wheel whenever feasible is both good 
programming and good engineering most of the time.  Unfortunately, the 
fact you see this as irksome only paints you in a negative light.


Adam


Right, just because you say it paints me in a negative light. Look at 
every language out there and look within the groups. Everyone is trying 
to revinvent the wheel to (in their view) make it better. Your argument 
is sad to me.


--
Robert


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


Portable Python challenge - round 1

2011-01-01 Thread Perica Zivkovic
All,

Portable Python challenge - round 1 has started ! 

Answer one simple question and you can win 4GB USB fingerprint drive. 

http://www.egistec.com/en/sensors/fingerprintUSB.aspx

This round of Portable Python challenge is sponsored by EgisTec Inc. In the 
future challenges we will test your knowledge of Python programming, Python 
language concepts and history of the language itself. Follow us and discover 
more: http://www.PortablePython.com

Winner will be announced on the Portable Python project portal by the end of 
this month.


Keep pythoning !


Perica Zivkovic
http://www.PortablePython.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Nagios

2011-01-01 Thread Adam Skutt
On Saturday, January 1, 2011 10:00:06 AM UTC-5, Robert H wrote:

 Right, just because you say it paints me in a negative light. Look at 
 every language out there and look within the groups. Everyone is trying 
 to revinvent the wheel to (in their view) make it better. 

Everyone is doing nothing of the sort, hence why Tcl irks you.  Or are you 
so forgetful that you can't even remember what you said a few days ago?

 Your argument is sad to me.

At least I've made an argument, whereas you've done nothing of the sort.  Just 
because you take wheel reinvention == good as a tautology doesn't mean everyone 
else does.  Again, what point is there in attempting to win a non-existent 
popularity contest?

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


python etl tool

2011-01-01 Thread krishna kumar
can u please list out the etl tool which has been devloped in python and it
is being used in market now? or just list me the etl tools developed in
python?


Thanks
  Krishnakumar.A
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to define a bytes literal in Python 2.x for porting to Python 3.x using 2to3?

2011-01-01 Thread Terry Reedy

On 1/1/2011 5:57 AM, Stefan Behnel wrote:

Terry Reedy, 01.01.2011 11:08:

On 1/1/2011 4:08 AM, Baptiste Lepilleur wrote:


Is there a way to mark string literals so that 2to3 automatically
prefixes them with 'b'? Is there a simpler trick?


Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit
(Intel)] on win32
Type copyright, credits or license() for more information.
 b=b'abc'
 b
'abc'

The b prefix does nothing in 2.7. It was specifically added for this type
of porting problem.


More precisely, it was added in Python 2.6, so older Python versions
will consider it a syntax error.


'so' here means 'as a consequence' rather than 'with the intention' ;-).


To support older Python versions, you need to write your own wrapper
functions for bytes literals that do nothing in Python 2 and convert the
literal back to a bytes literal in Python 3. That's ugly, but there's no
other way to do it.


I think the developers expected that most maintained and updated 2.x 
code, especially code targeted at 3.x also, would be migrated to 2.6+.


--
Terry Jan Reedy

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


Re: Portable Python challenge - round 1

2011-01-01 Thread Terry Reedy

On 1/1/2011 10:14 AM, Perica Zivkovic wrote:

All,

Portable Python challenge - round 1 has started !

Answer one simple question and you can win 4GB USB fingerprint
drive.


In exchange for name and email...

The question: What is the exact date (day month and year) of the first 
Portable Python release ?



Winner will be announced on the Portable Python project portal by the
end of this month.


The idea of Python on a thumbstick is good. However, Distributing 
quickly superseded Python 3.0, with its known problems, instead of much 
improved 3.1 is, in my opinion, a disservice to the community.


And why 2.6.1 instead of 2.6.6 with perhaps a couple of hundred bugfixes?


--
Terry Jan Reedy

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


Re: Portable Python challenge - round 1

2011-01-01 Thread Perica Zivkovic
Hi Terry,

when those versions of Portable Python were published, they were the latest 
available versions of Python. Unfortunately I did not had time to update them 
since the last release. 

regards,

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


Re: Tkinter: The good, the bad, and the ugly!

2011-01-01 Thread rantingrick
On Dec 31 2010, 8:47 am, Adam Skutt ask...@gmail.com wrote:


Ok, at this point i am not going to respond to the last few posts that
where directed at me. What i am going to do is to restate my
intentions at the time i started this thread.

First and foremost i want everyone to know that i have tons of GUI
code that utilizes the Tkinter module and feel very confident crating
GUI's with Tkinter. I am not some novice who tried to write up a hello
world GUI, got aggravated, and then decided to vent about it. Quite to
the contrary...

I actually like Tkinter's simplistic API. I especially love Tkinter
geometry management! However i realize that TclTk is lacking and
because of that fact we will always be at the mercy of another
community. This bothers me, and it should also bother you. Tk has a
glass ceiling that cannot be broken by you, or me, or anyone in the
Python community. If we are to have a GUI library it should be one
that is up to date and feature rich. In the latter case there may
still be a glass ceiling but it is so high they we will never notice
anyway!

However be aware that GUI's libraries are large beasts. You cannot
cram everything into the stdlib. So what should go into the stdlib
then? Well only a very limited subset of widgets. Some might say that
you will be limited with a limited subset, well i must agree with
argument :). Some might also say that a glass half full is also half
empty, duh!

Everyone needs to realize that the only reason for having ANY GUI in
the Python stdlib is for ease of learning and also for batteries
included. We just want the basics of a GUI with an extension library
available for download. There are two major advantages to this
setup...

1. The basics never change. So the Python stdlib GUI module becomes
a set it and forget it module. The Python GUI extension library
can change all it wants and Python remain backwards compatible.

2. By relegating the bloat to an external download the stdlib is kept
as small as possible.

... These two talking points are the main idea behind this whole damn
discussion i initiated. We need to look beyond our own selfish needs
and think about the community first. Anyone who truly cares about
Python's stability and future will agree with these two points.

I'll repeat... TclTk has had a whole decade to become a 21st century
GUI library. I really don't think the motivation is there. Some will
argue that ttk brings in the new widgets necessary to compete with a
full featured GUI like wxPython -- and they could not be more wrong!

There is no real Tk::Grid. Sure as someone suggested you can mimic a
grid with another widget, it's just lipstick on a pig really. Go and
check out the wx::Grid with all its wonderful capabilities and then
you shall be enlightened!

This is also no real support for a true Listview widget. Again go
check out wx::ListView with all it's capabilities and ye shall be
further enlightened.

Wx is by far the best choice for Python. A small subset of wx widgets
in the stdlib and ONE (and only one!) downloadable extension library.
Yes the stdlib widgets are only going to cover the most minimal of
GUIs -- for learning purposes, utilities, or just simply toys) If you
plan to do professional GUI work than package the extension library.
It's very simple really.

Geesh! Now i know how the early scientist felt when trying to convince
the lemmings that the earth is not flat!

Flatearther said: You heritic!. If the earth were round we would
fall off the bottom!





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


Re: Portable Python challenge - round 1

2011-01-01 Thread Terry Reedy

On 1/1/2011 3:59 PM, Perica Zivkovic wrote:


when those versions of Portable Python were published, they were the
latest available versions of Python.


2.6.1: December 2008; 3.0.1: February 2009


Unfortunately I did not had time
to update them since the last release.


If you have not done any updates in about 20 months, why are you paying 
people (with a sweepstakes ticket) for name and email?


And why put your effort into this instead of producing a much better 
Python3 release? In spite of efforts otherwise, 3.0 (December 2008) had 
some typical .0 problems. It was quickly (in 2 months) patched a bit and 
them abandoned, with 3.1 release soon after (June 2009, without a 3.1.2, 
as would have been usual) with the recommendation that everyone replace 
3.0 with 3.1. Hence my opinion that promoting 3.0(.1) 18 months later is 
a disservice. Anyone who tries it might get an incorrect bad impression 
and will certainly not get the benefit of subsequent improvements.


--
Terry Jan Reedy

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


Re: How to define a bytes literal in Python 2.x for porting to Python 3.x using 2to3?

2011-01-01 Thread Martin v. Loewis
 To support older Python versions, you need to write your own wrapper
 functions for bytes literals that do nothing in Python 2 and convert the
 literal back to a bytes literal in Python 3. That's ugly, but there's no
 other way to do it.
 
 I think the developers expected that most maintained and updated 2.x
 code, especially code targeted at 3.x also, would be migrated to 2.6+.

Unfortunately, that assumption has hurt Python 3 migration
significantly. It gave the impression that, as long as you need to
support Python 2.5 and earlier, there is no way you could possibly
support Python 3 as well, and that, therefore, starting to support
Python 3 is pointless for many years to come.

I personally never shared that assumption, and encourage people to
ignore these gimmicks that had been added to 2.6 to ease porting.
Instead, people should first determine what Python versions their
users want to see supported, and then look for solutions that cover
all these versions.

In the case of byte literals, the solution is fairly straight-forward,
and only moderately ugly.

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


Re: Portable Python challenge - round 1

2011-01-01 Thread Perica Zivkovic
Well I'm not paying anybody anything. I'm giving USB sticks for free because I 
got them for free from our sponsor :) Name and email I need to be able to know 
where to send them, or you know some easier ways for that ?

And thanks for your suggestion but I'm putting my free time where I want while 
I work on a new release of Portable Python in parallel :)

regards,

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


Re: How to define a bytes literal in Python 2.x for porting to Python 3.x using 2to3?

2011-01-01 Thread Terry Reedy

On 1/1/2011 5:07 PM, Martin v. Loewis wrote:

 I think the developers expected that most maintained and updated 2.x
 code, especially code targeted at 3.x also, would be migrated to 2.6+.

 Unfortunately, that assumption has hurt Python 3 migration
 significantly. It gave the impression that, as long as you need to
 support Python 2.5 and earlier, there is no way you could possibly
 support Python 3 as well, and that, therefore, starting to support
 Python 3 is pointless for many years to come.

 I personally never shared that assumption, and encourage people to
 ignore these gimmicks that had been added to 2.6 to ease porting.
 Instead, people should first determine what Python versions their
 users want to see supported, and then look for solutions that cover
 all these versions.

You have shown that it is easier than some people thought. I think two 
key ideas are these.


1. Code running in multiple versions has to be syntactically correct in 
every detail all versions in order to be compiled without error. 
However, version specific syntax *can* be used in modules that are 
conditionally imported and therefore conditionally compiled and executed.


2. The syntax of function calls has hardly changed and using the common 
subset is no limitation for the overwhelming majority of uses. Moreover, 
function names can be conditionally bound to version-specific function 
objects, whether builtin or imported.


--
Terry Jan Reedy

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


Re: How to define a bytes literal in Python 2.x for porting to Python 3.x using 2to3?

2011-01-01 Thread Martin v. Loewis
 1. Code running in multiple versions has to be syntactically correct in
 every detail all versions in order to be compiled without error.
 However, version specific syntax *can* be used in modules that are
 conditionally imported and therefore conditionally compiled and executed.

I also encourage people to use 2to3. Then this requirement (must be
syntactically correct in all Python versions) goes away: it is ok to
write source that doesn't compile on Python 3, and still *run* it
on Python 3.

OTOH, writing code that only supports newer 2.x versions isn't helped
by 2to3, so compatibility within 2.x is more important to consider than
compatibility between 2.x and 3.x.

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


Re: Nagios

2011-01-01 Thread Robert

On 2011-01-01 10:34:46 -0500, Adam Skutt said:


On Saturday, January 1, 2011 10:00:06 AM UTC-5, Robert H wrote:


Right, just because you say it paints me in a negative light. Look at
every language out there and look within the groups. Everyone is trying
to revinvent the wheel to (in their view) make it better.


Everyone is doing nothing of the sort, hence why Tcl irks you.  Or 
are you so forgetful that you can't even remember what you said a few 
days ago?


Really? How many templating systems does Python have? More than one? 
Why is that? How many web frameworks does Perl have? More than one? Why 
is that?


Why *was* Nagios forked and re-written in Python?

There are too many examples to count.




Your argument is sad to me.


At least I've made an argument, whereas you've done nothing of the 
sort.  Just because you take wheel reinvention == good as a tautology 
doesn't mean everyone else does.  Again, what point is there in 
attempting to win a non-existent popularity contest?


Adam


Just gave you a bunch. You have totally missed the whole point of the 
original argument. Nice job. Done with you now.


--
Robert


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


Re: Tkinter: The good, the bad, and the ugly!

2011-01-01 Thread Adam Skutt
On Jan 1, 5:03 pm, rantingrick rantingr...@gmail.com wrote:

 I actually like Tkinter's simplistic API. I especially love Tkinter
 geometry management! However i realize that TclTk is lacking and
 because of that fact we will always be at the mercy of another
 community. This bothers me, and it should also bother you.

It's true of any widget library out there.  It's inescapable.  Python
bindings to the native widgets are still at the mercy of MS and Apple
(and GTK+ or Qt, whomever you pick for UNIX ).  We've seen how much
Apple cares about 3rd-party developers, and while MS at least cares,
you never know when or how they'll implement something.  Look at the
mess with the ribbon, for example.  There's the Office version, an MFC/
Win32/COM version, and a WPF version.  Not only do all three have
slightly different APIs, they all behave slightly differently too
w.r.t the end-user.

Even a pure python GUI library cannot get rid of this problem
entirely.  Witness that Xlib is (slowly) being deprecated for XCB[1].
It's possible, though unlikely, that MS will eventually stop providing
new functionality through Win32 and/or make radical changes.  It's
also possible, though unlikely, that Apple will eventually pull
another stunt on the level of deprecating Carbon and rip apart
Quartz.  Any of those changes would require drastic implementation
changes on the part of the python GUI library.

It's inescapable, so it's generally best not to worry about it.

 However be aware that GUI's libraries are large beasts. You cannot
 cram everything into the stdlib.

Who says?  Java does.  Android does.  Microsoft does.  Apple does.

 So what should go into the stdlib then?
 Well only a very limited subset of widgets. Some might say that
 you will be limited with a limited subset, well i must agree with
 argument :). Some might also say that a glass half full is also half
 empty, duh!

No, not 'duh'.  You have to explain what the utility of doing such a
thing is, as the utility is not apparent in the least.  You also need
to explain how this is actually accomplished.  I don't see it as a
trivial task, especially if the implementation path is to wrap
something else.  What we have now is about as minimal as things are
going to get.


 Everyone needs to realize that the only reason for having ANY GUI in
 the Python stdlib is for ease of learning and also for batteries
 included. We just want the basics of a GUI with an extension library
 available for download. There are two major advantages to this
 setup...

 1. The basics never change. So the Python stdlib GUI module becomes
 a set it and forget it module. The Python GUI extension library
 can change all it wants and Python remain backwards compatible.


No, I don't see how this follows in the least, especially if the
implementation path is, wrap something else.  But even in the pure
Python case, most (nearly all) GUI applications will rely on the
extension library, so it will not be able to change all it wants.

 2. By relegating the bloat to an external download the stdlib is kept
 as small as possible.

It's not apparent why this is desirable to me.  Even if we take it as
a tautology, you need to show the value and means for splitting up a
GUI library.  Your cutting may result in their being more value by not
including a GUI at all.  Trivial proof: if everyone ends up needing to
download the extension library anyway, you incur no cost for anyone
and make the standard library smaller by not including any GUI
functionality.

So go on, show us a minimized, functional widget set and what we can
do with it.  We're all pretty eagerly awaiting such a thing.

 There is no real Tk::Grid. Sure as someone suggested you can mimic a
 grid with another widget, it's just lipstick on a pig really. Go and
 check out the wx::Grid with all its wonderful capabilities and then
 you shall be enlightened!


TkTable seems to do everything wx::Grid[sic] can do.  I didn't check
fully, as it's your claim, so your responsibility to show the
inadequacies, especially since you don't even seem to be aware of
TkTable's existence.  The biggest missing feature seems to be DnD
support, AFAICT.  BFD to me, since I've never actually encounterd DnD
support worth a damn ever and have always ended up doing it manually.

 Wx is by far the best choice for Python. A small subset of wx widgets
 in the stdlib and ONE (and only one!) downloadable extension library.
 Yes the stdlib widgets are only going to cover the most minimal of
 GUIs -- for learning purposes, utilities, or just simply toys) If you
 plan to do professional GUI work than package the extension library.
 It's very simple really.


Why split it, if you use wx[sic]?  All that saves you is a few .py/.c
files in the stdlib.  You still need the full wxWidgets install to
build even the minimal set, which is pointless and stupid.  The
costly part with wxWidgets is depending on the native library, not the
amount of code in the stdlib.

Again, do you think the 

Re: Nagios

2011-01-01 Thread Robert

On 2011-01-01 10:34:46 -0500, Adam Skutt said:


On Saturday, January 1, 2011 10:00:06 AM UTC-5, Robert H wrote:


Right, just because you say it paints me in a negative light. Look at
every language out there and look within the groups. Everyone is trying
to revinvent the wheel to (in their view) make it better.


Everyone is doing nothing of the sort, hence why Tcl irks you.  Or 
are you so forgetful that you can't even remember what you said a few 
days ago?



Your argument is sad to me.


At least I've made an argument, whereas you've done nothing of the 
sort.  Just because you take wheel reinvention == good as a tautology 
doesn't mean everyone else does.  Again, what point is there in 
attempting to win a non-existent popularity contest?


Adam


I want to apologize for my part. We just aren't going to see the same 
side of this.


--
Robert


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


Re: Tkinter: The good, the bad, and the ugly!

2011-01-01 Thread CM
Rantingrick,

Find a closet in your home, go inside, turn off the lights, and shout
into a thermos; that will likely have a similar result as these posts
on the state of GUI libraries in Python.  There is something admirable
about the FOSS philosophy of You want it?  You make it.

And I don't see this as a problem anyway.  I wanted to do GUI
programming in Python, so I read a bit, chose wxPython, downloaded it,
and started learning it.  Done.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Nagios

2011-01-01 Thread Adam Skutt
On Jan 1, 6:21 pm, Robert sigz...@gmail.com wrote:

 Really? How many templating systems does Python have? More than one?
 Why is that? How many web frameworks does Perl have? More than one? Why
 is that?

 Why *was* Nagios forked and re-written in Python?

 There are too many examples to count.


You're missing the point: you've yet to provide any sort of argument
whatsoever.  It's not automatically true that rewriting Nagios in Tcl
would gain the Tcl community more exposure, nor is it automatically
true that more exposure is a good or desirable thing.

You first have to show how rewriting Nagios in Tcl would gain them
more exposure.  Then you have to show that the exposure would be a
good thing.  Until you've done both, you're arguing with very
fundamental and conventional engineering wisdom; and you have not
actually presented an argument just tautologies.

Neither will be easy to prove, by and by large, most people don't give
a shit what language their applications are written in and rightly so.

 Just gave you a bunch.

No, you've given me examples of wheel reinvention.  Just because the
people reinventing the wheel thought it was a good thing doesn't
actually make it so.  You personally have to present the case as to
why it is a good thing.

 I want to apologize for my part. We just aren't going to see the same
 side of this.

You can apologize, but I don't accept it.  You want to actually
apologize?  Admit you were wrong and retract, or act like an adult and
present an actual argument instead of wasting time.

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


wiki language

2011-01-01 Thread gert
I can't get the space betweeen \  to work, what am I doing wrong?

http://pypi.python.org/pypi/appwsgi

| Install python3_ and launch the server_
|
| All the examples are sending ajax packages, no html is being
generated by the server. Pleas take a look at the source code and
consider this technique in your future projects.
|
| client request
|
| \{cmd:order,
| \ sid:bac0c1f9a9362f9e,
| \ input:...}
|
| server response
|
| \{cmd:order,
| \ sid:bac0c1f9a9362f9e,
| \ uid:gert,
| \ gid:admin,
| \ output:...}

.. _python3: http://python.org/download/
.. _server: http://appwsgi.googlecode.com/files/server.py
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tkinter: The good, the bad, and the ugly!

2011-01-01 Thread rantingrick
On Jan 1, 5:39 pm, CM cmpyt...@gmail.com wrote:

 And I don't see this as a problem anyway.  I wanted to do GUI
 programming in Python, so I read a bit, chose wxPython, downloaded it,
 and started learning it.  Done.

I, I, I...Me,Me,Me.

Seems you are only concerned about yourself CM. However this a
community discussion. You must put your wants and needs in the
backseat before you can see what is best for the Python community as a
whole.
-- 
http://mail.python.org/mailman/listinfo/python-list



re: nagios

2011-01-01 Thread Littlefield, Tyler

Adam,
Frankly, I am getting really tired of listening to you. I've seen 
numerous good posts on this list, some post more good quality 
information and arguments than others, and so far I have yet to see any 
post of yours where you do not resort to insults and totally avoid the 
argument. I understand people have different views, but all you are 
doing is insulting anyone who dares not to agree with you, while making 
yourself look childish and pathetic in the attempt. So: Eeither 1) Shut 
up and quit wasting bandwidth, or 2) Grow up and recognize that your 
being rude is not going to get you anywhere.


If you have different views, that's great, but your resorting to insults 
for lack of anything better is getting really old.


While I do recognize that this isn't much better than what you are 
posting, I hope that you will read it or that something will be done 
about your responses, as they are contributing nothing at all useful to 
any discussions.

On 1/1/2011 4:55 PM, Adam Skutt wrote:

On Jan 1, 6:21 pm, Robertsigz...@gmail.com  wrote:

Really? How many templating systems does Python have? More than one?
Why is that? How many web frameworks does Perl have? More than one? Why
is that?

Why *was* Nagios forked and re-written in Python?

There are too many examples to count.


You're missing the point: you've yet to provide any sort of argument
whatsoever.  It's not automatically true that rewriting Nagios in Tcl
would gain the Tcl community more exposure, nor is it automatically
true that more exposure is a good or desirable thing.

You first have to show how rewriting Nagios in Tcl would gain them
more exposure.  Then you have to show that the exposure would be a
good thing.  Until you've done both, you're arguing with very
fundamental and conventional engineering wisdom; and you have not
actually presented an argument just tautologies.

Neither will be easy to prove, by and by large, most people don't give
a shit what language their applications are written in and rightly so.


Just gave you a bunch.

No, you've given me examples of wheel reinvention.  Just because the
people reinventing the wheel thought it was a good thing doesn't
actually make it so.  You personally have to present the case as to
why it is a good thing.


I want to apologize for my part. We just aren't going to see the same
side of this.

You can apologize, but I don't accept it.  You want to actually
apologize?  Admit you were wrong and retract, or act like an adult and
present an actual argument instead of wasting time.

Adam



--

Thanks,
Ty

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


Pydev 1.6.4 Released

2011-01-01 Thread Fabio Zadrozny
Hi All,

Pydev 1.6.4 has been released

Details on Pydev: http://pydev.org
Details on its development: http://pydev.blogspot.com

Release Highlights:
---

 * Improved Unittest integration:
  o Created a PyUnit view (with a red/green bar) which can be used
to see the results of tests and relaunching them
  o The default test runner now allows parallel execution
(distributing tests by module or individually)
  o The nose and py.test test runners are also supported now

 * Major Bug Fixed: existing interpreters could be corrupted when
adding a new one
 * Fixed AttributeError on console startup in Python 3.0
 * Added theming and automatic sash orientation to the pydev code coverage view
 * Patch by frigo7: When creating a new remote debugger target, the
terminated ones are removed
 * Patch by frigo7: compare editor properly showing the revision
information and fixed broken shortcuts (e.g.: ctrl+z)
 * Read-only files no longer editable in pydev actions
 * Fixed issue of remaining \r on python 3.0 on input()
 * The pydev parser is now properly dealing with bom (utf-8)
 * Assign to local: if method starts with '_', the leading '_' is not
added to the local


What is PyDev?
---

PyDev is a plugin that enables users to use Eclipse for Python, Jython
and IronPython development -- making Eclipse a first class Python IDE
-- It comes with many goodies such as code completion, syntax
highlighting, syntax analysis, refactor, debug and many others.


Cheers,

-- 
Fabio Zadrozny
--
Software Developer

Aptana
http://aptana.com/

Pydev - Python Development Environment for Eclipse
http://pydev.org
http://pydev.blogspot.com
-- 
http://mail.python.org/mailman/listinfo/python-list


@property; @classmethod; def f()

2011-01-01 Thread K. Richard Pixley

Can anyone explain to me why this doesn't work?

class Foo(object):
@property
@classmethod
def f(cls):
return 4

I mean, I think it seems to be syntactically clear what I'm trying to 
accomplish.  What am I missing?


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


Multiple instances and wrong parental links

2011-01-01 Thread Josh English
I have hit yet another wall. I am dynamically creating a class and then 
creating instances of that class. The class relies on a second class to store a 
list of objects. (This is simplified from the the original by a factor of about 
20. The real program is trying to create a Python object around an XML 
definition object.)

Here's the code:

## OPTION ONE for class: ElementList
### Not really a list, but a wrapper that behaves like a list
class ElementList(object):
def __init__(self, parent, name):
self._parent = parent
self._name = name

def MakeWrapper(checker, _addNameAsAttribute = False ):

## OPTION TWO for class: ElementList
class Wrap(object):

## OPTION THREE for class: Elementlist

def __init__(self, name):
self._name = name
setattr(Wrap, 'stuff', ElementList(self, 'test'))

Wrap.__name__= checker.title()

return Wrap

if __name__ == '__main__':

Dude = MakeWrapper('Dude')
print Dude
d1 = Dude('Josh')
print d1, d1.stuff

# creating the second instance changes the behavior of the subclass
d2 = Dude('Ben')
print d2, d2.stuff
print d1.stuff._parent
print d2.stuff._parent

#creating a third instance changes the behavior of all the subclasses
d3 = Dude('David')
print d3, d3.stuff
print d1.stuff._parent, d2.stuff._parent, d3.stuff._parent

## END CODE

And here is the output:

 
class '__main__.Dude'
__main__.Dude object at 0x00DFB930 __main__.ElementList object at 0x00DFB950
__main__.Dude object at 0x00DFB730 __main__.ElementList object at 0x00DFB770
__main__.Dude object at 0x00DFB730
__main__.Dude object at 0x00DFB730
__main__.Dude object at 0x00DFB870 __main__.ElementList object at 0x00DFB9B0
__main__.Dude object at 0x00DFB870 __main__.Dude object at 0x00DFB870 
__main__.Dude object at 0x00DFB870

The 'stuff' attribute is an ElementList object linked back to the parent 
instance, but every time I create an instance, every instance's 'stuff' links 
back to the last instance created.

I'm not sure why this is happening, or how to prevent it.

Any suggestions?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: @property; @classmethod; def f()

2011-01-01 Thread Ian Kelly

On 1/1/2011 6:55 PM, K. Richard Pixley wrote:

Can anyone explain to me why this doesn't work?

class Foo(object):
@property
@classmethod
def f(cls):
return 4

I mean, I think it seems to be syntactically clear what I'm trying to
accomplish. What am I missing?


First, because classmethod returns a classmethod instance, not a 
function, so what gets passed to property is the classmethod descriptor, 
not an actual callable.


Second, because a property descriptor just returns itself when accessed 
on the class.  It only works on instances.


To do what you want, I think you would need to write your own descriptor 
class.  Something like this:


class classproperty(object):

def __init__(self, getter):
self._getter = getter

def __get__(self, instance, owner):
return self._getter(owner)

class Foo(object):
@classproperty
def f(cls):
return 4

Modify as needed if you want to accomodate setters and deleters as well.

Cheers,
Ian

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


pyWin32 attempted installation; Error message: Skipping exchdapi: No library 'Ex2KSdk'

2011-01-01 Thread marceepoo

I just downloaded pyWin32 (https://sourceforge.net/projects/pywin32/) and 
started to install it.

I get these error msgs:

Skipping exchange: No library 'Ex2KSdk'  
Skipping exchdapi: No library 'Ex2KSdk'  
Skipping directsound: The header 'dsound.h' can not be located  

Does anyone have any suggestions about how to address this?

Thanks,Marceepoo
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Multiple instances and wrong parental links

2011-01-01 Thread ChasBrown
On Jan 1, 5:59 pm, Josh English joshua.r.engl...@gmail.com wrote:
 I have hit yet another wall. I am dynamically creating a class and then 
 creating instances of that class. The class relies on a second class to store 
 a list of objects. (This is simplified from the the original by a factor of 
 about 20. The real program is trying to create a Python object around an XML 
 definition object.)

 Here's the code:

 ## OPTION ONE for class: ElementList
 ### Not really a list, but a wrapper that behaves like a list
 class ElementList(object):
 def __init__(self, parent, name):
 self._parent = parent
 self._name = name

 def MakeWrapper(checker, _addNameAsAttribute = False ):

 ## OPTION TWO for class: ElementList
 class Wrap(object):

 ## OPTION THREE for class: Elementlist

 def __init__(self, name):
 self._name = name
 setattr(Wrap, 'stuff', ElementList(self, 'test'))

 Wrap.__name__= checker.title()

 return Wrap

 if __name__ == '__main__':

 Dude = MakeWrapper('Dude')
 print Dude
 d1 = Dude('Josh')
 print d1, d1.stuff

 # creating the second instance changes the behavior of the subclass
 d2 = Dude('Ben')
 print d2, d2.stuff
 print d1.stuff._parent
 print d2.stuff._parent

 #creating a third instance changes the behavior of all the subclasses
 d3 = Dude('David')
 print d3, d3.stuff
 print d1.stuff._parent, d2.stuff._parent, d3.stuff._parent

 ## END CODE

 And here is the output:



 class '__main__.Dude'
 __main__.Dude object at 0x00DFB930 __main__.ElementList object at 
 0x00DFB950
 __main__.Dude object at 0x00DFB730 __main__.ElementList object at 
 0x00DFB770
 __main__.Dude object at 0x00DFB730
 __main__.Dude object at 0x00DFB730
 __main__.Dude object at 0x00DFB870 __main__.ElementList object at 
 0x00DFB9B0
 __main__.Dude object at 0x00DFB870 __main__.Dude object at 0x00DFB870 
 __main__.Dude object at 0x00DFB870

 The 'stuff' attribute is an ElementList object linked back to the parent 
 instance, but every time I create an instance, every instance's 'stuff' links 
 back to the last instance created.


If every instance's whatever is the same, one guesses that the
whatever has a class scope, rather than an instance scope.

 I'm not sure why this is happening, or how to prevent it.


It's perfectly predictable; to understand what is happening, compare:

 def foo():
class Bar(object):
def __init__(self):
setattr(Bar, 'stuff', {})
return Bar

 Dude = foo()
 a = Dude()
 b = Dude()
 a.stuff['foo'] = 2
 b.stuff
{'foo': 2}
 c = Dude()
 a.stuff
{}

with the behavior (which I think you expected) of:

 def foo():
class Bar(object):
def __init__(self):
setattr(self, 'stuff', {})
return Bar

 Dude = foo()
 a = Dude()
 b = Dude()
 a.stuff['foo'] = 2
 b.stuff
{}
 c = Dude()
 a.stuff
{'foo': 2}

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


Re: @property; @classmethod; def f()

2011-01-01 Thread Steven D'Aprano
On Sat, 01 Jan 2011 17:55:10 -0800, K. Richard Pixley wrote:

 Can anyone explain to me why this doesn't work?
 
 class Foo(object):
  @property
  @classmethod
  def f(cls):
  return 4

What does doesn't work mean? It works for me:


 class Foo(object):
...  @property
...  @classmethod
...  def f(cls):
...  return 4
... 
 

There is no syntax error, the class is created, it works fine. What were 
you expecting to happen?


If you instantiate the class and try accessing the property, you get the 
expected runtime error:

 x = Foo()
 x.f
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: 'classmethod' object is not callable

(Admittedly, *you* might not have expected it, but nevertheless...)

property() expects a callable object, not a classmethod object, so 
naturally it fails. Admittedly, it's a little unexpected that 
classmethods aren't callable, but they're not:

 classmethod(lambda x: 42)()
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: 'classmethod' object is not callable


Don't confuse the classmethod object with a class method (note the 
space!). Class methods are what you get once the descriptor mechanism 
kicks into action behind the scenes. classmethod objects are the 
descriptors that create class methods (note space) when required:

 cm = classmethod(lambda x: 42).__get__(Spam)  # descriptor protocol
 cm
bound method type.lambda of class 'type'
 cm()
42


 I mean, I think it seems to be syntactically clear what I'm trying to
 accomplish.  What am I missing?

An understanding of the dark and murky waters of descriptor black magic :)

http://docs.python.org/howto/descriptor.html

(It's not really that dark and murky. It's actually amazingly simple.)

My recommendation is, forget the classmethod. A combination of property 
with class attributes and self.__class__ will get you what you want.

Otherwise, just create your own descriptor object. The How To above shows 
pure-python versions of classmethod and staticmethod.


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


Re: Multiple instances and wrong parental links

2011-01-01 Thread John Nagle

On 1/1/2011 9:57 PM, ChasBrown wrote:

setattr(Wrap, 'stuff', ElementList(self, 'test'))


Right.  As the previous poster wrote, that line is the
basic problem.

It's not entirely clear what you're trying to do, but it
seems to be overly complex.  You could have Wrap inherit
from ElementList, if you want each Wrap class to be a
subclsss of ElementList.  Or simply have a line in the __init__
of Wrap like

   self.something = ElementList(self, whatever)

John Nagle

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


CPython on the Web

2011-01-01 Thread azakai
Hello, I hope this will be interesting to people here: CPython running
on the web,

http://syntensity.com/static/python.html

That isn't a new implementation of Python, but rather CPython 2.7.1,
compiled from C to JavaScript using Emscripten and LLVM. For more
details on the conversion process, see http://emscripten.org

This is a work in progress, main issues right now are that the code
isn't optimized (so don't expect good performance), and importing non-
static modules doesn't work. Otherwise, though, it seems to run
properly, in particular it runs all the examples in
http://wiki.python.org/moin/SimplePrograms that don't rely on
importing modules or receiving input from the user (with perhaps some
minor formatting errors). The demo runs fine on recent versions of
Firefox, Chrome and Safari, but has problems on IE9 and Opera
(hopefully those will be resolved soon).

The idea is that by compiling CPython itself, all the features of the
language are immediately present, and at the latest version, unlike
writing a new implementation which takes time and tends to lag behind.
As to why run it on the web, there could be various uses, for example
it could allow a simple learning environment for Python, which since
it's on the web can be entered immediately without any download (and
would run even in places where Python normally can't, like say an
iPad).

Feedback would be very welcome!

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


Re: Multiple instances and wrong parental links

2011-01-01 Thread Steven D'Aprano
On Sat, 01 Jan 2011 17:59:33 -0800, Josh English wrote:

 I have hit yet another wall. I am dynamically creating a class and then
 creating instances of that class. The class relies on a second class to
 store a list of objects. (This is simplified from the the original by a
 factor of about 20.

Sounds like it's about 40 times too complex then: aim for something about 
half the complexity of this simplified version.


 The real program is trying to create a Python object
 around an XML definition object.)
 
 Here's the code:
 
 ## OPTION ONE for class: ElementList
 ### Not really a list, but a wrapper that behaves like a list class
 ElementList(object):
 def __init__(self, parent, name):
 self._parent = parent
 self._name = name


Doesn't behave much like a list for me :)


 def MakeWrapper(checker, _addNameAsAttribute = False ):
 ## OPTION TWO for class: ElementList
 class Wrap(object):
 ## OPTION THREE for class: Elementlist
 def __init__(self, name):
 self._name = name
 setattr(Wrap, 'stuff', ElementList(self, 'test'))
 Wrap.__name__= checker.title()
 return Wrap


Your problem is that all the instances from a MakeWrapper class share the 
same stuff attribute, which is attached to the class Wrap. What you 
probably want is:

setattr(self, 'stuff', ElementList(self, 'test'))

instead. What you *need* is to rethink this complicated strategy for a 
simpler one.


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


[issue1674555] sys.path in tests contains system directories

2011-01-01 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

I find the solution (running every test in a subprocess) a bit too drastic for 
the problem. How about a modified approach: run regrtest with -S, and have it 
create a subprocess for test_site only?

--

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



[issue10801] zipfile.ZipFile().extractall() header mismatch for non-ASCII characters

2011-01-01 Thread Georg Brandl

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

Committed patch and test in r87604.

--
nosy: +georg.brandl
resolution:  - accepted
status: open - closed

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



[issue10801] zipfile.ZipFile().extractall() header mismatch for non-ASCII characters

2011-01-01 Thread Georg Brandl

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

OK, looks like there is a problem on some buildbots: 

http://www.python.org/dev/buildbot/all/builders/AMD64%20Gentoo%20Wide%203.x/builds/863/steps/test/logs/stdio

--
status: closed - open

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



[issue444582] Finding programs in PATH, adding shutil.which

2011-01-01 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

Hi Jan, are you still going to work on this feature?

Hi Éric, what are we going to do: include Jan's patch when ready or Trent's 
`which` tool on google code?

Cheers,
Sandro

--
nosy: +sandro.tosi

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



[issue8626] TypeError: rsplit() takes no keyword arguments

2011-01-01 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

That's interesting: do we have a place where we explain how to read the doc? I 
mean, a place were we can provide example/explain how we write docs, so f.e.:

  str.rsplit([sep[, maxsplit]])  

is a description for a method that could accept 2 optional arguments, none of 
them keyargs or

  str.encode(encoding=utf-8, errors=strict)

is a description for a method that could take 2 optional args, and they are 
also keyargs (yeah, I know it's kinda bad-worded, but just to give the idea).

If you think it's overkill, let's just close this bug (after all, we have all 
the doc written our way ;)).

Cheers,
Sandro

--
nosy: +sandro.tosi

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



[issue10801] zipfile.ZipFile().extractall() header mismatch for non-ASCII characters

2011-01-01 Thread Georg Brandl

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

OK, I think r87606 fixed it: it doesn't extract the files, instead calls only 
open().

--
status: open - closed

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



[issue10801] zipfile.ZipFile().extractall() header mismatch for non-ASCII characters

2011-01-01 Thread Eli Bendersky

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

Georg, did you figure out the root cause of the problem on that buildbot? 
Seeing it fails in open(targetpath, wb), extracting the file may have failed 
if the bot had no write permissions to the current directory, but the ascii 
encoding error is not what I'd expect in such a case.

--

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



[issue10801] zipfile.ZipFile().extractall() header mismatch for non-ASCII characters

2011-01-01 Thread Georg Brandl

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

Well, it looks like the filesystem encoding is set to ASCII on these machines.

--

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



[issue10130] Create epub format docs and offer them on the download page

2011-01-01 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

Hi, I've updated the patch, to also mention the 'epub' target in Dco/README.txt 
but mainly to fix an HTML error in indexcontent.html that prevents the epub to 
be correctly generated.

--
Added file: http://bugs.python.org/file20212/issue10130-v2-py3k.patch

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



[issue10787] [random.gammavariate] Add the expression of the distribution in a comprehensive form for random.gammavariate

2011-01-01 Thread David Kremer

David Kremer david.kremer...@gmail.com added the comment:

Yes I agree. Actually the parameters in the python code alpha, beta are 
corresponding respectively to k, theta in the first equation of 
[http://en.wikipedia.org/wiki/Gamma_distribution].

--

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



[issue8626] TypeError: rsplit() takes no keyword arguments

2011-01-01 Thread Éric Araujo

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

The description for the function directive is at 
http://docs.python.org/dev/documenting/markup.html  However, I’m not sure 
whether the doc is accurate, since there was a switch from spam([style]) to 
spam(style=None) some time ago, for example in r73291.

Let’s continue the discussion on the other bug.

--
nosy: +eric.araujo
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - Document lack of support for keyword arguments in C functions

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



[issue10789] Lock.acquire documentation is misleading

2011-01-01 Thread Éric Araujo

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

I think this commit should be reverted:  Arguments with default values no 
longer use brackets, see for example r73291.  More info on #8350.

--
nosy: +eric.araujo, georg.brandl

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



[issue10789] Lock.acquire documentation is misleading

2011-01-01 Thread Georg Brandl

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

No, that's not true.  Arguments that can't be given as kwargs are presented 
with brackets.

However, the default value now isn't indicated anywhere; it should be added to 
the main text.

--

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



[issue10044] small int optimization

2011-01-01 Thread Meador Inge

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

 How is the compiler supposed to know whether a and b belong to the same
 array when compiling ptr_compare?

I agree with Mark, it doesn't need to know.  However, many compilers [1,2] 
support whole program optimization and could in theory figure the address out 
using that technique.

[1] GCC -flto - 
http://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/Optimize-Options.html#Optimize-Options
[2] VC++ LTCG - http://msdn.microsoft.com/en-us/library/xbf3tbeh.aspx

--
nosy: +meador.inge

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-01 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

Hi Alexander, can you confirm this bug is MacOs specific? I tried with 
python2.6 on a Debian sid @64 bit but I can't replicate it. Also, do you see it 
only on 2.6? if so, I doubt that it will ever be fixed; f.e. on release2.7 
branch I have:

Python 2.7.1+ (release27-maint, Dec 31 2010, 20:16:57) 
[GCC 4.4.5] on linux2
Type help, copyright, credits or license for more information.
 import time
 time.asctime(time.gmtime(1e12))
'Fri Sep 27 01:46:40 33658\n'

--
nosy: +sandro.tosi

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



[issue10789] Lock.acquire documentation is misleading

2011-01-01 Thread Terry J. Reedy

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

OK, I will add defaults in the texts and condense them a bit at the same time. 
Will post patches for review.

Arguments that can't be given as kwargs are presented with brackets.
I think this should be stated in the introduction to the Lib manual, along with 
any other conventions a reader should know. If you agree, one of us can open an 
issue for this.

--
resolution: fixed - 
stage: committed/rejected - needs patch
status: closed - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10789
___
___
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

2011-01-01 Thread Raymond Hettinger

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

The improved output format in 3.2 still needs to be backported to 2.7.

--
priority: normal - low
versions:  -Python 3.2

___
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



[issue8278] os.utime doesn't allow a atime (Last Access) which is 27 years in the future.

2011-01-01 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

Hi Amaury, Martin ack'ed the patch: is there something else you want to do?

--
nosy: +sandro.tosi

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



[issue4662] posix module lacks several DeprecationWarning's

2011-01-01 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

The patch no longer applies cleanly to 2.7 head (but it should be trivial to 
update it).

Martin, Benjamin: as this targets 2.7, do you think the patch is acceptable in 
that branch or it's too late?

--
nosy: +sandro.tosi

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



[issue4662] posix module lacks several DeprecationWarning's

2011-01-01 Thread Sandro Tosi

Changes by Sandro Tosi sandro.t...@gmail.com:


--
versions:  -Python 2.7

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



[issue4662] posix module lacks several DeprecationWarning's

2011-01-01 Thread Sandro Tosi

Changes by Sandro Tosi sandro.t...@gmail.com:


--
versions: +Python 2.7 -Python 2.6

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-01 Thread Ned Deily

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

It's still a problem on OS X at least and is 64-bit related:

$ arch -i386 /usr/local/bin/python3.2 -c 'import 
time;print(time.asctime(time.gmtime(1e12)))'
Traceback (most recent call last):
  File string, line 1, in module
ValueError: timestamp out of range for platform time_t
$ arch -x86_64 /usr/local/bin/python3.2 -c 'import 
time;print(time.asctime(time.gmtime(1e12)))'
Segmentation fault

--
nosy: +ned.deily

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-01 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-01 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

Hi Ned, thanks for the fast check! I tried to applied the patch (it failed, so 
it required a bit of manual editing) but when compiling I got:


/home/morph/python-dev/py3k/Modules/timemodule.c: In function ‘time_asctime’:
/home/morph/python-dev/py3k/Modules/timemodule.c:626: warning: implicit 
declaration of function ‘PyString_FromStringAndSize’
/home/morph/python-dev/py3k/Modules/timemodule.c:626: warning: return makes 
pointer from integer without a cast
*** WARNING: renaming time since importing it failed: 
build/lib.linux-x86_64-3.2/time.cpython-32m.so: undefined symbol: 
PyString_FromStringAndSize

and my knowledge of C ends there :)

Alexander, would you like to revamp your patch? ;)

--

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



[issue7716] IPv6 detection, don't assume existence of /usr/xpg4/bin/grep

2011-01-01 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

Hi, I think the best way to test this patch is to apply the fix and then 
compile python on a Solaris system (which I don't have): is someone owning a 
Solaris would run this test?

--
nosy: +sandro.tosi

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



[issue4662] posix module lacks several DeprecationWarning's

2011-01-01 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

I think the policy is that it is ok to add more 3k warnings to 2.7; these are 
not considered new features (or explicitly exempted, or some such).

--

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



[issue4662] posix module lacks several DeprecationWarning's

2011-01-01 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

Some of these warnings are incorrect, too; os.popen() and fdopen() remain in 
Python 3.

--

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



[issue8350] Document lack of support for keyword arguments in C functions

2011-01-01 Thread Georg Brandl

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

Hmm, it may indeed be the best option to add a new directive option to say 
this function does not take keyword args.  It would result in some form of 
unobtrusive but noticeable output in HTML.

It is a bit of an effort to add it everywhere it's necessary, but the most 
important instances (e.g. string methods) can be covered quickly, and it's 
fairly easy to grep the other instances (namely, grepping for METH_O and 
METH_VARARGS without METH_KEYWORDS).

--

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



[issue8350] Document lack of support for keyword arguments in C functions

2011-01-01 Thread Antoine Pitrou

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

 Hmm, it may indeed be the best option to add a new directive option to
 say this function does not take keyword args.  It would result in
 some form of unobtrusive but noticeable output in HTML.

Isn't it kind of a CPython-specific detail, though?

--

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



[issue8350] Document lack of support for keyword arguments in C functions

2011-01-01 Thread Georg Brandl

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

Yes.  It's still an important detail; the explanation could say, In CPython, 
this function does not take keyword args and furthermore it's not really clear 
to me how much of the library reference applies to all Python implementations 
anyway.

--

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



[issue10802] python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows

2011-01-01 Thread kai zhu

New submission from kai zhu kaizhu...@gmail.com:

i have 2 debian i386 unstable distros.
1) python3.2 (latest hg) running under vps @ linode.com seems ok
2) python3.2 (latest hg) running under colinux (in windows xp) breaks

*NOTE
3) python3.2 (release b2) works fine under colinux

pub...@colinux: python3.2
Python 3.2b2+ (py3k, Jan  1 2011, 17:42:23)
[GCC 4.4.5] on linux2
Type help, copyright, credits or license for more information.
 import subprocess
 subprocess.Popen('ls')
Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/public/i486-pc-linux-gnu/lib/python3.2/subprocess.py, line 708, 
in __init__
restore_signals, start_new_session)
  File /home/public/i486-pc-linux-gnu/lib/python3.2/subprocess.py, line 1136, 
in _execute_child
errpipe_read, errpipe_write = _create_pipe()
OSError: [Errno 38] Function not implemented


--
components: IO, Interpreter Core
messages: 125020
nosy: kaizhu
priority: normal
severity: normal
status: open
title: python3.2 AFTER b2 release has subprocess.Popen broken under 
colinux/windows
type: behavior
versions: Python 3.2

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



[issue8350] Document lack of support for keyword arguments in C functions

2011-01-01 Thread Raymond Hettinger

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

This is an implementation detail specific to CPython and subject to change.  
I'm -1 on documenting it for every function/method and thereby making it part 
of the language spec. We've lived without this spec for almost twenty years, so 
I'm inclined to think it is truly unimportant.

It is sufficient to mention just once in the docs that CPython 
functions/methods sometimes don't take keywords.

--
nosy: +rhettinger

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



[issue10802] python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows

2011-01-01 Thread Antoine Pitrou

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


--
assignee:  - gregory.p.smith
nosy: +gregory.p.smith

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



[issue10802] python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows

2011-01-01 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
nosy: +georg.brandl
priority: normal - release blocker

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



[issue10789] Lock.acquire documentation is misleading

2011-01-01 Thread Éric Araujo

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

Thanks for the correction Georg.

In msg104113 (on #8350), I quoted 
http://docs.python.org/dev/reference/expressions#calls :

“An implementation may provide built-in functions whose positional parameters 
do not have names, even if they are ‘named’ for the purpose of documentation, 
and which therefore cannot be supplied by keyword.”

Previous consensus seemed to be that this warning was enough, but recent bugs 
such as this one show that it does trip up users, so there is further 
discussion about how best to document this CPython limitation (hence the 
dependency I’m adding).

--
dependencies: +Document lack of support for keyword arguments in C functions

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



[issue10789] Lock.acquire documentation is misleading

2011-01-01 Thread Raymond Hettinger

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

I concur that the one warning is enough.  Implementations have been given wide 
latitude in this regard.  Even within CPython there is not much uniformity -- 
some funcs/methods don't accept keywords, some will disregard keywords, and 
others may have keywords that are different from the name in the docs.  

I believe it would be a mistake to make to lock in the present state of 
accidental implementation details by documenting them in the main docs.

--
nosy: +rhettinger

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



[issue8350] Document lack of support for keyword arguments in C functions

2011-01-01 Thread Terry J. Reedy

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

I think that the warning that things are not always as they seem should be 
repeated in the front of the library manual where the pseudo-arg names are 
actual used, so the library manual stands on its own. In any case, I believe a 
lot of people use the lib ref without reading and remembering every detail of 
the language ref.

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

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-01 Thread Andreas Stührk

Andreas Stührk andy-pyt...@hammerhartes.de added the comment:

Updated patch against py3k branch.

--
nosy: +Trundle
Added file: http://bugs.python.org/file20213/issue8013_py3k.diff

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



[issue8350] Document lack of support for keyword arguments in C functions

2011-01-01 Thread Terry J. Reedy

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

If there is no indication in the lib manual as to which parameter names and 
defaults are real and which are fake, then the safe guideline is to never use 
keywards for library functions and methods and always pass everything 
positionally.

Slightly more complicated is to be aware of which classes and modules are 
Python versus C coded. (If needed, change for module.py in /Lib.) For some 
modules, one can take a cue from doc examples that use keywords.

Otherwise, each person has to experiment for himself and  check each TypeError 
messages to determine whether it arises from a misspelling or a hidden 
limitation. And maybe go through the same process a year later after forgetting.

We've lived without this spec for almost twenty years,
Yes, and people have been stumbling on this and complaining for probably just 
as long. Since []s are no longer used in the doc to indicate 'optional', they 
can and are being used to indicate 'position-only'. Specify in the 
introduction, where notation should be explained, that the limitation is only 
for current CPython and may be changed in the future or be different for other 
implementations. However

In my opinion, the real solution is to remove the limitation. Since the 
language spec says args can be passed by keyword as well as by position, make 
it be that way for everything we distribute.

--

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



[issue10789] Lock.acquire documentation is misleading

2011-01-01 Thread Terry J. Reedy

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

I responded to the general questions on #8350.

--

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



[issue10802] python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows

2011-01-01 Thread Gregory P. Smith

Gregory P. Smith g...@krypto.org added the comment:

The only thing that could cause this error is if the Modules/_posixsubprocess.c 
subprocess_cloexec_pipe function fails either in the pipe2() call or if 
HAVE_PIPE2 is not defined one of the fcntl() calls.

Can you look to see if HAVE_PIPE2 is defined?

I suspect it is but the colinux/windows environment should apperently not 
define it.  configure.in magic will be needed to make sure it does not get 
defined there.

Is your bugreport accurate?  This function was included in 3.2b2 so the failure 
should be the same in both versions.  As far as I can see nothing else has 
changed that should impact that.  Did you rerun configure properly on your 
colinux install?

--

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-01 Thread Ned Deily

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

Thanks for the py3k patch.  I am also attaching a refreshed patch for current 
2.7.  They both fix the segfaults when built and run on OS X 10.6 64-bit.  
Since the patches change timemodule to use asctime_r, which AFAICT is not used 
elsewhere in the standard library, one concern might be if this change 
introduces a regression on any other platforms, something for the buildbots to 
test.

--
stage:  - patch review
Added file: http://bugs.python.org/file20214/issue8013_27.diff

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



[issue5870] subprocess.DEVNULL

2011-01-01 Thread Ross Lagerwall

Ross Lagerwall rosslagerw...@gmail.com added the comment:

Here is a fairly simple patch that adds the subprocess.DEVNULL constant.

--
keywords: +patch
nosy: +rosslagerwall
versions: +Python 3.3 -Python 2.7
Added file: http://bugs.python.org/file20215/5870_v1.patch

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



[issue10782] Not possible to cross-compile due to poor detection of %lld support in printf

2011-01-01 Thread Ben Gamari

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

Well, I'm not convinced that overriding config.cache is the best solution, but 
I am not really sure what else can be done. So far I've just been carrying a 
patch which changes configure.in, but this is clearly an awful hack.

--

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



[issue10803] ctypes: better support of bytearray objects

2011-01-01 Thread Markus F.X.J. Oberhumer

New submission from Markus F.X.J. Oberhumer mar...@oberhumer.com:

Python 3.2b2 does not properly support accessing bytearrays from
ctypes, which makes dealing with large buffers somewhat unpleasant.

A very first fix - a simple patch for the z_set() function - is given here.


build/Python-3.2b2 $ quilt diff
Index: b/Modules/_ctypes/cfield.c
===
--- a/Modules/_ctypes/cfield.c
+++ b/Modules/_ctypes/cfield.c
@@ -1363,6 +1363,10 @@
 *(char **)ptr = PyBytes_AsString(value);
 Py_INCREF(value);
 return value;
+} else if (PyByteArray_Check(value)) {
+*(char **)ptr = PyByteArray_AsString(value);
+Py_INCREF(value);
+return value;
 } else if (PyLong_Check(value)) {
 #if SIZEOF_VOID_P == SIZEOF_LONG_LONG
 *(char **)ptr = (char *)PyLong_AsUnsignedLongLongMask(value);

--
assignee: theller
components: ctypes
messages: 125032
nosy: mfxmfx, theller
priority: normal
severity: normal
status: open
title: ctypes: better support of bytearray objects
type: feature request
versions: Python 3.2

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



[issue10716] Modernize pydoc to use CSS

2011-01-01 Thread Ron Adam

Ron Adam ron_a...@users.sourceforge.net added the comment:

Here is a new diff which updates all the new pydoc pages to use the css file. 

The css file is simpler and cleaner.  I also made a few adjustments to the url 
handler error handling, and changed the titles in the head sections so they say 
Pydoc instead of Python as they are PyDoc pages about Python.

None of these changes effect any of the old pydoc code yet.  This is about as 
far as we can go without removing the old tk panel and server.

Time for some feed back.  And how close do we really need it to be to the 
original?

:-)

--
Added file: http://bugs.python.org/file20216/css_v2.diff

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



[issue10716] Modernize pydoc to use CSS

2011-01-01 Thread Ron Adam

Changes by Ron Adam ron_a...@users.sourceforge.net:


Removed file: http://bugs.python.org/file20081/defaultstyle.css

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



[issue10716] Modernize pydoc to use CSS

2011-01-01 Thread Ron Adam

Changes by Ron Adam ron_a...@users.sourceforge.net:


Removed file: http://bugs.python.org/file20088/pydoc sample html files.zip

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



[issue10716] Modernize pydoc to use CSS

2011-01-01 Thread Ron Adam

Changes by Ron Adam ron_a...@users.sourceforge.net:


Removed file: http://bugs.python.org/file20183/css_v1.diff

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