ANN: PyGUI 2.1.1

2009-11-19 Thread Greg Ewing

PyGUI 2.1.1 is available:

  http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/

This is an emergency bugfix release to repair some major
breakage in the gtk version. Also corrects some other
problems.


What is PyGUI?
--

PyGUI is a cross-platform GUI toolkit designed to be lightweight
and have a highly Pythonic API.

--
Gregory Ewing
greg.ew...@canterbury.ac.nz
http://www.cosc.canterbury.ac.nz/greg.ewing/
--
http://mail.python.org/mailman/listinfo/python-announce-list

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


PyCon Posters deadline looms: Nov. 30

2009-11-19 Thread Catherine Devlin
The deadline for PyCon poster proposals is coming up soon - November 30!

This year PyCon is introducing Poster Sessions. Poster sessions provide an
alternative presentation mechanism that facilitates more one-on-one
communication between the presenter and the audience. Poster sessions are
particularly suited for topics of interest to a subset of the community, and
we anticipate these sessions will provide an incubator for further
discussions.

PyCon 2010 is now seeking proposals for poster presentations and virtual
poster presentations. Proposals for posters will be accepted through
November 30th, and acceptance notifications will be provided by December
14th.

More information about the what, how, when, and why of poster sessions is
here:

http://us.pycon.org/2010/conference/posters/cfp/

See you at PyCon,
-- 
- Catherine
http://catherinedevlin.blogspot.com/
*** PyCon * Feb 17-25, 2010 * Atlanta, GA * us.pycon.org ***
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

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


Python 3.1 cx_Oracle 5.0.2 ImportError: DLL load failed: The specified module could not be found.

2009-11-19 Thread André
Hello,

I'm trying to get Python 3.1 and cx_Oracle 5.02
(cx_Oracle-5.0.2-10g.win32-py3.0.msi) to connect to an Oracle
11.1.0.7.0 database via OraClient10g 10.2.0.3.0 with Pydev
1.5.1.1258496115 in Eclipse 20090920-1017 on Windows XP SP 3 v2002.
The import cx_Oracle line appears as an unresolved import and when I
run the application I get the following error to console:
Traceback (most recent call last):
  File FILEPATHHERE, line 1, in module
import cx_Oracle
ImportError: DLL load failed: The specified module could not be found.

Apparently the error is caused by cx_Oracle not being able to find the
Oracle client DLLs (oci.dll and others). The client home path and the
client home path bin directory are in the PATH System Variable and
oci.dll is there.

I tried getting the Oracle Instant Client (instantclient-basic-
win32-11.1.0.7.0.zip from 
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html)
and installing it as directed. I added the instant client path to the
PATH System Variable but that didn't work either.

I have scoured the internet and have not found a solution.

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


Re: is there any FIX message handle modules in Python?

2009-11-19 Thread Simon Hibbs
On 19 Nov, 05:25, alex23 wuwe...@gmail.com wrote:
 On Nov 19, 3:21 pm, Stephen.Wu 54wut...@gmail.com wrote:

  FIX message is the Financial information Exchange protocol
  messages...
  any 3rd libs we have?

 You mean like this one that was the first result when I googled
 'python financial information exchange'?

 http://www.quickfixengine.org/

There are no prebuilt Python modules available based on quickfix, at
least that I'm aware of. It has Python bindings available, but you
have to complie it with them yourself from the C++ source.

Simon Hibbs


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


Re: python gui builders

2009-11-19 Thread sturlamolden
On 18 Nov, 20:19, Dave Cook davec...@nowhere.net wrote:

 If it's an issue for your project, I suggest wxPython.  It's
 cross-platform, fairly complete, and extensible.  But the API is
 clunky compared to Qt.

Not if we use wxFormBuilder 3.1.
-- 
http://mail.python.org/mailman/listinfo/python-list


Communication between python and wxWidgets.. Help needed...

2009-11-19 Thread Jebagnana Das
Hi Friends,

I want to thank you all for doing a great job.. I seek your
suggestions and valuable guidance regarding two things.

1) I'm using python 3.1.1 and wxWidgets for GUI development in my project ..
I want to have a half-duplex communication between widgets and python(say
passing something from wxWidgets to python and processing there and sending
it back to display the results in widgets). When i googled around i found
that we have to have SWIG or Boost::Python and some other third party
applications to make this to work.. I'm wondering why it's really tough to
establish a communication between the two though wxWidgets which is an
excellent tool is mainly projected as a GUI toolkit especially for c++ and
python and python is described as a powerful scripting language.. Can u
suggest an efficient way by which i could make these two programs to
interact(back and forth) easily??

2) My second question is even if i did that successfully if i want to
convert my project into an executable file how would i do that? (Bcoz. i
will be having two executables or binaries in linux one for python and other
for widgets) Do i need to convert it to lib or dll file with respect to
python and c++ or is there any other way for making a build-script? What are
the tools and libraries needed(like cx-freeze,pyWin32) to accomplish this??

 Please give me some useful links... All of your suggestions are highly
welcomed..

Thanks  Regards,
Jebagnanadas A,
Python-Developer.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: non-copy slices

2009-11-19 Thread tbourden
No I'm well aware that there is no deep copy of the objects and the lists
only keep references to the objects and in essence they have the same
objects in there. But this doesn't mean they are the same list.
Modifications to slices are not written back to the original list.

x = range(5)
y = x[1:3]
y[0] = 13
x[1] == y[0]  -- False

Of course if I modify the object in the slice then the original list will
see the change, but this is not what I was saying. Second and more
importantly it's the performance penalty from allocating a large number of
lists produced from the slices and the copy of the references. islice does
not have this penalty, it should only instantiate a small object that
iterates on the original list.

Themis


On Thu, Nov 19, 2009 at 3:00 AM, Rami Chowdhury rami.chowdh...@gmail.comwrote:


 I'm not sure you're understanding the point others have been making. A
 list item is merely another reference to an existing object -- it
 doesn't copy the object in any way.


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


Re: getting properly one subprocess output

2009-11-19 Thread Jean-Michel Pichavant

Nobody wrote:

On Wed, 18 Nov 2009 12:25:14 +0100, Jean-Michel Pichavant wrote:

  
I'm currently inspecting my Linux process list, trying to parse it in 
order to get one particular process (and kill it).

I ran into an annoying issue:
The stdout display is somehow truncated (maybe a terminal length issue, 
I don't know), breaking my parsing.



  

As you can see, to complete process command line is truncated.
Any clue on how to get the full version ?



If you only need it to work on Linux, you can just enumerate 
/proc/[1-9]*/exe or /proc/[1-9]*/cmdline.


Or you can add -ww to ps to avoid truncating the output.

Note that the /proc/*/exe report the actual executable. The command line
reported by ps (from /proc/*/cmdline) can be modified by the program, so
it doesn't necessarily reflect the program being run.


  
That is what I was searching for. It's in ps man page, I don't know why 
I missed it in the first place.

Thanks.

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


Re: non-copy slices

2009-11-19 Thread Daniel Stutzbach
On Wed, Nov 18, 2009 at 9:00 PM, Rami Chowdhury rami.chowdh...@gmail.comwrote:

 I'm not sure you're understanding the point others have been making. A
 list item is merely another reference to an existing object -- it
 doesn't copy the object in any way.


It still has to copy the reference, though.  That takes O(n) time if you're
taking a big slice.

--
Daniel Stutzbach, Ph.D.
President, Stutzbach Enterprises, LLC http://stutzbachenterprises.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: non-copy slices

2009-11-19 Thread Ethan Furman

Please don't top post.  :)

tbour...@doc.ic.ac.uk wrote:
On Thu, Nov 19, 2009 at 3:00 AM, Rami Chowdhury 
rami.chowdh...@gmail.com mailto:rami.chowdh...@gmail.com wrote:


I'm not sure you're understanding the point others have been making. A
list item is merely another reference to an existing object -- it
doesn't copy the object in any way.

No I'm well aware that there is no deep copy of the objects and the 
lists only keep references to the objects and in essence they have the 
same objects in there. But this doesn't mean they are the same list. 
Modifications to slices are not written back to the original list.


x = range(5)
y = x[1:3]
y[0] = 13
x[1] == y[0]  -- False

Of course if I modify the object in the slice then the original list 
will see the change, but this is not what I was saying. Second and more 
importantly it's the performance penalty from allocating a large number 
of lists produced from the slices and the copy of the references. islice 
does not have this penalty, it should only instantiate a small object 
that iterates on the original list.


Themis


So shallow copy == new label created for existing object.

So is your desired behavior to write back to the original list if your 
sub-list is modified?  In other words, you are creating a window onto an 
existing list?  If not, what would happen when a sublist element was 
modified (or deleted, or appended, or ...)?


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


Re: A Good Mailer

2009-11-19 Thread Victor Subervi
On Wed, Nov 18, 2009 at 6:30 PM, Nick Stinemates n...@stinemates.orgwrote:

 On Wed, Nov 18, 2009 at 03:27:11PM -0400, Victor Subervi wrote:
  Hi;
  I need a good mailer that will enable me to mail email from web forms.

 smtplib

  Suggestions?

 silly example..

 #!/usr/bin/env python
 import smtplib

 session = smtplib.SMTP(localhost)
 username = abc
 password = def
 session.login(username, password) # only if it requires auth

 subject = Hello, 

 header = Subject: %s \r\nContent-type: text/html;
 charset=utf-8\r\n\r\n

 message = world!

 email_from = vic...@is.awesome
 email_to = [em...@myhost.com]

 session.sendmail(email_from, email_to, header+messages)

 HTH,


Helps a lot! Thanks!
V
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: non-copy slices

2009-11-19 Thread Rami Chowdhury

On Thu, 19 Nov 2009 02:39:42 -0800, tbour...@doc.ic.ac.uk wrote:


Second and more
importantly it's the performance penalty from allocating a large number  
of

lists produced from the slices and the copy of the references.


Ah, I see what you were getting at -- thanks for clarifying.



On Thu, Nov 19, 2009 at 3:00 AM, Rami Chowdhury  
rami.chowdh...@gmail.comwrote:




I'm not sure you're understanding the point others have been making. A
list item is merely another reference to an existing object -- it
doesn't copy the object in any way.






--
Rami Chowdhury
Never attribute to malice that which can be attributed to stupidity --  
Hanlon's Razor

408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD)
--
http://mail.python.org/mailman/listinfo/python-list


Python Will Not Send Email!!

2009-11-19 Thread Victor Subervi
Hi;
I created this testMail.py file as root:

#!/usr/bin/env python
import smtplib
session = smtplib.SMTP(localhost)
subject = Hello, 
header = Subject: %s \r\nContent-type: text/html; charset=utf-8\r\n\r\n
message = world!
email_from = vic...@is.awesome
email_to = [em...@myhost.com]
session.sendmail(email_from, email_to, header+messages)

[r...@13gems globalsolutionsgroup.vi]# chmod 755 testMail.py
[r...@13gems globalsolutionsgroup.vi]# python testMail.py
Traceback (most recent call last):
  File testMail.py, line 2, in ?
import smtplib
  File /usr/lib64/python2.4/smtplib.py, line 49, in ?
from email.base64MIME import encode as encode_base64
ImportError: No module named base64MIME

What gives??
TIA,
Victor
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Will Not Send Email!!

2009-11-19 Thread Victor Subervi
On Thu, Nov 19, 2009 at 11:28 AM, Victor Subervi victorsube...@gmail.comwrote:

 Hi;
 I created this testMail.py file as root:

 #!/usr/bin/env python
 import smtplib
 session = smtplib.SMTP(localhost)
 subject = Hello, 
 header = Subject: %s \r\nContent-type: text/html; charset=utf-8\r\n\r\n
 message = world!
 email_from = vic...@is.awesome
 email_to = [em...@myhost.com]
 session.sendmail(email_from, email_to, header+messages)

 [r...@13gems globalsolutionsgroup.vi]# chmod 755 testMail.py
 [r...@13gems globalsolutionsgroup.vi]# python testMail.py
 Traceback (most recent call last):
   File testMail.py, line 2, in ?
 import smtplib
   File /usr/lib64/python2.4/smtplib.py, line 49, in ?
 from email.base64MIME import encode as encode_base64
 ImportError: No module named base64MIME

 What gives??
 TIA,
 Victor

PS Python 2.4 on CentOS
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python and web pages

2009-11-19 Thread Gerhard Häring
Daniel Dalton wrote:
 Hi,
 
 Here is my situation:
 I'm using the command line, as in, I'm not starting gnome or kde (I'm on
 linux.)
 I have a string of text attached to a variable,. So I need to use one of
 the browsers on linux, that run under the command line, eg. lynx,
 elinks, links, links2 and do the following.

No, you don't need any text mode browser. It's much easier to do with
modules from the Python standard library.

 1. Open a certain web page and find the first text box on the page, and
 put this text into the form.

I assume you know HTML and HTTP.

You can use urllib or urllib2 to submit the form.

 2. Press the submit button, and wait for the result page to load.
 3. Click on the 15th link down the page.

You will then get the returned HTML from a function and you will have to
parse it for the link you're interested in. There are many approaches to
get there. Manual parsing, regular expressions or one of the XML parsers
in the standard library (etree is the easiest).

 So, how do I do this, can anyone point me to some docs or modules that
 may help out here?

While all of this may seem overwhelming at first, I guess the solution
can be written in 20 - 30 lines of code.

-- Gerhard

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


make two tables having same orders in both column and row names

2009-11-19 Thread Ping-Hsun Hsieh
Hi,

I would like to compare values in two table with same column and row names, but 
with different orders in column and row names.
For example, table_A in a file looks like the follows:
AA100   AA109   AA101   AA103   AA102
BB1 2   9   2.3 1   28
BB3 12  9   2.3 1   28
BB9 0.5 2   2.3 1   28
BB2 2   9   21  1   20

Table_B in the other file looks like the follows:
AA101   AA109   AA100   AA103   AA102
BB1 2   9   2.3 2   28
BB2 2   9   2.3 1   28
BB9 2   9   2.3 1   28
BB3 2   2   2   1   28

Can anyone give an efficient way to make the two tables having same orders in 
column and row names so I can easily and correctly compare the values in 
positions?

Thanks,
PingHsun

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


Re: Writing a Carriage Return in Unicode

2009-11-19 Thread Doug

Hi! Thanks for clearing this up!!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Communication between python and wxWidgets.. Help needed...

2009-11-19 Thread Jonas Geiregat


Op 19-nov-09, om 09:42 heeft Jebagnana Das het volgende geschreven:


Hi Friends,

I want to thank you all for doing a great job.. I  
seek your suggestions and valuable guidance regarding two things.


1) I'm using python 3.1.1 and wxWidgets for GUI development in my  
project .. I want to have a half-duplex communication between  
widgets and python(say passing something from wxWidgets to python  
and processing there and sending it back to display the results in  
widgets). When i googled around i found that we have to have SWIG or  
Boost::Python and some other third party applications to make this  
to work.. I'm wondering why it's really tough to establish a  
communication between the two though wxWidgets which is an excellent  
tool is mainly projected as a GUI toolkit especially for c++ and  
python and python is described as a powerful scripting language..  
Can u suggest an efficient way by which i could make these two  
programs to interact(back and forth) easily??





For your first question check out: wx.lib.pubsub: 
http://www.wxpython.org/docs/api/wx.lib.pubsub-module.html

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


Re: Python Will Not Send Email!!

2009-11-19 Thread Carsten Haese
Victor Subervi wrote:
 Hi;
 I created this testMail.py file as root:
 
 #!/usr/bin/env python
 import smtplib
 session = smtplib.SMTP(localhost)
 subject = Hello, 
 header = Subject: %s \r\nContent-type: text/html; charset=utf-8\r\n\r\n
 message = world!
 email_from = vic...@is.awesome
 email_to = [em...@myhost.com mailto:em...@myhost.com]
 session.sendmail(email_from, email_to, header+messages)
 
 [r...@13gems globalsolutionsgroup.vi http://globalsolutionsgroup.vi]#
 chmod 755 testMail.py
 [r...@13gems globalsolutionsgroup.vi http://globalsolutionsgroup.vi]#
 python testMail.py
 Traceback (most recent call last):
   File testMail.py, line 2, in ?
 import smtplib
   File /usr/lib64/python2.4/smtplib.py, line 49, in ?
 from email.base64MIME import encode as encode_base64
 ImportError: No module named base64MIME
 
 What gives??

Do you have a file called email.py in your current directory or
anywhere else on Python's path outside of the standard library? If so,
it's hiding the real email module from your script and you'll need to
get rid of your email.py by renaming or moving it.

--
Carsten Haese
http://informixdb.sourceforge.net

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


Re: non-copy slices

2009-11-19 Thread Themis Bourdenas
On Thu, Nov 19, 2009 at 2:44 PM, Ethan Furman et...@stoneleaf.us wrote:

 Please don't top post.  :)

 So shallow copy == new label created for existing object.

 So is your desired behavior to write back to the original list if your
 sub-list is modified?  In other words, you are creating a window onto an
 existing list?  If not, what would happen when a sublist element was
 modified (or deleted, or appended, or ...)?

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


Yes a window / view on the existing list describes it best. So every
modification you make in this view is actually modifying the original list
accordingly. Blist that was suggested in a previous email in the thread
seems lightweight but it does create a new list when a modification is made.
In any case, I've already implemented the object myself and I can post it if
you care to have a look, but I was just wondering if there was already
something in the standard library.

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


Re: mechanize login problem with website

2009-11-19 Thread elca



elca wrote:
 
 Hello
 
 I'm making auto-login script by use mechanize python.
 
 Before I was used mechanize with no problem, but http://www.gmarket.co.kr
 in this site I couldn't make it .
 
 whenever i try to login always login page was returned even with correct
 gmarket id , pass, i can't login and I saw some suspicious message
 
 script language=javascripttop.location.reload();/script
 
 I think this related with my problem, but don't know exactly how to handle
 .
 
 i was upload my script in here
 
 # -*- coding: cp949 -*-
 from lxml.html import parse, fromstring
 import sys,os
 import mechanize, urllib
 import cookielib
 import re
 from BeautifulSoup import BeautifulSoup,BeautifulStoneSoup,Tag
 
 try:
 
 params = urllib.urlencode({'command':'login',
'url':'http%3A%2F%2Fwww.gmarket.co.kr%2F',
'member_type':'mem',
'member_yn':'Y',
'login_id':'tgi177',
'image1.x':'31',
'image1.y':'26',
'passwd':'tk1047',
'buyer_nm':'',
'buyer_tel_no1':'',
'buyer_tel_no2':'',
'buyer_tel_no3':''
 
})
 rq = mechanize.Request(http://www.gmarket.co.kr/challenge/login.asp;)
 rs = mechanize.urlopen(rq)
 data = rs.read()
 
 
 logged_in = r'input_login_check_value'  in data   
  
 if logged_in:
 print ' login success !'  
 rq = mechanize.Request(http://www.gmarket.co.kr;) 
 rs = mechanize.urlopen(rq)
 data = rs.read()   
 print data  
  
 else:
 print 'login failed!'
 pass
 quit()  
 except:
 pass
 
 
 if anyone can help me much appreciate thanks in advance
 
 
i was updated my script source
-- 
View this message in context: 
http://old.nabble.com/mechanize-login-problem-with-website-tp26420202p26421474.html
Sent from the Python - python-list mailing list archive at Nabble.com.

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


Re: Communication between python and wxWidgets.. Help needed...

2009-11-19 Thread Dave Angel

Jonas Geiregat wrote:


Op 19-nov-09, om 09:42 heeft Jebagnana Das het volgende geschreven:


Hi Friends,

I want to thank you all for doing a great job.. I 
seek your suggestions and valuable guidance regarding two things.


1) I'm using python 3.1.1 and wxWidgets for GUI development in my 
project .. I want to have a half-duplex communication between widgets 
and python(say passing something from wxWidgets to python and 
processing there and sending it back to display the results in 
widgets). When i googled around i found that we have to have SWIG or 
Boost::Python and some other third party applications to make this to 
work.. I'm wondering why it's really tough to establish a 
communication between the two though wxWidgets which is an excellent 
tool is mainly projected as a GUI toolkit especially for c++ and 
python and python is described as a powerful scripting language.. Can 
u suggest an efficient way by which i could make these two programs 
to interact(back and forth) easily??





For your first question check out: wx.lib.pubsub: 
http://www.wxpython.org/docs/api/wx.lib.pubsub-module.html



I looked at your query a couple of times, and I don't see wxPython 
listed there anywhere.  You don't need SWIG or Boost or anything else -- 
that's what wxPython is.


Instead of just getting wxWidgets, get wxPython, which includes 
wxWidgets as a black box underneath.


binaries here:  http://wxpython.org/download.php#binaries
dos here:  http://www.wxpython.org/docs/api/wx-module.html

Of course, the catch is that this whole project supports Python 2.4 
through 2.6.  If you want to get it to work on 3.1, you have to either 
wait, or do it yourself.


DaveA

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


Re: make two tables having same orders in both column and row names

2009-11-19 Thread Emile van Sebille

On 11/18/2009 12:57 PM Ping-Hsun Hsieh said...

Hi,

I would like to compare values in two table with same column and row names, but 
with different orders in column and row names.
For example, table_A in a file looks like the follows:
AA100   AA109   AA101   AA103   AA102
BB1 2   9   2.3 1   28
BB3 12  9   2.3 1   28
BB9 0.5 2   2.3 1   28
BB2 2   9   21  1   20

Table_B in the other file looks like the follows:
AA101   AA109   AA100   AA103   AA102
BB1 2   9   2.3 2   28
BB2 2   9   2.3 1   28
BB9 2   9   2.3 1   28
BB3 2   2   2   1   28

Can anyone give an efficient way to make the two tables having same orders in 
column and row names so I can easily and correctly compare the values in 
positions?

Thanks,
PingHsun



This is one way... (python 2.4.1)
#For example, table_A in a file looks like the follows:
table_A = [ line.split()
  for line in AA100  AA109   AA101   AA103   AA102
BB1 2   9   2.3 1   28
BB3 12  9   2.3 1   28
BB9 0.5 2   2.3 1   28
BB2 2   9   21  1   20.split('\n')
  ]

#Table_B in the other file looks like the follows:
table_B = [ line.split()
  for line in AA101  AA109   AA100   AA103   AA102
BB1 2   9   2.3 2   28
BB2 2   9   2.3 1   28
BB9 2   9   2.3 1   28
BB3 2   2   2   1   28.split('\n')
  ]


for table in table_A,table_B:
table[:] = [['']+table[0]]+sorted(table[1:])
table = zip(*sorted(zip(*table)))
for ii in table: print ii


Emile

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


Re: Python-list Digest, Vol 74, Issue 245

2009-11-19 Thread Threader Slash
On Thu, Nov 19, 2009 at 7:05 PM, python-list-requ...@python.org wrote:


 --  --
 From: Threader Slash threadersl...@gmail.com
 To: python-list@python.org
 Date: Thu, 19 Nov 2009 14:51:27 +1100
 Subject: Qt Python radiobutton: activate event
 Hi Guys,

 I am trying to get the choice made by the user on Python Qt with
 radiobutton.

 QtCore.QObject.connect(self.radioButton1,
 QtCore.SIGNAL(toggled()),self.radio_activateInput)
 QtCore.QObject.connect(self.radioButton2,
 QtCore.SIGNAL(toggled()),self.radio_activateInput)

 and that

 QtCore.QObject.connect(self.performGroupBox,
 QtCore.SIGNAL(toggled()),self.radio_activateInput)

 But it didn't make anything when I click on the option.

 Yes, I have enabled it:

 self.radioButton1.setCheckable(True)
 self.radioButton1.setChecked(True)
 self.radioButton2.setCheckable(True)

 Any suggestion?


 -- Forwarded message --


Here is solution... now working:

QtCore.QObject.connect(self.radioButton1,QtCore.SIGNAL(toggled(bool)),self.radio_activateInput)

when have the parameter bool included into toggled to signal, it worked.

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


Re: Python Will Not Send Email!!

2009-11-19 Thread Kev Dwyer
On Thu, 19 Nov 2009 11:28:37 -0400, Victor Subervi wrote:

Hello Victor, 

There are some pages on the internet that suggest that this problem my be 
caused by a module named email.py (or email.pyc) in your pythonpath.  If 
you try import smtplib in the interpreter do you get this error message?  
If so, start a new interpreter session and try import email - is the 
email module imported from the stdlib?

If these steps don't help, it might be useful if you can tell us which 
Linux distribution you are using.

Cheers,

Kev

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


Re: make two tables having same orders in both column and row names

2009-11-19 Thread Simon Forman
On Wed, Nov 18, 2009 at 3:57 PM, Ping-Hsun Hsieh hsi...@ohsu.edu wrote:
 Hi,

 I would like to compare values in two table with same column and row names, 
 but with different orders in column and row names.
 For example, table_A in a file looks like the follows:
 AA100   AA109   AA101   AA103   AA102
 BB1     2       9       2.3     1       28
 BB3     12      9       2.3     1       28
 BB9     0.5     2       2.3     1       28
 BB2     2       9       21      1       20

 Table_B in the other file looks like the follows:
 AA101   AA109   AA100   AA103   AA102
 BB1     2       9       2.3     2       28
 BB2     2       9       2.3     1       28
 BB9     2       9       2.3     1       28
 BB3     2       2       2       1       28

 Can anyone give an efficient way to make the two tables having same orders in 
 column and row names so I can easily and correctly compare the values in 
 positions?

 Thanks,
 PingHsun

Depending on the kind of comparisons you want to do and the sizes of
your input files you could build a dict of dicts.
For example:


def generate_dict_values(F):
column_names = f.readline().split()
for line in F:
row = line.split()
yield row[0], dict(zip(column_names, row[1:]))


# Fake a file.
from StringIO import StringIO
f = StringIO('''\
AA100   AA109   AA101   AA103   AA102
BB1 2   9   2.3 1   28
BB3 12  9   2.3 1   28
BB9 0.5 2   2.3 1   28
BB2 2   9   21  1   20
''')


d = dict(generate_dict_values(f))

# Now you can access the values without regards to the order in the
file like so:

d['BB9']['AA109']



# Pretty print the dict of dicts.
from pprint import pprint
pprint(d)

# Prints:
#
#{'BB1': {'AA100': '2',
# 'AA101': '2.3',
# 'AA102': '28',
# 'AA103': '1',
# 'AA109': '9'},
# 'BB2': {'AA100': '2',
# 'AA101': '21',
# 'AA102': '20',
# 'AA103': '1',
# 'AA109': '9'},
# 'BB3': {'AA100': '12',
# 'AA101': '2.3',
# 'AA102': '28',
# 'AA103': '1',
# 'AA109': '9'},
# 'BB9': {'AA100': '0.5',
# 'AA101': '2.3',
# 'AA102': '28',
# 'AA103': '1',
# 'AA109': '2'}}
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: hex

2009-11-19 Thread Rhodri James
On Thu, 19 Nov 2009 02:29:59 -, hong zhang henryzhan...@yahoo.com  
wrote:



List,

I want to input hex number instead of int number. in type=int in  
following,


parser.add_option(-F, --forcemcs, dest=force_mcs, type=int,  
default=0, help=index of 11n mcs table. Default: 0.)


How can I do it?


Assuming you're talking about optparse, just prefix the number with 0x  
on the command line:


python myscript.py -F 0xDEAD

If you don't want to have to type the leading 0x, you'll either have to  
make yourself a custom type for optparse, or treat it as a string and do  
the parsing and error handling afterwards.  My recommendation is that you  
don't do this: not prefixing your constants if they aren't decimal is an  
accident waiting to happen.


--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list


Re: non-copy slices

2009-11-19 Thread Ethan Furman

Themis Bourdenas wrote:
On Thu, Nov 19, 2009 at 2:44 PM, Ethan Furman et...@stoneleaf.us 
mailto:et...@stoneleaf.us wrote:


So shallow copy == new label created for existing object.

So is your desired behavior to write back to the original list if your
sub-list is modified?  In other words, you are creating a window onto an
existing list?  If not, what would happen when a sublist element was
modified (or deleted, or appended, or ...)?

~Ethan~

Yes a window / view on the existing list describes it best. So every 
modification you make in this view is actually modifying the original 
list accordingly. Blist that was suggested in a previous email in the 
thread seems lightweight but it does create a new list when a 
modification is made. In any case, I've already implemented the object 
myself and I can post it if you care to have a look, but I was just 
wondering if there was already something in the standard library.


Themis


Unfortunately, I am not very familiar with the stdlib yet (gotta buy 
that book!).  I'm going to guess 'No' since nobody has chimed in with a 
'Yes', though.


I'd love to see what you have for that.  Does in support a stepped 
window, or only contiguous sequences?  The one I put together this 
afternoon only does contiguous sequences, as I had no use cases to 
decide how assignments of multiple items should be handled, and not a 
lot of time to implement something generic -- so, to answer John's 
question from a completely different thread, yes I do enjoy working on 
small projects even if IAGNI.  :)


Cheers!

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


[issue6816] Provide CPython command line functionality via runpy module

2009-11-19 Thread Chris Withers

Changes by Chris Withers ch...@simplistix.co.uk:


--
nosy:  -cjw296

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



[issue1488943] difflib.Differ() doesn't always add hints for tab characters

2009-11-19 Thread Phillip Hellewell

Phillip Hellewell ssho...@gmail.com added the comment:

Please apply the patch ASAP.  This bug is affecting downstream product
viewvc in a very adverse way.  See
http://viewvc.tigris.org/issues/show_bug.cgi?id=436

It's sad that I spent several hours tracking down this bug only to find
out that henryl found it and provided a fix *3 and a half years ago*. 
Why is it taking so long to apply such a small yet important patch?

--
nosy: +sshock

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



[issue7355] Struct incorrectly compiles format strings

2009-11-19 Thread Steve Krenzel

New submission from Steve Krenzel sgk...@gmail.com:

The struct module has a calcsize() method which reports the size of the data 
for a specified format 
string. In some instances, to the best of my knowledge, this is wrong.

To repro:
 from struct import calcsize
 calcsize(ci)
8
 calcsize(ic)
5

The correct answer is 5 (a single byte character and a four byte int take up 5 
bytes of space). For 
some reason when a 'c' is followed by an 'i', this is wrong and instead 
allocates 4 bytes to the 'c'.
This has been verified in 2.6 and 2.5.

You can also repro this by using 's', '2c', and similar combinations in place 
of 'c'. as well as 'I' 
in place of 'i'. This might effect other combinations as well.

--
components: Library (Lib)
messages: 95467
nosy: sgk284
severity: normal
status: open
title: Struct incorrectly compiles format strings
type: behavior
versions: Python 2.5, Python 2.6

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



[issue5862] multiprocessing 'using a remote manager' example errors and possible 'from_address' code leftover

2009-11-19 Thread Alexander Dutton

Changes by Alexander Dutton d...@alexdutton.co.uk:


--
nosy: +alexdutton

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



[issue7355] Struct incorrectly compiles format strings

2009-11-19 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

It's a padding issue, having to do with putting values at the correct
word boundaries.

--
nosy: +eric.smith
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue1859] textwrap doesn't linebreak on \n

2009-11-19 Thread Tom Lynn

Tom Lynn tl...@users.sourceforge.net added the comment:

This bug should be re-opened, since there is definitely a bug here.  
I think the patch was incorrectly rejected.

If I can expand palfrey's example:

from textwrap import *
T = TextWrapper(replace_whitespace=False, width=75)
text = '''\
a a a a a
b b b b b
c c c c c
d d d d d
e e e e e'''
for line in T.wrap(text): print line

Python 2.5 textwrap turns it into:

a a a a a
b b b b b
c c
c c c
d d d d d
e e e e
e

That can't be right.  palfrey's patch leaves the input unchanged, which 
seems correct to me.  I think Guido guessed wrong here: the docs for 
replace_whitespace say:

  If true, each whitespace character (as defined by string.whitespace)
  remaining after tab expansion will be replaced by a single space

The text should therefore not be reflowed in this case since 
replace_whitespace=False.  palfrey's patch seems correct to me.

It can be made to reflow to the full width by editing palfrey's patch, 
but that would disagree with the docs and break code.

--
nosy: +tlynn

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



[issue7353] Why was Include/intobject.h removed in 3.1?

2009-11-19 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

 However, that header file was removed in this commit:
  http://svn.python.org/view?view=revrevision=71697

Hmm.  That was me.

 with this message:
   Issue #4910:  PyNumber_Int is deprecated in 3.0.1; will be removed in
 3.1.

That's the message for r69517, I think, which just added an entry to
Include/intobject.h.  The message for r71697 was:

The comments at the top of intobject.h say that it will be removed in
3.1.  Make it so.

I'm not too sure of the history here, but I suspect that
Include/intobject.h was at least partly an aid to porting the Python
extension modules from 2.x to 3.0, rather than third-party modules.

Christian, Benjamin:  any comments?

I'm -1 on resurrecting Include/intobject.h in its old location.  I don't
much like the idea of having a random include file that's no longer used
by Python itself in the main Include directory;  it'll likely succumb to
bitrot before long.  But maybe there's a place for 2-to-3 porting aids
in the Tools directory, where there's less expectation that files are
well-maintained?

 Is is acceptable if I ship that header file in my distribution
 packages of python-3.1.1 ?  (possibly with a reworded deprecation
 warning?)

I can't see any problem with this.

I agree the porting documentation needs to be updated, whatever happens.

--
assignee:  - georg.brandl
components: +Documentation
nosy: +benjamin.peterson, christian.heimes, georg.brandl, mark.dickinson

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



[issue7353] Why was Include/intobject.h removed in 3.1?

2009-11-19 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

I didn't mean to assign this to Georg.  Apologies.

--
assignee: georg.brandl - 

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



[issue6454] Add example keyword argument to optparse constructor

2009-11-19 Thread Marcin Kasperski

Marcin Kasperski marcin.kasper...@mekk.waw.pl added the comment:

I found this bug while looking for suggestions how to add examples to
the optparse help call, but I feel there is a better and more general
solution - just provide some minimal formatting for description: treat
empty line as paragraph separator. Then I would be able to add example
or anything else to the description formatting it as necessary

--
nosy: +Mekk

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



[issue7351] Documentation typos found in zipfile — Work with ZIP archives

2009-11-19 Thread Retro

Retro vinet...@gmail.com added the comment:

I suggest renaming the class from BadZipfile to BadZipFile. We have a
class named LargeZipFile. It would make sence to have the previously
mentioned class named as BadZipFile then. What is your verdict on that?

--

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



[issue7355] Struct incorrectly compiles format strings

2009-11-19 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

What Eric said.  You can see the padding explicitly in the results of
struct.pack:

 struct.pack(ci, '*', 0x12131415) # 8-byte result, 3 padding bytes
'*\x00\x00\x00\x15\x14\x13\x12'
 struct.pack(ic, 0x12131415, '*') # 5-byte result, no padding.
'\x15\x14\x13\x12*'

Note the 3 zero bytes in the first result string.

This gets reported frequently enough that I wonder whether the docs
should be rearranged and/or expanded.  The existence of padding is
mentioned, but not particularly prominently or thoroughly.

--
nosy: +mark.dickinson

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



[issue7356] parsing of ldconfig output in ctypes/utils.py depends on the locale

2009-11-19 Thread Matthias Klose

New submission from Matthias Klose d...@debian.org:

% /sbin/ldconfig -p | grep GL
libGLU.so.1 (libc6) = /usr/lib/libGLU.so.1
libGLEW.so.1.5 (libc6) = /usr/lib/libGLEW.so.1.5
libGL.so.1 (libc6, Système d'exploitation ABI : Linux 2.4.20) =
/usr/lib/libGL.so.1

the regexp fails to parse this. proposing to set LANG=C when calling
ldconfig.

--
assignee: theller
components: ctypes
files: util.py.diff
keywords: patch
messages: 95475
nosy: doko, theller
severity: normal
status: open
title: parsing of ldconfig output in ctypes/utils.py depends on the locale
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file15363/util.py.diff

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



[issue5833] readline update

2009-11-19 Thread Matthias Klose

Matthias Klose d...@debian.org added the comment:

msg94560 should read backported to the 2.6 branch. can we close the
report?

--
nosy: +doko

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



[issue7351] Documentation typos found in zipfile — Work with ZIP archives

2009-11-19 Thread Ezio Melotti

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

The old name could be deprecated and replaced by the right one, but as
Eric Smith mentioned on #python-dev, the class with the old name can't
be removed because - even if unlikely - the object might exist in a pickle.
So we can either live with the wrong name or deprecate it, fix the
places where it's used and live with a deprecated version that can't be
removed.

--
nosy: +ezio.melotti
priority:  - low

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



[issue7353] cporting docs recommend using Include/intobject.h, which was removed in 3.1?

2009-11-19 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

You didn't.  Doc bugs are automatically assigned to Georg by the tracker.

--
nosy: +r.david.murray
priority:  - normal
stage:  - needs patch
title: Why was Include/intobject.h removed in 3.1? - cporting docs recommend 
using Include/intobject.h, which was removed in 3.1?
type:  - behavior
versions: +Python 3.2

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



[issue7353] cporting docs recommend using Include/intobject.h, which was removed in 3.1?

2009-11-19 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy:  -r.david.murray

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



[issue5833] readline update

2009-11-19 Thread Antoine Pitrou

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

 Can we close the report?

Well there's something else in the original patch, although I don't care
about it.

--

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



[issue7355] Struct incorrectly compiles format strings

2009-11-19 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Reopening for possible doc clarification.  Suggestions welcome!

--
assignee:  - mark.dickinson
components: +Documentation, Extension Modules -Library (Lib)
keywords: +easy
priority:  - low
resolution: invalid - 
stage: committed/rejected - needs patch
status: closed - open
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.5

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



[issue7357] tarfile doesn't detect disk full error on extraction

2009-11-19 Thread Eli Venter

New submission from Eli Venter even...@jcvi.org:

tarfile doesn't seem to return any error or raise any exception when an
extraction fills up the disk, making it hard to use safely. Both
extractall and extract suffer from this problem. I'm using CentOS 5.2
and python 2.6.2.

--
components: Library (Lib)
messages: 95481
nosy: eliv
severity: normal
status: open
title: tarfile doesn't detect disk full error on extraction
versions: Python 2.6

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



[issue7358] cPickle crash on failed assertion

2009-11-19 Thread Ryan Shaw

New submission from Ryan Shaw ryan.s...@stanfordalumni.org:

def save_object(r, key, m):
r.set(key, cPickle.dumps(m))

[4]  save_object(r, 'cluster', cluster)
python: ./Modules/cStringIO.c:419: O_cwrite: Assertion `oself-pos + l  
2147483647' failed.
Aborted

Linux 2.6.30.9-96.fc11.x86_64 #1 SMP x86_64 GNU/Linux

--
components: Library (Lib)
messages: 95482
nosy: rybesh
severity: normal
status: open
title: cPickle crash on failed assertion
type: crash
versions: Python 2.6

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



[issue1859] textwrap doesn't linebreak on \n

2009-11-19 Thread Guido van Rossum

Guido van Rossum gu...@python.org added the comment:

I think the code originally wasn't meant to support this feature (honor 
embedded newlines when replace_whitespace=False). I'm thinking that we 
could add it though.  Maybe Mark is interested in getting this into 2.7 
and 3.2?  I imagine it needs a new unittest too.

--
resolution: rejected - 
status: closed - open

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



[issue7358] cPickle crash on failed assertion

2009-11-19 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

What are the types and values of cluster and r?

Can you reproduce this in a self-contained script?

--
nosy: +eric.smith

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



[issue7351] Documentation typos found in zipfile — Work with ZIP archives

2009-11-19 Thread Retro

Retro vinet...@gmail.com added the comment:

I am merely speaking of renaming the class name from BadZipfile to
BadZipFile. 

class BadZipFile(exceptions.Exception):
# etc.


Only the name is fixed at class definition. I am aiming for that in this
bug report. And then every other BadZipfile should be fixed to
BadZipFile. Is that doable?

--

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



[issue7359] mailbox cannot modify mailboxes in system mail spool

2009-11-19 Thread Matthias Klose

New submission from Matthias Klose d...@debian.org:

no change in behaviour in 2.6

the mailbox module in python 2.5 cannot modify mboxes in read-only
directories, e.g. the system mail spool.  This is because
mailbox._singlefileMailbox.flush() tries to write the modified mailbox
to a temporary file and then rename it.  See: 

penelope[tmp]$ python2.5
Python 2.5 (release25-maint, Dec  9 2006, 14:35:53) 
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-20)] on linux2
Type help, copyright, credits or license for more information.
 import mailbox
 mbox = mailbox.mbox(/var/mail/nikolaus)
 mbox.clear()
 mbox.close()
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python2.5/mailbox.py, line 623, in close
self.flush()
  File /usr/lib/python2.5/mailbox.py, line 570, in flush
new_file = _create_temporary(self._path)
  File /usr/lib/python2.5/mailbox.py, line 1885, in _create_temporary
os.getpid()))
  File /usr/lib/python2.5/mailbox.py, line 1875, in _create_carefully
fd = os.open(path, os.O_CREAT | os.O_EXCL | os.O_RDWR)
OSError: [Errno 13] Permission denied:
'/tmp/mail/nikolaus.1195061622.penelope.4241'


--
components: Library (Lib)
messages: 95486
nosy: doko
severity: normal
status: open
title: mailbox cannot modify mailboxes in system mail spool
type: feature request

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



[issue7360] [mailbox] race: mbox may lose data with concurrent access

2009-11-19 Thread Matthias Klose

New submission from Matthias Klose d...@debian.org:

[forwarded from http://bugs.debian.org/451733]

the mailbox._singlefileMailbox class is not safe with concurrent access,
because mailbox._singlefileMailbox.flush() replaces the underlying file
with a new copy by constructing a temporary file and then renaming it.
This breaks all other class instances which have this mailbox open.  I'm
attaching a script demonstrating the problem. 

I think it's a bad idea to use rename(2) here; overwriting the file
content would fix the race condition, and #451274 too[1].

--
components: Library (Lib)
messages: 95487
nosy: doko
severity: normal
status: open
title: [mailbox] race: mbox may lose data with concurrent access
versions: Python 2.6

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



[issue7360] [mailbox] race: mbox may lose data with concurrent access

2009-11-19 Thread Matthias Klose

Changes by Matthias Klose d...@debian.org:


Added file: http://bugs.python.org/file15364/mailbox-race.py

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



[issue7351] Documentation typos found in zipfile — Work with ZIP archives

2009-11-19 Thread Ezio Melotti

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

It might be doable for Python and its stdlib, but all the programs and
modules that are using the old name will start raising errors if they
don't find the old name anymore.
If the old name is deprecated for at least one Python version (e.g.
2.7/3.2), these programs can fix it and then, after a few versions (e.g.
3.3), the old name can finally be removed.
There is still the pickle issue, even if IMHO it's so unlikely that it
shouldn't be relevant.

--

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



[issue7357] tarfile doesn't detect disk full error on extraction

2009-11-19 Thread Lars Gustäbel

Lars Gustäbel l...@gustaebel.de added the comment:

The TarFile constructor (as well as tarfile.open) takes an errorlevel
keyword argument. See
http://docs.python.org/dev/library/tarfile.html#tarfile-objects

I quote: If errorlevel is 0, all errors are ignored when using
TarFile.extract(). Nevertheless, they appear as error messages in the
debug output, when debugging is enabled. If 1, all fatal errors are
raised as OSError or IOError exceptions. If 2, all non-fatal errors are
raised as TarError exceptions as well.

Hope that helps.

--
assignee:  - lars.gustaebel
nosy: +lars.gustaebel

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



[issue5827] os.path.normpath doesn't preserve unicode

2009-11-19 Thread Ezio Melotti

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

assertTrue() also accepts a 'msg' argument where to explain what went
wrong in case of failure [1].

[1]:
http://docs.python.org/library/unittest.html#unittest.TestCase.assertTrue

--

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



[issue7360] [mailbox] race: mbox may lose data with concurrent access

2009-11-19 Thread Antoine Pitrou

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

 the mailbox._singlefileMailbox class is not safe with concurrent access,
 because mailbox._singlefileMailbox.flush() replaces the underlying file
 with a new copy by constructing a temporary file and then renaming it.
 This breaks all other class instances which have this mailbox open.

I don't think this class aims at being safe against concurrent access,
so having it fail loudly is a good thing.
Besides, the proposed cure (overwriting instead of renaming) looks worse
than the illness. The virtue of renaming is that it is atomic (on POSIX
systems at least), so you can't end up with a half-written mailbox if
there's a crash or an IO problem in the middle.

--
nosy: +pitrou

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



[issue3783] dbm.sqlite proof of concept

2009-11-19 Thread Runar Tenfjord

Runar Tenfjord runar.tenfj...@gmail.com added the comment:

By utilizing triggers on inserts and deletes it is possible to
keep track of the size and speed up __len__ by 10 x.

SQL:

CREATE TABLE IF NOT EXISTS info
   (key TEXT UNIQUE NOT NULL,
value INTEGER NOT NULL);

INSERT OR IGNORE INTO info (key,value) VALUES ('size',0);

CREATE TABLE IF NOT EXISTS shelf
(key TEXT UNIQUE NOT NULL,
 value TEXT NOT NULL);

CREATE TRIGGER IF NOT EXISTS insert_shelf
AFTER INSERT ON shelf
BEGIN
 UPDATE info SET value = value + 1 WHERE key = 'size';
END;

CREATE TRIGGER IF NOT EXISTS delete_shelf
AFTER DELETE ON shelf
BEGIN
 UPDATE info SET value = value - 1 WHERE key = 'size';
END;

On my laptop this increase the speed of 'len' about 10x

I have a slightly modified version of dbsqlite.py for
running on python 2.5 utilizing the triggers for 
keep track of the size:

http://dpaste.com/hold/122439/

--
nosy: +rute

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



[issue3783] dbm.sqlite proof of concept

2009-11-19 Thread Antoine Pitrou

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


--
stage:  - needs patch
versions: +Python 3.2 -Python 3.1

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



[issue5827] os.path.normpath doesn't preserve unicode

2009-11-19 Thread Erik Carstensen

Erik Carstensen sandb...@virtutech.com added the comment:

Also, assertTrue has an alias failUnless which I personally find more
descriptive (I don't know if either form is preferred for inclusion in
Python though).

--

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



[issue7360] [mailbox] race: mbox may lose data with concurrent access

2009-11-19 Thread Antoine Pitrou

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

Oops, sorry:
 I don't think this class aims at being safe against concurrent access,
 so having it fail loudly is a good thing.

I now understand that the problem is that it doesn't fail loudly. That's
what I get for replying too quickly.
Still, I don't think the suggested fix is ok. Perhaps we should simply
state in the documentation that flush() discards the old file, so that
other processes accessing it may get a surprise.

--

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



[issue5827] os.path.normpath doesn't preserve unicode

2009-11-19 Thread Ezio Melotti

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

failUnless is deprecated in Python3.1 [1]. The assert* methods are
preferred over the fail* ones that are now deprecated.

[1]:
http://docs.python.org/3.1/library/unittest.html#unittest.TestCase.failUnless

--

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



[issue7360] [mailbox] race: mbox may lose data with concurrent access

2009-11-19 Thread Antoine Pitrou

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

Actually, the doc is quite clear about it:

« Be very cautious when modifying mailboxes that might be simultaneously
changed by some other process. The safest mailbox format to use for such
tasks is Maildir; try to avoid using single-file formats such as mbox
for concurrent writing. »

--

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



[issue5080] PyArg_Parse* should raise TypeError for float parsed with integer format

2009-11-19 Thread Antoine Pitrou

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

+1 for a TypeError too.

--
nosy: +pitrou
priority:  - normal
stage:  - needs patch

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



[issue5080] PyArg_Parse* should raise TypeError for float parsed with integer format

2009-11-19 Thread Ezio Melotti

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


--
nosy: +ezio.melotti

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



[issue7085] strptime problem

2009-11-19 Thread Ronald Oussoren

Ronald Oussoren ronaldousso...@mac.com added the comment:

I committed a fix in r76403 (trunk), r76404 (2.6), r76405 (3.2), 76406 
(3.1)

--
resolution:  - fixed
status: open - closed

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



[issue7144] imp.load_module in thread causes core dump on OSX 10.6

2009-11-19 Thread Ronald Oussoren

Ronald Oussoren ronaldousso...@mac.com added the comment:

I've just committed a fix for this issue in all 4 active branches (2.6, 
2.7, 3.1 and 3.2)

--
resolution:  - fixed
status: open - closed

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



[issue7356] parsing of ldconfig output in ctypes/utils.py depends on the locale

2009-11-19 Thread Thomas Heller

Thomas Heller thel...@ctypes.org added the comment:

I'm curious:  Which output do you get from:
  'LANG=C /sbin/ldconfig -p | fgrep GL'

--

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



[issue7180] pydoc -k can generate AttributeError on Mac OS X

2009-11-19 Thread Ronald Oussoren

Ronald Oussoren ronaldousso...@mac.com added the comment:

The problem occurs in two occassions:

1) python was configured/built without the Carbon bindings (such
  as the copy that Apple ships)

2) python was build in 64-bit mode

In both cases Carbon.File does not have an FSSpec type.

Luckily this has already been fixed (r74681 in the 2.6 branch, and an 
earlier revision on the trunk).  The fix is in 2.6.4.

--
resolution:  - accepted
status: open - closed

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



[issue7358] cPickle crash on failed assertion

2009-11-19 Thread Ryan Shaw

Ryan Shaw ryan.s...@stanfordalumni.org added the comment:

r is the Redis python client. cluster is a large cluster tree along the 
lines of the cluster_node class found here: 
http://jesolem.blogspot.com/2009/04/hierarchical-clustering-in-python.html

--

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



[issue7179] Unportable test(1) construct

2009-11-19 Thread Ronald Oussoren

Ronald Oussoren ronaldousso...@mac.com added the comment:

Fixed the postflight issue in r76407 (trunk), r76408 (2.6), r76409 (3.2) 
and r76410 (3.1).

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

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



[issue7358] cPickle crash on failed assertion

2009-11-19 Thread Ryan Shaw

Ryan Shaw ryan.s...@stanfordalumni.org added the comment:

I can't reproduce this in a self-contained script. Pickling a smaller 
cluster object and storing it in Redis works fine. The cluster object that 
caused the crash was large, a binary tree with 5000 leaves holding the 
results of a nine-hour calculation.

--

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



[issue7351] Documentation typos found in zipfile — Work with ZIP archives

2009-11-19 Thread Retro

Retro vinet...@gmail.com added the comment:

I made a patch which fixes the BadZipfile issue. Please take a look and
decide whether you'll toss it or use it. Maybe it'll come handy some
other time in the future.

--
keywords: +patch
Added file: http://bugs.python.org/file15365/zipfile-patch.diff

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



[issue7356] parsing of ldconfig output in ctypes/utils.py depends on the locale

2009-11-19 Thread Matthias Klose

Matthias Klose d...@debian.org added the comment:

$ LANG=C /sbin/ldconfig -p | fgrep GL
libGLU.so.1 (libc6) = /usr/lib/libGLU.so.1
libGLEW.so.1.5 (libc6) = /usr/lib/libGLEW.so.1.5
libGL.so.1 (libc6, OS ABI: Linux 2.4.20) = /usr/lib/libGL.so.1

--

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



[issue7117] Backport py3k float repr to trunk

2009-11-19 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Short float repr is now enabled in r76379.

Misc/NEWS entries added/updated in r76411.

--

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



[issue7355] Struct incorrectly compiles format strings

2009-11-19 Thread Steve Krenzel

Steve Krenzel sgk...@gmail.com added the comment:

Just for clarification, why does ci get padded but ic doesn't? 
While I agree that updating the documentation would help clarify, 
perhaps either everything should be padded to word boundaries or 
nothing should.

It is weird behavior that ic != ci. If both formats were 8 bytes 
then my first thought would have been Oh, it's just getting padded, 
but with this inconsistency it appeared as a bug.

Whatever the reason behind this discrepancy is, it should definitely be 
included in the doc updates.

--

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



[issue7355] Struct incorrectly compiles format strings

2009-11-19 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

It's basically because nothing comes after it. If you put something
after it, such as a zero length integer, you'll see:

 from struct import calcsize
 calcsize(ci)
8
 calcsize(ic)
5
 calcsize(ic0i)
8

--

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



[issue7355] Struct incorrectly compiles format strings

2009-11-19 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

 Just for clarification, why does ci get padded but ic doesn't?

Because no padding is necessary in the second case:  both the integer and 
the character already start at a position that's a multiple of 4---the 
integer at position 0 and the character at position 4.

In the first case, without padding, the integer wouldn't start at a word 
boundary.

The aim is to make sure that the byte sequence output by struct.pack 
matches the layout of a corresponding C struct.  In the first case inter-
item padding is necessary to make that work, in the second it isn't.

You could argue that in the second case, Python should add trailing 
padding, but I'm not sure what the point would be.

--

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



[issue7361] Strange importlib error during test_multiprocessing failure

2009-11-19 Thread R. David Murray

New submission from R. David Murray rdmur...@bitdance.com:

One of the buildbots suffered a test_multiprocessing failure, which
itself is not such an unusual thing.  But the error that was
subsequently thrown looks like it might point to a place where
importlib's error handling could be improved.  The error that was thrown
certainly gives no clear indication of what really caused the problem.

The full buildbot report was:
http://www.python.org/dev/buildbot/all/builders/ia64%20Ubuntu%203.1/builds/93/steps/test/logs/stdio

Here are the tracebacks (the second one being the interesting one):

Traceback (most recent call last):
  File
/home/pybot/buildarea/3.1.klose-debian-ia64/build/Lib/multiprocessing/process.py,
line 233, in _bootstrap
self.run()
  File
/home/pybot/buildarea/3.1.klose-debian-ia64/build/Lib/multiprocessing/process.py,
line 88, in run
self._target(*self._args, **self._kwargs)
  File
/home/pybot/buildarea/3.1.klose-debian-ia64/build/Lib/test/test_multiprocessing.py,
line 1211, in _putter
queue = manager.get_queue()
  File
/home/pybot/buildarea/3.1.klose-debian-ia64/build/Lib/multiprocessing/managers.py,
line 644, in temp
token, exp = self._create(typeid, *args, **kwds)
  File
/home/pybot/buildarea/3.1.klose-debian-ia64/build/Lib/multiprocessing/managers.py,
line 544, in _create
id, exposed = dispatch(conn, None, 'create', (typeid,)+args, kwds)
  File
/home/pybot/buildarea/3.1.klose-debian-ia64/build/Lib/multiprocessing/managers.py,
line 79, in dispatch
kind, result = c.recv()
  File
/home/pybot/buildarea/3.1.klose-debian-ia64/build/Lib/multiprocessing/connection.py,
line 408, in recv
s = self._conn.recv_bytes()
IOError: [Errno 104] Connection reset by peer
test test_multiprocessing failed -- Traceback (most recent call last):
  File
/home/pybot/buildarea/3.1.klose-debian-ia64/build/Lib/test/test_multiprocessing.py,
line 1222, in test_rapid_restart
queue = manager.get_queue()
  File
/home/pybot/buildarea/3.1.klose-debian-ia64/build/Lib/multiprocessing/managers.py,
line 644, in temp
token, exp = self._create(typeid, *args, **kwds)
  File
/home/pybot/buildarea/3.1.klose-debian-ia64/build/Lib/multiprocessing/managers.py,
line 542, in _create
conn = self._Client(self._address, authkey=self._authkey)
  File
/home/pybot/buildarea/3.1.klose-debian-ia64/build/Lib/multiprocessing/connection.py,
line 427, in XmlClient
import xmlrpc.client as xmlrpclib
  File
/home/pybot/buildarea/3.1.klose-debian-ia64/build/Lib/importlib/_bootstrap.py,
line 151, in decorated
return fxn(self, module)
  File
/home/pybot/buildarea/3.1.klose-debian-ia64/build/Lib/importlib/_bootstrap.py,
line 399, in load_module
return self._load_module(module)
  File
/home/pybot/buildarea/3.1.klose-debian-ia64/build/Lib/importlib/_bootstrap.py,
line 324, in _load_module
code_object = self.get_code(module.__name__)
  File
/home/pybot/buildarea/3.1.klose-debian-ia64/build/Lib/importlib/_bootstrap.py,
line 411, in get_code
pyc_timestamp = marshal._r_long(data[4:8])
  File
/home/pybot/buildarea/3.1.klose-debian-ia64/build/Lib/importlib/__init__.py,
line 65, in _r_long
x = int_bytes[0]
IndexError: index out of range

--
components: Library (Lib)
messages: 95511
nosy: brett.cannon, jnoller, r.david.murray
priority: low
severity: normal
stage: test needed
status: open
title: Strange importlib error during test_multiprocessing failure
type: behavior
versions: Python 3.1

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



[issue7355] Struct incorrectly compiles format strings

2009-11-19 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

I'm half-convinced that struct.pack *should* ideally add trailing padding 
in the same situation that C does, for consistency with C.  Then calcsize 
would match C's sizeof.  If you're writing or reading a struct from C, 
it's probably easiest/most natural to write or read sizeof(my_struct) 
bytes, rather than worrying about stripping trailing padding for 
efficiency.

I don't see a sensible way to make this change without breaking backwards 
compatibility, though.

(Note: this still wouldn't mean that the calcsize result would be 
independent of order: calcsize('cci') and calcsize('cic') would still be 
different, for example, on a typical platform.)  

Eric's solution of adding '0i' should be included in the documentation 
update.

--

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



[issue7356] parsing of ldconfig output in ctypes/utils.py depends on the locale

2009-11-19 Thread Thomas Heller

Thomas Heller thel...@ctypes.org added the comment:

I assume the patch is fine, would you like to apply it?  Thanks.

--

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



[issue444582] Finding programs in PATH, addition to os

2009-11-19 Thread Andy Buckley

Changes by Andy Buckley a...@insectnation.org:


--
nosy: +andybuckley

___
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



[issue7362] Incorrect error message with def((x)=0)

2009-11-19 Thread James Lingard

New submission from James Lingard j...@aristanetworks.com:

def f((x)=0): pass

gives the following incorrect error message:

  SyntaxError: non-default argument follows default argument

def f((x)): pass is treated exactly the same as def f(x): pass, so
it would seem sensible for the same to be true if a default value is
used.  But if this syntax is disallowed for some reason, the error
message should be fixed.

This appears to be related to bug #1557232.

[Tested on Python 2.6 (r26:66714, Jun  8 2009, 16:07:29).]

--
components: Interpreter Core
messages: 95514
nosy: james.lingard
severity: normal
status: open
title: Incorrect error message with def((x)=0)
type: behavior
versions: Python 2.6

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



[issue7362] Incorrect error message with def((x)=0)

2009-11-19 Thread Benjamin Peterson

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

Fixed in r76416.

--
nosy: +benjamin.peterson
resolution:  - fixed
status: open - closed

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



[issue7353] cporting docs recommend using Include/intobject.h, which was removed in 3.1?

2009-11-19 Thread Benjamin Peterson

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

Hmm, I wish intobject.h hadn't been removed so soon. I'm not really sure
how a file of #defines could suffer bitrot. This point is probably moot,
though because there's little point in having its presence skip a
version. I suppose sticking it in Tools or even Doc/includes is the
second best option.

--

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



[issue7363] Inconsisten Indentation In SocketServer Docs

2009-11-19 Thread Yuv Gre

New submission from Yuv Gre ubershme...@gmail.com:

A bit nitpicky but there are 3 spaces instead of 4 in the docs. This is 
relevant to py3k and trunk.

http://docs.python.org/library/socketserver.html#socketserver-udpserver-
example

--
assignee: georg.brandl
components: Documentation
files: 3-spaces-udp-server.patch
keywords: patch
messages: 95517
nosy: georg.brandl, ubershmekel
severity: normal
status: open
title: Inconsisten Indentation In SocketServer Docs
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file15366/3-spaces-udp-server.patch

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



[issue7364] Traceback contains incorrect line number for duplicate argument in lambda definition

2009-11-19 Thread James Lingard

New submission from James Lingard j...@aristanetworks.com:

The following python file:

  lambda a, a: 0

when executed gives the following backtrace:

File /tmp/test.py, line 0
  SyntaxError: duplicate argument 'a' in function definition

Note that the line number is 0, not 1.  (It's always 0, regardless of
the position in the file).

---

Note that this doesn't happen for other similar errors in lambda
functions, for example the file:

  lambda a=0, a: 0

leads to the following error message:

File /tmp/test.py, line 1
  lambda a=0, a: 0
  SyntaxError: non-default argument follows default argument

and it also doesn't happen for the same error in a 'def':

  def f(a, a): pass

leads to the following error message:

File /tmp/test.py, line 1
  def f(a, a): pass
  SyntaxError: duplicate argument 'a' in function definition

---

Tested on Python 2.6 (r26:66714, Jun  8 2009, 16:07:29).

--
components: Interpreter Core
messages: 95518
nosy: james.lingard
severity: normal
status: open
title: Traceback contains incorrect line number for duplicate argument in 
lambda definition
type: behavior
versions: Python 2.6

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



[issue7364] Traceback contains incorrect line number for duplicate argument in lambda definition

2009-11-19 Thread Benjamin Peterson

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

Fixed in r76423.

--
nosy: +benjamin.peterson
resolution:  - fixed
status: open - closed

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



[issue7365] grp and pwd should treat uid and gid as unsigned

2009-11-19 Thread Ed Plese

New submission from Ed Plese e...@edplese.com:

Both Linux and Solaris define uid_t and gid_t as unsigned integers.  The
pwd and grp modules cast these to signed long values that are then
converted with PyInt_FromLong.  For large values, greater than 2 ** 32 -
1, the result is correct when Python is compiled as a 64-bit executable,
but is incorrect when compiled as a 32-bit executable.

Similar bugs have been noted in the posix module as reported in #4591.

For example, on OpenSolaris build 127, the 32-bit version of Python
returns a negative uid: pw_uid=-2147483647:

$ file /usr/bin/python2.6
/usr/bin/python2.6: ELF 32-bit LSB executable 80386 Version 1 [FPU],
dynamically linked, not stripped, no debugging information available

$ /usr/bin/python2.6
Python 2.6.2 (r262, Oct 26 2009, 01:06:14) [C] on sunos5
Type help, copyright, credits or license for more information.
 import pwd
 pwd.getpwnam('t...@foo.com')
pwd.struct_passwd(pw_name='t...@foo.com', pw_passwd='x',
pw_uid=-2147483647, pw_gid=1, pw_gecos='Test User', pw_dir='',
pw_shell='')

$ file /usr/bin/amd64/python2.6
/usr/bin/amd64/python2.6:   ELF 64-bit LSB executable AMD64 Version
1 [SSE FXSR FPU], dynamically linked, not stripped, no debugging
information available

$ /usr/bin/amd64/python2.6
Python 2.6.2 (r262, Oct 26 2009, 01:09:04) [C] on sunos5
Type help, copyright, credits or license for more information.
 import pwd
 pwd.getpwnam('t...@foo.com')
pwd.struct_passwd(pw_name='t...@foo.com', pw_passwd='x',
pw_uid=2147483649, pw_gid=1, pw_gecos='Test User', pw_dir='',
pw_shell='')

The attached patch against 2.6.4 changes PyInt_FromLong to
PyLong_FromUnsignedLong and changes casts to unsigned long.

--
components: Extension Modules
files: pwd-grp-unsigned-uid.patch
keywords: patch
messages: 95520
nosy: eplese
severity: normal
status: open
title: grp and pwd should treat uid and gid as unsigned
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file15367/pwd-grp-unsigned-uid.patch

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



[issue5683] Speed up cPickle's pickling generally

2009-11-19 Thread Antoine Pitrou

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

Are you still willing to work on this?

--
versions: +Python 3.2 -Python 3.1

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



[issue7359] mailbox cannot modify mailboxes in system mail spool

2009-11-19 Thread Antoine Pitrou

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

The same remark as in issue7360, that is it is not robust at all to
overwrite the file rather than doing an atomic rename from a temporary
file. The only possible exception would be if you only /append/ to the
mbox file (and that's assuming all mailbox-reading software you use be
able to deal with a partially written message at the end of an mbox file).

--
nosy: +akuchling, pitrou
priority:  - normal
versions: +Python 2.7, Python 3.2

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



[issue7360] [mailbox] race: mbox may lose data with concurrent access

2009-11-19 Thread Antoine Pitrou

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


--
nosy: +akuchling

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



[issue6594] json C serializer performance tied to structure depth on some systems

2009-11-19 Thread Valentin Kuznetsov

Valentin Kuznetsov vkuz...@gmail.com added the comment:

Hi,
I just found this bug and would like to add my experience with 
performance of large JSON docs. I have a few JSON docs about 180MB in 
size which I read from data-services. I use python2.6, run on Linux, 64-
bit node w/ 16GB of RAM and 8 core CPU, Intel Xeon 2.33GHz each. I used 
both json and cjson modules to parse my documents. My observation that 
the amount of RAM used to parse such docs is about 2GB, which is a way 
too much. The total time spent about 30 seconds (using cjson). The 
content of my docs are very mixed, lists, strings, other dicts. I can 
provide them if it will be required, but it's 200MB :)

For comparison, I got the same data in XML and using 
cElementTree.iterparse I stay w/ 300MB RAM usage per doc, which is 
really reasonable to me.

I can provide some benchmarks and perform such tests if it will be 
required.

--
nosy: +vkuznet

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



[issue6594] json C serializer performance tied to structure depth on some systems

2009-11-19 Thread Bob Ippolito

Bob Ippolito b...@redivi.com added the comment:

Did you try the trunk of simplejson? It doesn't work quite the same way as 
the current json module in Python 2.6+.

Without the data or a tool to produce data that causes the problem, there 
isn't much I can do to help.

--

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



[issue7361] Strange importlib error during test_multiprocessing failure

2009-11-19 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

I will obviously have a look, but why the heck is test_multiprocessing 
calling importlib? Is it meant to do that? Or is this part of the -j flag 
for regrtest?

--
assignee:  - brett.cannon

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



[issue444582] Finding programs in PATH, addition to os

2009-11-19 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
nosy:  -brett.cannon

___
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



[issue7361] Strange importlib error during test_multiprocessing failure

2009-11-19 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

And it looks like the error was triggered from a malformed .pyc file that 
was truncated. Guess I need to be more careful with that possibility. =)

--

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



[issue7311] Bug on regexp of HTMLParser

2009-11-19 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

Re: the BTW --  and  should be entity-escaped when used in attribute
values inside tag attributes... (but are probably seldom found as part
of tag attribute values)

But the example you showed is not an attribute in a tag, but rather text
within a paired tag.

But your suggestion for the regexp seems correct to me, if the non-ASCII
characters are permitted for non-quoted attribute values.

--
nosy: +v+python

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



[issue7361] Strange importlib error during test_multiprocessing failure

2009-11-19 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

This was on a buildbot, and regrtest -j isn't used there, but in any
case it wouldn't affect importlib as far as I know.  From the traceback
it looks like multiprocessing is just doing an import.

--

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



  1   2   >