Re: Python 2.4.3 Documentation: Bad link

2006-04-02 Thread Tim Parkin
[EMAIL PROTECTED] wrote:
 Now, it works well... I really don't know why it before report 404 Not
 Found... I was tested it 5x... I'm sorry for unwanted false bug report.

Hi Bones, It really was a bug!! I'd seen it reported on the bug tracker
and made a quick fix which is why I hadn't closed the issue in the bug
tracker (it was you that reported it?).

Thanks

Tim

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


Re: DO NOT USE JAVA BECAUSE IT IS NOT OPEN SOURCE

2006-04-02 Thread Alex Hunsley
[EMAIL PROTECTED] wrote:
 Programing Languiges Are Ment to be free. That is why i am starting The
 iCoo De Tar/i 
  thats french for Blow of state

No, Coup d'état is French.
http://en.wikipedia.org/wiki/Coup


 it is a flash/java
 alternative and if you are going to use a server side languige use
 Perl,Python or better yet Ruby. What is the point of a languige without
 a standerd and without a open source distrabution. Coo De Tar will be
 released as a api for perl,python and ruby. Java sucks because it IS
 NOT FREE. I AM A GNU GUY I BELEVE THAT SOFTWARE MUST AND SHALL BE
 FREE!! do not use java because it is an oxymoron

Your AOL is showing. Badly.
-- 
http://mail.python.org/mailman/listinfo/python-list


Is pwm Python MegaWidgets viable?

2006-04-02 Thread Paul Watson
Does pwm run well on Python 2.4?  The last release appears to be in 
2003.  The Manning discussion forum is dead.

Is there a better path to learning and producing tkInter apps?

Has there been any discussion of wxPython becoming part of the base 
Python distro?  A requirement here is to not require download/install of 
anything other than the Python release.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ipv6 validation

2006-04-02 Thread Christos Georgiou
On 30 Mar 2006 11:40:08 -0800, rumours say that [EMAIL PROTECTED]
might have written:

thanks a lot for this solution.
Next thing: how may i find out that that address is multicast one? is
there some easy possibility or i have to use regex now?

To quote a Google reply:

IPv6 multicast addresses are distinguished from unicast addresses by the
value of the high-order octet of the addresses: a value of 0xFF (binary
) identifies an address as a multicast address; any other value
identifies an address as a unicast address.
-- 
TZOTZIOY, I speak England very best.
Dear Paul,
please stop spamming us.
The Corinthians
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Exception handling....dumb question?

2006-04-02 Thread Flexx
Ben Finney writes:
  You should catch *specific* exceptions that you know you can deal with at 
  that point in the code.
 
  import logging
  try:
  foo = 12 / 0
  except ZeroDivisionError, e:
  print You *knew* this was going to happen: '%s' % e
  logging.error(str(e))
 
  This allows all other exceptions to propogate back through the call
  stack.

import sys, logging
try:
 foo = 12/0
except:
 e = str(sys.exc_value)
 print You *knew* this was going to happen: '%s' % (e)
 logging.error(e)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: String pattern matching

2006-04-02 Thread Jim Lewis
Thanks for the interesting and detailed analysis. In my case I don't
need all possible answers by rather the first greedy match. Seems
like there might be some recursive approach.

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


Re: Exception handling....dumb question?

2006-04-02 Thread Felipe Almeida Lessa
Em Dom, 2006-04-02 às 15:54 +0300, Flexx escreveu:
 Ben Finney writes:
   This allows all other exceptions to propogate back through the call
   stack.
 
 import sys, logging
 try:
  foo = 12/0
 except:
  e = str(sys.exc_value)
  print You *knew* this was going to happen: '%s' % (e)
  logging.error(e)

The point (I think) Ben was trying to show is that you should not hide
exceptions from the caller's code unless you expected that exception.
For example:

def percentage(now, total):
Returns the percentage of now in total.
return now * 100.0 / total

Very simple. What if I do percentage(1, 0)? The code expected me to be
clever enough to know that you can't make a percentage when the total is
zero, so it lets the exception pass by to my code (like: it's your
problem, not mine!):

 percentage(1, 0)
Traceback (most recent call last):
  File stdin, line 1, in ?
  File stdin, line 3, in percentage
ZeroDivisionError: float division

But if your function is being used on a context where total can be zero
and it has a meaning, for example, returning -1, then _in_this_case_ you
should catch the exception:

def percentage(now, total):
Returns the percentage of now in total.

If total is zero, then return -1.

try:
return now * 100.0 / total
except ZeroDivisionError:
return -1

 percentage(1, 0)
-1

But this function won't catch exceptions if you don't give it numbers:

 percentage(None, 1)
Traceback (most recent call last):
  File stdin, line 1, in ?
  File stdin, line 7, in percentage
TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'

But this is also a problem on the caller's code! You should *not* hide
it from him! But if None is valid in the context of your code, then...
well, you get the point! =)

HTH,

-- 
Felipe.

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

Re: RELEASED Python 2.4.3, release candidate 1

2006-04-02 Thread Steve Holden
Paddy wrote:
 I just Googled and found the Python-Dev thread 'About Coverity Study
 Ranks LAMP Code Quality '. I was heartened by the type of issues
 raised in the discussion - it leaves me content with whats
 'under-the-hood' in Python.
 
 You maintainers don't seem to bang your own drum, which is a good
 thing, but since I'm not a maintainer, I'd just like to roll out the
 drums (http://www.yakudo.com/) and shout
 
 THANKS GUYS - IT'S APPRECIATED!
 
 (boy am I gonna get it for this post :-)
 
i presume you must have been trying to imply that your significant other 
would cause problems if they discovered you had been spending time on 
comp.lang.python.

You can see by the enormous number of posts following your up and 
complaining about your shouted thanks that nobody else is as grateful to 
the developers as you are.

[For those who read this out of context: not one single complaint was 
raised about Paddy's shouted thanks in the week following his post. This 
message should be read with irony sensors fully activated].

The thing about developers is, you tell them how wonderful they are, and 
how much you appreciate what they do, pay them large salaries and give 
them pleasant offices, then the next thing you know you have Java to 
program in and they are telling you that you have to change your style 
and do things their way.

Much better to keep them in a dark cellar and throw them the occasional 
crust of stale bread. That way they are pathetically grateful to meet 
someone who'll even consider using their code.

Keeps the power semantics right - see

   http://www.wussu.com/humour/semantic.htm

regards
  Steve
-- 
Steve Holden   +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd www.holdenweb.com
Love me, love my blog holdenweb.blogspot.com

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


Re: Is pwm Python MegaWidgets viable?

2006-04-02 Thread gregarican
Paul Watson wrote:

 Does pwm run well on Python 2.4?  The last release appears to be in
 2003.  The Manning discussion forum is dead.

 Is there a better path to learning and producing tkInter apps?


 Has there been any discussion of wxPython becoming part of the base
 Python distro?  A requirement here is to not require download/install of
 anything other than the Python release.

I can't vouch for Python 2.4, but I used the PMW library pretty
extensively for an app that is based on Python 2.3. Tkinker itself
offers most of the basic widgets that any Tk implementation does, and
there's an online guide (can't recall the URL right now) to Tkinter
that is great for an introduction tutorial. PMW is an add-on to Tkinter
that is useful if there are specific widgets that you need that basic
Tkinter doesn't provide and you don't feel like creating them from
scratch. Just because it doesn't have a new release in the past couple
of years doesn't mean that it's truly a dead project. Perhaps it's
stabilized and there haven't been overwhelming requests for adding any
new items to it. Using PMW won't help you learn Tkinter any quicker in
any event. Just icing on the cake :-)

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


Re: why doesn't is work?a script to backup a directory

2006-04-02 Thread Fredrik Lundh
I wrote:

  WindowsError: [Errno 3] : 'O:/eb/mb/S/*.*'

 shutil.rmtree() expects a directory name, not a file pattern.  if you leave
 out the *.* part at the end, it should do what you want.

postscript: typically enough, I stumbled upon the same error message myself,
a day later.  looks like it's Windows that adds the *.* thing to the path, all
by itself.

however, on my machine, I get a bit more information:

WindowsError: [Errno 3]  The system cannot find the path specified:
'directory/*.*'

/F



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


DOM and HTML

2006-04-02 Thread robert . differentone
Hi All,

  I am looking for any Python library which can help to get DOM
tree from HTML.  Is there any way to access HTML DOM, just like
accessing it using javascript.

Any kind of help is appreciated.

Thanks.
R

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


Re: DO NOT USE JAVA BECAUSE IT IS NOT OPEN SOURCE

2006-04-02 Thread Paddy
LoL :-)

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


Re: DOM and HTML

2006-04-02 Thread Sullivan WxPyQtKinter
I do not know much about the HTML DOMBut I think if you just mean
treating HTML like XML and build it into a DOM tree and (Very
important) the HTML file is not a 1 lines or even longer one, then
go ahead to xml.dom.minidom module for help. It has a basic (and great)
implementation for light-weighted DOM implementation.

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


Re: a simple regex question

2006-04-02 Thread Paddy

John Salerno wrote:
 But would findall return this match: aMNHiRFLoDLFb  ??

 There are actually two matches there, but they overlap. So how would
 your write an RE that catches them both?

I remembered the 'non-consuming' match (?+...) and a miniute of
experimentation gave
the following.

 import re
 s =aMNHiRFLoDLFb
 re.findall(r'[A-Z]{3}([a-z])(?=[A-Z]{3})', s)
['i', 'o']
 

- Paddy.

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


Re: DOM and HTML

2006-04-02 Thread Fredrik Lundh
Sullivan WxPyQtKinter wrote:

 go ahead to xml.dom.minidom module for help. It has a basic (and great)
 implementation for light-weighted DOM implementation.

that's a rather unusual way to use words like great and light-weight...

/F



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


Re: DOM and HTML

2006-04-02 Thread Ant
I've used Beautiful Soup, and it is a very pythonic way of accessing
the data in the HTML. It is actually very similar to the way you access
the DOM with JS - for example soup.html.body.h1 will give you the first
h1 tag.

There are also various other ways of searching the HTML in XPathish
ways (if XPath used dictionaries and lists...).

http://www.crummy.com/software/BeautifulSoup/

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


Sortin Tablelist 4.3

2006-04-02 Thread Arne Meissner
Hello!

I am using under Python the tablelist 4.3 from http://www.nemethi.de/.

Now I want to do bind the following:

When you click on the column header, the selected column should sort.
How is the bind method or how can I call the column header in the tablelist?

Thany you for your help!
Arne 


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


Re: print() in Python 3000 return value?

2006-04-02 Thread Martin v. Löwis
James Thiele wrote:
 I noticed in PEP 3000 that print will become a function. The PEP
 references a thread where Guido explains this decision. The thread does
 not specify what the function will return. Has this been decided?

My intuition is that it should be a procedure (i.e. returning None).

What do you want it to return?

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


print() in Python 3000 return value?

2006-04-02 Thread James Thiele
I noticed in PEP 3000 that print will become a function. The PEP
references a thread where Guido explains this decision. The thread does
not specify what the function will return. Has this been decided?

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


Re: python tutorial: popular/informative Python sites ?

2006-04-02 Thread Daniel Bickett
I read c.l.py and (the Unofficial) Planet Python (and that's it), so
perhaps that's an appropriate suggestion:

http://www.planetpython.org/

(From the Starship: If you want to join the crew, we only require your
PSA membership)

-- 
Daniel Bickett
dbickett at gmail dot com
http://heureusement.org/

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


Re: print() in Python 3000 return value?

2006-04-02 Thread James Thiele
Martin chimedin:
 James Thiele wrote:
  I noticed in PEP 3000 that print will become a function. The PEP
  references a thread where Guido explains this decision. The thread does
  not specify what the function will return. Has this been decided?

 My intuition is that it should be a procedure (i.e. returning None).
 What do you want it to return?

 Regards,
 Martin

The string that was printed. It could be useful inside expessions:

message = I don't need to see all of this:%s % print(s)

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


Re: Credit card API Sol with python interface

2006-04-02 Thread Larry Bates
Sakcee wrote:
 Hi
 
 does anybody know of any credit card merchant slution with python API.
 we used to use cybercash long time ago, but are willing to switch to
 something good and not pricy.
 we want to accept credit cards and process them.
 
 something with python wrapper will be great , as I would not have to
 build urllib wrappers around its functions.
 
 
 thanks
 
We use TrustCommerce.  They have Python interface that works great.

http://www.trustcommerce.com

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


Re: print() in Python 3000 return value?

2006-04-02 Thread Gary Herron
Felipe Almeida Lessa wrote:

Em Dom, 2006-04-02 às 10:41 -0700, James Thiele escreveu:
  

Martin chimedin:


James Thiele wrote:
  

I noticed in PEP 3000 that print will become a function. The PEP
references a thread where Guido explains this decision. The thread does
not specify what the function will return. Has this been decided?


My intuition is that it should be a procedure (i.e. returning None).
What do you want it to return?

Regards,
Martin
  

The string that was printed. It could be useful inside expessions:

message = I don't need to see all of this:%s % print(s)



Or maybe:

for i in sequence:
   mylist.append(print(i))

  

No no, please NO!   You *know* that someday you'll want the return value 
without actually printing the text. 

So let's don't overload a single function with two operations.  Let 
print print, and propose a separate function (named format --yuck-- 
or some such) that returns the same text as a string.

Gary Herron

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

Re: Assignment in a while?

2006-04-02 Thread Fredrik Lundh
none @bag.python.org wrote:

 So it seems that I stumbled on the idiomatic way of doing this then.
 Well, as they say, When in Rome... :).  Thanks for pointing out the
 FAQ.  I'll be reading up on it.

the idiomatic way to loop in Python is to use iterators/generators.  if
you have a callable that fetches data from some resource and returns
a sentinel when you get to the end, you can use the iter function to
turn it into an iterator:

 help(iter)
Help on built-in function iter in module __builtin__:

iter(...)
iter(collection) - iterator
iter(callable, sentinel) - iterator

Get an iterator from an object.  In the first form, the argument must
supply its own iterator, or be a sequence.
In the second form, the callable is called until it returns the sentinel.

given this, your loop can be written:

for result in iter(std.fetchone, None):
print result

/F



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


Re: print() in Python 3000 return value?

2006-04-02 Thread bayerj
Expressions like

 2 + 2

return None, too. I am not certain, but as far as I know this has some
major design reasons. Thus I am certain, that print() will return None
also.

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


Re: Assignment in a while?

2006-04-02 Thread Paul Boddie
none/Ben wrote:

 Assignment within a while loop seems like a pretty standard thing, so I'm just
 curious what I'm missing.

The FAQ on this subject? ;-)

http://www.python.org/doc/faq/general/#why-can-t-i-use-an-assignment-in-an-expression

It's standard in C-flavoured languages, certainly, but probably not
ubiquitous.

Paul

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


Re: Assignment in a while?

2006-04-02 Thread none
So it seems that I stumbled on the idiomatic way of doing this then. 
Well, as they say, When in Rome... :).  Thanks for pointing out the 
FAQ.  I'll be reading up on it.

Cheers,
Ben

Paul Boddie wrote:
 none/Ben wrote:
 
Assignment within a while loop seems like a pretty standard thing, so I'm just
curious what I'm missing.
 
 
 The FAQ on this subject? ;-)
 
 http://www.python.org/doc/faq/general/#why-can-t-i-use-an-assignment-in-an-expression
 
 It's standard in C-flavoured languages, certainly, but probably not
 ubiquitous.
 
 Paul
 

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


Re: Assignment in a while?

2006-04-02 Thread Duncan Booth
none wrote:

 If I try to run the above code, I get a SyntaxError indicating that I 
 can't do an assignment in the while loop.  I found a way around this 
 (see the commented out while loop), but it seems hackish.  Assignment 
 within a while loop seems like a pretty standard thing, so I'm just 
 curious what I'm missing.
 

Not much, you cannot assign to a variable in the controlling expression 
of a while loop. However, for loops do assign values to variables, so if 
the form with the break offends you, try restructuring your code as a for 
loop. For example:

for results in iter(sth.fetchone, None):
   print results

or in many cases you can just fetch everything in one go:

for results in sth.fetchall():
   print results
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Assignment in a while?

2006-04-02 Thread bill pursell
none wrote:

 import pgdb;

 dbh = pgdb.connect(database = 'test')
 sth = dbh.cursor()
 sth.execute(SELECT * FROM capitals)
 #while 1:
  #results = sth.fetchone()
  #if results == None:
  #break
  #print results
 while results = sth.fetchone():
  print results

 If I try to run the above code, I get a SyntaxError indicating that I
 can't do an assignment in the while loop.  I found a way around this
 (see the commented out while loop), but it seems hackish.  Assignment
 within a while loop seems like a pretty standard thing, so I'm just
 curious what I'm missing.

A more pythonic way to do that is something like:

for results in sth.fetchall():
print results

(I'm not familiar with pgdb, but if it's a reasonable module it will
have some function that returns an iterator.)

In the beginning of my python experience, I was a bit irritated at
being unable to assign and check a condition in one statement, but the
irritation really doesn't last very long.  Python has a huge amount of
inherent beauty, and is well worth the time.

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


Re: Assignment in a while?

2006-04-02 Thread Ant
There are various ways you could do this:

If the number of results won't be too big:

...
for result in sth.fetchall():
print result

If it may be very large:
...

result = sth.fetchone()
while result:
print result
result = sth.fetchone()

Or perhaps nicer:

...
def result_iterator(result_set):
yield result_set.fetchone()

for result in result_iterator(sth):
print result

HTH.

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


update or refresh a Listbox widget

2006-04-02 Thread Arne Meissner
Hello!

Is there a function to update/refresh a listbox widget.
My one is connected to a database and after a change of the database I would 
like the listbox to be updated.

Thank you for your help!
Arne 


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


Re: print() in Python 3000 return value?

2006-04-02 Thread Atanas Banov
James Thiele wrote:
 I noticed in PEP 3000 that print will become a function. The PEP
 references a thread where Guido explains this decision. The thread does
 not specify what the function will return. Has this been decided?

reading the discussion, the arguments are about print as of now being
a syntactic construc, an operator without apparent reason. all that is
proposed is to tuck it as a function/procedure, i.e. use parenthesis
and be able to redefine with a simple def print(...)

if you think about it, the pythonic way is for print to return None. we
use it for the side effect (stdout output)

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


Re: very very basic question

2006-04-02 Thread Georg Brandl
aghazalp wrote:
 thanx george for the prompt answer... when you say add a call that
 means what exactly?...here is the program I was supposed to
 write...could you tell me what to add where in this program?
 
 def main():
 print this program is crazy
 x=input ('enter a number betwenen 0 and 1: ')
 for i range (10)
 x=3.9*x*(1-x)
 print x
 
 main()

At the very end of the program, that is here, after main(), just insert

raw_input()

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


very very basic question

2006-04-02 Thread aghazalp
hi guys,
this would be the most basic question ever...I am not a programmer but
I am trying to learn programming in python...I was reading John Zelle's
text book and instructed me to make .py file and save it on the desk
top...then it said close the python GUI and double click on the icon of
the I just made and that should run the program...well, the good news
is that it does but when I input a number for calculation and press the
enter key the program closes...Does any one know what the problem is?

thanx a bunch
andy

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


Re: print() in Python 3000 return value?

2006-04-02 Thread Georg Brandl
bayerj wrote:
 Expressions like
 
 2 + 2
 
 return None, too.

Sorry? 2+2 here returns 4, and certainly should with your Python.

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


Re: very very basic question

2006-04-02 Thread aghazalp
thanx george for the prompt answer... when you say add a call that
means what exactly?...here is the program I was supposed to
write...could you tell me what to add where in this program?

def main():
print this program is crazy
x=input ('enter a number betwenen 0 and 1: ')
for i range (10)
x=3.9*x*(1-x)
print x

main()


thanx again

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


Re: very very basic question

2006-04-02 Thread Georg Brandl
aghazalp wrote:
 hi guys,
 this would be the most basic question ever...I am not a programmer but
 I am trying to learn programming in python...I was reading John Zelle's
 text book and instructed me to make .py file and save it on the desk
 top...then it said close the python GUI and double click on the icon of
 the I just made and that should run the program...well, the good news
 is that it does but when I input a number for calculation and press the
 enter key the program closes...Does any one know what the problem is?

The DOS box closes as soon as the program terminates. To prevent that, add
a call to raw_input() at the end of your script. Python will then prompt you
for input, and therefore the window will stay open.

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


Re: Doc suggestions (was: Why class exceptions are not deprecated?)

2006-04-02 Thread rurpy
Fredrik Lundh wrote:
 no, but that's because you're the kind of pathetic loser who only sees
 problem with things, and only pops up when you have a chance to piss
 on something.

Are you going to address the issue, or just limit
yourself to a public temper tantrum?

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


Assignment in a while?

2006-04-02 Thread none
Hi all,

First, let me preface this by the fact that I'm completely new to the 
language, but not to programming in general.

I'm trying to get my feet wet with something near and dear to my heart: 
database programming.  Here's what I've got:

import pgdb;

dbh = pgdb.connect(database = 'test')
sth = dbh.cursor()
sth.execute(SELECT * FROM capitals)
#while 1:
 #results = sth.fetchone()
 #if results == None:
 #break
 #print results
while results = sth.fetchone():
 print results

If I try to run the above code, I get a SyntaxError indicating that I 
can't do an assignment in the while loop.  I found a way around this 
(see the commented out while loop), but it seems hackish.  Assignment 
within a while loop seems like a pretty standard thing, so I'm just 
curious what I'm missing.

Thanks in advance,
Ben
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: very very basic question

2006-04-02 Thread aghazalp
thanx ...it works great now...you re awesome...the only thing is that
the program only executes once though...I guess I ll have to read up
more anout it but for now that helped me a lot...I appreciated the help

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


Re: very very basic question

2006-04-02 Thread Larry Bates
aghazalp wrote:
 thanx ...it works great now...you re awesome...the only thing is that
 the program only executes once though...I guess I ll have to read up
 more anout it but for now that helped me a lot...I appreciated the help
 

It only executes once because you only call it once.

Your program:

def main():
print this program is crazy
x=input ('enter a number betwenen 0 and 1: ')
for i range (10)
x=3.9*x*(1-x)
print x

main()

Change to something like:

def main():
print this program is crazy
while 1:
x=input ('enter a number between 0 and 1 [-1 to exit]: ')
if x == -1: break
for i range (10)
x=3.9*x*(1-x)
print x

main()


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


Re: update or refresh a Listbox widget

2006-04-02 Thread Fredrik Lundh
Arne Meissner wrote:

 Is there a function to update/refresh a listbox widget.
 My one is connected to a database and after a change of the database I would
 like the listbox to be updated.

Tkinter?

the quickest way is to do:

w.delete(0, END)
w.insert(0, *data)

where w is the widget and data is a list (or other sequence) containing
the new data.

/F



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


Re: Doc suggestions

2006-04-02 Thread rurpy

Terry Reedy wrote:
 [EMAIL PROTECTED] wrote in message
  Terry Reedy wrote:

 Yes, there have been claims that doc patches have to be in Latex or are
 otherwise not welcome.  But these mostly (all?) have lacked relevant
 concrete data, which would be actual responses to actual submissions to the
 Python SourceForge change trackers.

Yes, I have seen here many times, and read in the doc
footnotes, that any form of doc patches are acceptable.
I never thought or claimed otherwise.

...
 Some time ago, Alex Martelli submitted several style change suggestions for
 at least one of the docs.  As I remember, at least most of them were
 accepted.  In any case, all were considered.  And there have since been
 other changes that I have been involved with that were arguably style
 upgrades rather than corrections.

Given Alex Martelli's level of competence that is
neither surprising or representative.

 A few organizational changes might be considered, especially if accompanied
 by an offer to make at least a prototype, but someone with fundamentally
 different ideas should write their own doc under their own name.

That puts a pretty high bar in place for the Language
Reference which has no hope if becoming good without
major organizational changes.

...
 Suggestion: You could submit the one improved sentence you previously
 suggested.  But the overhead of any change is a bit high for just that.  So
 gather at least a few suggestions, put them in order, include section
 number and identifier for each, and cut-and-paste urls from current docs at
 python.org.

What I am questioning is why those barriers are so
high.  Why does fixing a even a clear, obvious, fault
in the documentation require someone to log in to
sourceforge, create a bug or patch entry, have someone
else review it, comment it, change a half dozen words
in the source, close it...  Why can't the folks doing
the docs be more proactive?

 Offer: If you submit your 'text patch' to SourceForge and let me know, I
 will review it right away. [...]

I appreciate the offer, but special treatment for
someone who raises a public stink is not going to
fix the underlying problem, is it?

Here is a 3' view.  I posted about a clear
(admittedly very minor) doc problem 8 days ago.
Since then there have been 30+ postings in this
thread.  Insults and bad feelings have flown.
Two people setup wikis and uploaded the tutorial.
I don't know how many people have visited or made
changes.  After all that I look at the current
2.5 docs, and what do I see?  The same, trivial,
problem is still there.

Am I the only one who sees something wrong with
this picture?

That change was simple and uncontroversial enough
so that someone should have simply done it.  Why
is a formal change procedure needed for this level
of change?  My guess is the people taking care of
the docs are Python developers whose main interest
is Python but who also generously volunteer to
handle docs issues.  And probably most don't even
read c.l.p.  Is that close?

Around christmas time there was a long discussion
here and on the python doc mailing list about how
to fix things.  I was gone at the time but I read
a lot of it when I returned.  One thing stuck out
like a sore thumb.  There were hundreds of messages
about redit vs latex, html vs xml, toolchains, wikis,
patch managers, software packages.  There were
almost no messages about *WRITING* and *EDITING*.
Part of the problem is undeniably the need for a
good infrastructure.  But...

The other half, which has been nearly unaddressed
as far as I can tell, is PEOPLE!   The docs problem
is a people problem, and won't be solved by technology.
(Unless someone here is very good with AI :-)

Here is how I would arrange things if I could...
===

A psf project or sig or some other discrete unit
chartered to work on the docs.

Active, encouraging, solicitation of people with
good (natural) language skills to participate.

Detailed written style guidelines and document
scopes so that everyone is, if not on, at least
near the same page.

Division of volunteers into (roughly)
  Czar or small committee,
  Editors,
  Writers,
  Everyone else.

Top level czar or small committee sets overall doc
policy and standards, resolves differences of opinion.

Editors responsible for ensuring the docs have
consistent style and appropriate content/level.
(By rewriting and editing more than by rejecting
submissions.)

Writers who create new material and correct/improve
existing material.

Everyone else who will be encouraged to report doc
errors, unclarities, suggest improvements, etc.

Specific areas of interest assigned publicly to
specific writers/editors (voluntarily of course),
both to provide them with public recognition and
as a minor incentive for them to get something done.

A definition of what constitutes an minor change
and the ability of volunteers to make such changes
unilaterally.

Facilitation of a fast-path communication channel

Sending a file to a remote server.

2006-04-02 Thread Jose Carlos Balderas Alberico
Hi. I posted a message in the list a couple of days ago about sending a file to a remote SimpleXMLRPCServer. Well. my doubt still remains, so I come to you again in search of a clearer answer.The thing is I want to send a ZIP file to a server, and what I basically do is enclose the file data into a Binary object by doing something like data = ""
f.read()). Then I call a function in the server, passing the object as a parameter, and have the server process the same file by doing something likef = open(somefile.zip, 'w')f.write(binaryObject.data
)Since I've never programmed server/client before, I've never faced the fact of sending a file to a remote machine.I just want to know if what I've done to send the file is acceptable, and if you know of a better way to send files to a SimpleXMLRPCServer.
Thank you very much for your attention.
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Doc suggestions (was: Why class exceptions are not deprecated?)

2006-04-02 Thread Paul Rubin
Fredrik Lundh [EMAIL PROTECTED] writes:
 what issue?  your inability to contribute anything but complaints?  that's
 your problem, and you have to fix that yourself.  I'm sure you'd feel better
 if you tried.

I'm not sure what's wrong with complaints.  I've submitted a lot of
bug reports and they weren't always handled the way I might have
liked, but nobody got after me for failing to submit fixes along with
them.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python tutorial: popular/informative Python sites ?

2006-04-02 Thread John Salerno
Fredrik Lundh wrote:
 the what now? page in the tutorial
 
 http://www.python.org/doc/tut/node14.html
 
 lists a couple of relevant web sites for Python users, including:
 
 http://www.python.org
 http://starship.python.net
 http://www.python.org/pypi
 
 the starship link has been there since 1998 or so (Python 1.5), but
 I don't think the starship is very active these days.  but if we were
 to replace it with something else, what should that be?  what sites
 do pythoneers and pythonistas visit these days?
 
 post your suggestions in this thread or on this page:
 
 http://pytut.infogami.com/node14.html
 
 thanks /F
 
 
 

I just listened to Ron Stephens' podcast about Python websites, so maybe 
  one or two of these links might be good:

http://www.awaretek.com/weblog/arch_d7_2005_09_03.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Doc suggestions (was: Why class exceptions are not deprecated?)

2006-04-02 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote:

  no, but that's because you're the kind of pathetic loser who only sees
  problem with things, and only pops up when you have a chance to piss
  on something.

 Are you going to address the issue, or just limit
 yourself to a public temper tantrum?

what issue?  your inability to contribute anything but complaints?  that's
your problem, and you have to fix that yourself.  I'm sure you'd feel better
if you tried.

/F



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


Re: Is pwm Python MegaWidgets viable?

2006-04-02 Thread Paul Watson
gregarican wrote:
 Paul Watson wrote:
 
 
Does pwm run well on Python 2.4?  The last release appears to be in
2003.  The Manning discussion forum is dead.

Is there a better path to learning and producing tkInter apps?


Has there been any discussion of wxPython becoming part of the base
Python distro?  A requirement here is to not require download/install of
anything other than the Python release.
 
 
 I can't vouch for Python 2.4, but I used the PMW library pretty
 extensively for an app that is based on Python 2.3. Tkinker itself
 offers most of the basic widgets that any Tk implementation does, and
 there's an online guide (can't recall the URL right now) to Tkinter
 that is great for an introduction tutorial. PMW is an add-on to Tkinter
 that is useful if there are specific widgets that you need that basic
 Tkinter doesn't provide and you don't feel like creating them from
 scratch. Just because it doesn't have a new release in the past couple
 of years doesn't mean that it's truly a dead project. Perhaps it's
 stabilized and there haven't been overwhelming requests for adding any
 new items to it. Using PMW won't help you learn Tkinter any quicker in
 any event. Just icing on the cake :-)

Many thanks for your reply.  I was setting out to make use of the 
Manning book by Grayson.  Perhaps I should just use online tutorial and 
such for learning plain-old tk first.  However, I have heard good things 
about the book.  Just trying to use what was already at hand.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is pwm Python MegaWidgets viable?

2006-04-02 Thread gregarican
Paul Watson wrote:

 Many thanks for your reply.  I was setting out to make use of the
 Manning book by Grayson.  Perhaps I should just use online tutorial and
 such for learning plain-old tk first.  However, I have heard good things
 about the book.  Just trying to use what was already at hand.

Here's the online tutorial that provides a basic introduction to
Tkinter -- http://www.pythonware.com/library/tkinter/introduction/. I
found it handy. I had used Tk implementations in other languages such
as Ruby so I had already become familiar with the overall Tk toolkit,
but nevertheless the online Tkinter tutorial was refreshing. Wasn't
aware of the Manning book but it sounds like a great resource as well!

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


Re: Assignment in a while?

2006-04-02 Thread Ant
Forget the last suggestion - I wasn't concentrating :-)

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


Re: urllib2 through basic auth'ed proxy

2006-04-02 Thread Alejandro Dubrovsky
John J. Lee wrote:

 [EMAIL PROTECTED] (John J. Lee) writes:
 
 Alejandro Dubrovsky [EMAIL PROTECTED] writes:
 [...Alejandro complains about non-working HTTP proxy auth in urllib2...]
 
 [...John notes urllib2 bug...]
 A workaround is to supply a stupid HTTPPasswordMgr that always returns
 the proxy credentials regardless of what the handler asks it for (only
 tested with a perhaps-broken 2.5 install, since I've broken my 2.4
 install):
 [...snip ugly code]
 Yuck, yuck, yuck!  I had realised the auth/proxies code in urllib2 was
 buggy, but...  And all those hoops to jump through.
 
 Also, if you're using 2.5 SVN HEAD, it seems revision 42133 broke
 ProxyHandler in an attempt to fix the URL host:post syntax!
 [...]
 
 In fact the following also works with Python 2.3.4:
 
 import urllib2
 proxy_handler = urllib2.ProxyHandler({http:
 http://john:[EMAIL PROTECTED]:3128}) print
 urllib2.build_opener(proxy_handler).open('http://python.org/').read()
 
It does too.  Thanks again. (I think this version is uglier, but easier to
insert into third party code)


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


Re: Can I control Video Card by using Python under linux?

2006-04-02 Thread LUK
Thank you! I will try.

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


Re: print() in Python 3000 return value?

2006-04-02 Thread Martin v. Löwis
bayerj wrote:
 Sorry? 2+2 here returns 4, and certainly should with your Python.
 
 Err. Never mind. I was thinking about assignments, like
 
 x += 2
 
 which returns None.

Actually, assignment, in Python, is a statement, not an expression.
Statements don't return anything, not even None (they don't have
a value). If print becomes a function, the question about its return
value becomes meaningful.

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


Obtaining the Python Control Flow Graph

2006-04-02 Thread brianlum
Hi,

I have been looking for a good way to convert python code into a
control flow graph.

I know of Python functions that will convert an expression into an
abstract syntax tree (i.e. ast = parser.expr('(x+5)*5') then t =
ast.totuple() then t), but I am not sure how to obtain a CFG.

I've gone through the compiler and it has code that converts the AST
into a CFG (described here:
http://www.python.org/doc/peps/pep-0339/#ast-to-cfg-to-bytecode).
Basically, PyAST_Compile() in Python/compile.c coverts the AST to a CFG
and outputs final bytecode from the CFG by calling two functions:
PySymtable_Build() in Python/symtable.c and compiler_mod() in
Python/compile.c. PySymtable_Build() will build a symtable and
compiler_mod() will create the CFG.

PyPy also offers a way to obtain a control flow graph:
http://codespeak.net/pypy/dist/pypy/doc/objspace.html#the-flow-model

I was wondering if anyone had any advice on the best way to obtain a
control flow graph.  I need the control flow graph because I am trying
figure out if there is a way to bound the integer ranges and list
lengths at compile time.

Thank you for your help

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


[ python-Bugs-1463043 ] test_minidom.py fails for Python-2.4.3 on SUSE 9.3

2006-04-02 Thread SourceForge.net
Bugs item #1463043, was opened at 2006-04-02 15:03
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1463043group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Build
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Richard Townsend (rptownsend)
Assigned to: Nobody/Anonymous (nobody)
Summary: test_minidom.py fails for Python-2.4.3 on SUSE 9.3

Initial Comment:
I built Python-2.4.3 from source on SUSE 9.3 and get
the following error for test_minidom.py

/usr/local/src/Python-2.4.3: ./python
Lib/test/test_minidom.py
Failed Test
Test Failed:  testAltNewline
Traceback (most recent call last):
  File Lib/test/test_minidom.py, line 1384, in ?
func()
  File Lib/test/test_minidom.py, line 427, in
testAltNewline
confirm(domstr == str.replace(\n, \r\n))
  File Lib/test/test_minidom.py, line 28, in confirm
raise Exception
Exception
exceptions.Exception instance at 0x4036d6cc
Failed testEncodings - encoding EURO SIGN
Test Failed:  testEncodings
Traceback (most recent call last):
  File Lib/test/test_minidom.py, line 1384, in ?
func()
  File Lib/test/test_minidom.py, line 891, in
testEncodings
testEncodings - encoding EURO SIGN)
  File Lib/test/test_minidom.py, line 28, in confirm
raise Exception
Exception
exceptions.Exception instance at 0x4037e46c
Failed After replaceChild()
Test Failed:  testPatch1094164
Traceback (most recent call last):
  File Lib/test/test_minidom.py, line 1384, in ?
func()
  File Lib/test/test_minidom.py, line 1137, in
testPatch1094164
confirm(e.parentNode is elem, After replaceChild())
  File Lib/test/test_minidom.py, line 28, in confirm
raise Exception
Exception
exceptions.Exception instance at 0x4037ec4c
Failed Test
Test Failed:  testWriteXML
Traceback (most recent call last):
  File Lib/test/test_minidom.py, line 1384, in ?
func()
  File Lib/test/test_minidom.py, line 420, in
testWriteXML
confirm(str == domstr)
  File Lib/test/test_minidom.py, line 28, in confirm
raise Exception
Exception
exceptions.Exception instance at 0x403b160c



 Check for failures in these tests:
  testAltNewline
  testEncodings
  testPatch1094164
  testWriteXML


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1463043group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1463043 ] test_minidom.py fails for Python-2.4.3 on SUSE 9.3

2006-04-02 Thread SourceForge.net
Bugs item #1463043, was opened at 2006-04-02 15:03
Message generated for change (Comment added) made by rptownsend
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1463043group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Build
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Richard Townsend (rptownsend)
Assigned to: Nobody/Anonymous (nobody)
Summary: test_minidom.py fails for Python-2.4.3 on SUSE 9.3

Initial Comment:
I built Python-2.4.3 from source on SUSE 9.3 and get
the following error for test_minidom.py

/usr/local/src/Python-2.4.3: ./python
Lib/test/test_minidom.py
Failed Test
Test Failed:  testAltNewline
Traceback (most recent call last):
  File Lib/test/test_minidom.py, line 1384, in ?
func()
  File Lib/test/test_minidom.py, line 427, in
testAltNewline
confirm(domstr == str.replace(\n, \r\n))
  File Lib/test/test_minidom.py, line 28, in confirm
raise Exception
Exception
exceptions.Exception instance at 0x4036d6cc
Failed testEncodings - encoding EURO SIGN
Test Failed:  testEncodings
Traceback (most recent call last):
  File Lib/test/test_minidom.py, line 1384, in ?
func()
  File Lib/test/test_minidom.py, line 891, in
testEncodings
testEncodings - encoding EURO SIGN)
  File Lib/test/test_minidom.py, line 28, in confirm
raise Exception
Exception
exceptions.Exception instance at 0x4037e46c
Failed After replaceChild()
Test Failed:  testPatch1094164
Traceback (most recent call last):
  File Lib/test/test_minidom.py, line 1384, in ?
func()
  File Lib/test/test_minidom.py, line 1137, in
testPatch1094164
confirm(e.parentNode is elem, After replaceChild())
  File Lib/test/test_minidom.py, line 28, in confirm
raise Exception
Exception
exceptions.Exception instance at 0x4037ec4c
Failed Test
Test Failed:  testWriteXML
Traceback (most recent call last):
  File Lib/test/test_minidom.py, line 1384, in ?
func()
  File Lib/test/test_minidom.py, line 420, in
testWriteXML
confirm(str == domstr)
  File Lib/test/test_minidom.py, line 28, in confirm
raise Exception
Exception
exceptions.Exception instance at 0x403b160c



 Check for failures in these tests:
  testAltNewline
  testEncodings
  testPatch1094164
  testWriteXML


--

Comment By: Richard Townsend (rptownsend)
Date: 2006-04-02 15:28

Message:
Logged In: YES 
user_id=200117

I've just retested with earlier versions.

No error with Python-2.4.1
Similar error with Python-2.4.2


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1463043group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1463104 ] problems with os.system and shell redirection on Windows XP

2006-04-02 Thread SourceForge.net
Bugs item #1463104, was opened at 2006-04-02 17:18
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1463104group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Manlio Perillo (manlioperillo)
Assigned to: Nobody/Anonymous (nobody)
Summary: problems with os.system and shell redirection on Windows XP

Initial Comment:
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310
32 bit (Intel)] on win32 - Windows XP SP2

N.B. sorry for italian error messages.


With the following script:

# redirection.py
import os
import sys


os.system(sys.argv[1])




When doing:
redirection.py dir  redirection.txt

I obtain:
Spazio su disco insufficiente.


Instead with:
redirection.py svn help  redirection.txt

svn: Errore di scrittura: Bad file descriptor


This is a Python problem because with an equivalent
program written in C++:

// redirection.c++
#include cstdlib


int main(int argc, char** argv) {
  std::system(argv[1]);
}

-


there are no problems.




Thanks and regards  Manlio Perillo

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1463104group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-931877 ] Segfault in object_reduce_ex

2006-04-02 Thread SourceForge.net
Bugs item #931877, was opened at 2004-04-08 13:46
Message generated for change (Settings changed) made by gvanrossum
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=931877group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Tim Peters (tim_one)
Assigned to: Tim Peters (tim_one)
Summary: Segfault in object_reduce_ex

Initial Comment:
Shane Hathaway bumped into this, unbounded recursion 
in typeobject.c's object_reduce_ex().  This occurs in 
Python 2.3.3 and current CVS.

Assigned to Guido, to ponder whether object_reduce_ex 
is doing what it should; if it is (which seems likely to 
me), I suppose we need to inject a recursion counter to 
prevent the segfault.

The failing case is short, but I'll attach it (temp99.py) to 
avoid SF line mangling.  While the test uses pickle, same 
symptom if it's changed to use cPickle instead.

Jim Fulton's analysis:


This is a very clever infinite loop.  The proxy doesn't
actually proxy, but it does manage to confuse reduce 
about what's going on.

reduce tries to figure out if it has been overridden by
asking whether the class's reduce is the same as
object.__reduce__. It doesn't expect to be lied to
about the class.  Things wouldn't have been so bad if
the proxy had proxied __reduce__ as well as __class__.


The priority hasn't been bumped, because the real 
code from which this was whittled down wasn't doing 
what it needed to do anyway, and the recursion went 
away when the real code was repaired.

--

Comment By: Žiga Seilnacht (zseil)
Date: 2006-03-31 20:43

Message:
Logged In: YES 
user_id=1326842


See patch #1462488. If that patch is accepted, this bug
should be closed as fixed.

--

Comment By: Guido van Rossum (gvanrossum)
Date: 2006-03-15 00:05

Message:
Logged In: YES 
user_id=6380

Unassigning. I need to concentrate on Python 3000.

--

Comment By: Georg Brandl (birkenfeld)
Date: 2006-01-10 16:58

Message:
Logged In: YES 
user_id=1188172

Still crashing with 2.5...

--

Comment By: Nathan Srebro (nati)
Date: 2004-11-29 20:26

Message:
Logged In: YES 
user_id=63133

This infinite recursion also occurs in another place, that
got me stumped for a couple of days when old code that
worked with Python 2.2 stopped working.  If __class__ is not
fidgeted with (as in original bug report), but a descriptor
returns a custom reduce for the class, but not for its
objects, reduce enters an infinite loop on the object:


class descriptor_for_reduce(object):
def __get__(self,obj,tp=None):
if obj is not None: return
super(ASpecialClass,obj).__reduce__
return self.reducer
def reducer(self,proto=None):
return VerySpecial

class ASpecialClass(object):
__reduce__ = descriptor_for_reduce()

copy.copy(ASpecialClass())


ASpecialClass().__reduce__ is object.__reduce__, which is
implemented by typeobject.c:object_reduce_ex.  This function
(that doesn't know if its called as the __reduce__ or the
__reduce_ex__ method) tries to detect if the object's
__reduce__ is overridden.  It does so by checking if the
object's class's __reduce__ is overridden, and in fact it
is.  It then assumes that the object's __reduce__ is
overridden, and calls it.  But the object's __reduce__ is
the same function, causing the infinite loop.

If __reduce_ex__ is used instead of __reduce__, the problem
goes away, ASpecialClass().__reduce_ex__() return the usual
tuple, and ASpecialClass.__reduce_ex__() return
VerySpecial.  But when __reduce__ is overridden,
ASpecialClass().__reduce__() enters an infinite loop.

I believe this is a legitimate example that should behave
just as when __reduce_ex__ is overridden.  The example
doesn't lie about __class__, and it is certainly legitimate
for define a property that behaves differently for the class
and for its objects.

Where did this come up and why would I ever care about a
class's __reduce__?  The __reduce__ attribute of a class is
never used by (the standard) pickle or copy, since
save_global() is called instead. However, I have a custom
pickler, implemented as a subclass of pickle.Pickler, which
falls back on the class's __reduce__ when save_global()
fails.  This way, I can pickle certain classes that are
created at run-time (and can be easily recreated, e.g. from
their bases and dictionaries).


--

Comment By: Tim Peters (tim_one)
Date: 2004-04-08 13:51

Message:
Logged In: YES 
user_id=31435

Hmm!  The temp99.py download 

[ python-Bugs-1445781 ] install fails on hard link

2006-04-02 Thread SourceForge.net
Bugs item #1445781, was opened at 2006-03-08 18:06
Message generated for change (Comment added) made by ronaldoussoren
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1445781group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Build
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: goldenautumnday (goldenautumnday)
Assigned to: Martin v. Löwis (loewis)
Summary: install fails on hard link

Initial Comment:
Installing on an attached linux drive from a Mac OS X (Tiger) system fails 
because hard links are not supported.  This is attempted when trying to 
link python2.4 to python (ln python2.4 python).  If it fails, a copy should 
be performed instead.

changing mode of /Users/martinol/auto_v4.0/devel/powerpc-apple-
darwin8.5.0/bin/idle to 755
changing mode of /Users/martinol/auto_v4.0/devel/powerpc-apple-
darwin8.5.0/bin/pydoc to 755
changing mode of /Users/martinol/auto_v4.0/devel/powerpc-apple-
darwin8.5.0/bin/smtpd.py to 755
if test -f /Users/martinol/auto_v4.0/devel/powerpc-apple-darwin8.5.0/
bin/python -o -h /Users/martinol/auto_v4.0/devel/powerpc-apple-
darwin8.5.0/bin/python; \
then rm -f /Users/martinol/auto_v4.0/devel/powerpc-apple-
darwin8.5.0/bin/python; \
else true; \
fi
(cd /Users/martinol/auto_v4.0/devel/powerpc-apple-darwin8.5.0/bin; ln 
python2.4 python)
ln: python: Operation not supported

/Users/martinol/auto_v4.0 is symbolic link to /Volumes/thing/martinol 
which has been attached to using openapple-K (via SMB).

--

Comment By: Ronald Oussoren (ronaldoussoren)
Date: 2006-04-02 21:24

Message:
Logged In: YES 
user_id=580910

Adding a -s flag to the link command should also fix this issue and has the 
advantage that all builds will be done the same way. The cost for resolving the 
symlink should be neglectible.

--

Comment By: goldenautumnday (goldenautumnday)
Date: 2006-03-08 21:22

Message:
Logged In: YES 
user_id=1471082

Changing line 599 in Makefile.pre.in to:

(cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON) || cp python
$(VERSION)$(EXE) $(PYTHON))

allowed make to complete.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1445781group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1437614 ] can't send files via ftp on my MacOS X 10.3.9

2006-04-02 Thread SourceForge.net
Bugs item #1437614, was opened at 2006-02-23 19:48
Message generated for change (Comment added) made by ronaldoussoren
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1437614group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Li Quid (liquid333)
Assigned to: Nobody/Anonymous (nobody)
Summary: can't send files via ftp on my MacOS X 10.3.9

Initial Comment:

When trying to do a simple ftp upload using Python
2.3's ftplib, it fails and I get a socket error.  The
exact error is (61, 'Connection refused').  This
happens to me in all my scripts that use the ftplib on
MacOS 10.3.9, but not in scripts on my Windows box. 
I've attached the small, simple source code.

--

Comment By: Ronald Oussoren (ronaldoussoren)
Date: 2006-04-02 21:28

Message:
Logged In: YES 
user_id=580910

I use ftplib on OSX and don't see problems (both python 2.3 and 2.4 on OSX 
10.3 and 10.4). I agree with tjreedy that this is most likely a problem with 
the 
environment of the user.

--

Comment By: Terry J. Reedy (tjreedy)
Date: 2006-03-06 03:26

Message:
Logged In: YES 
user_id=593130

This could be a problem in your specific machine and its 
setup, the specific OS version, the specific target (maybe 
nyx doesn't like MACs), or the specific Python version.

I would start by installing 2.4.2 and see if there have 
maybe been helpful changes to its socket code.  And try to 
find another Mac box.  And then ask on python-
list/comp.lang.python for other experiences with Max, OSX, 
sockets, and maybe ftp.  Since the error message comes 
from the OS blaming nyx, I think more likely than not that 
this is not a Python bug.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1437614group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1462706 ] urllib2 bails if the localhost doens't have a fqdn hostname

2006-04-02 Thread SourceForge.net
Bugs item #1462706, was opened at 2006-04-01 15:40
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1462706group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: None
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Matt Fleming (splitscreen)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib2 bails if the localhost doens't have a fqdn hostname

Initial Comment:
When running the test suite I ran into a similar
problem to bug #1257988.

in the FileHandler class's get_names() method should be
wrapped in a try, except block because it shouldn't
assume that the localhost has a fqdn hostname.

Attached is a minimal diff against trunk r43542.

Matt

--

Comment By: Georg Brandl (gbrandl)
Date: 2006-04-02 20:37

Message:
Logged In: YES 
user_id=849994

Fixed in rev. 43552.

--

Comment By: John J Lee (jjlee)
Date: 2006-04-01 22:35

Message:
Logged In: YES 
user_id=261020

This fixes the test failure and is safe.  I don't know if a
more sophisticated patch is possible, but if nobody comes up
with one, I think this should be applied (as happened with
#1257988).

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1462706group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com