[ANN] bzr 2.4.1 released

2011-09-13 Thread Vincent Ladeuil
Hi all,

Here comes our new stable release: 2.4.1

Bazaar http://bazaar.canonical.com/ is part of the GNU project
http://gnu.org/ to produce a free operating system.

After the slight delay for the 2.4.0 release, we're back on our regular
release schedule.

This is a bugfix release. Upgrading is recommended for all users on
earlier 2.4 releases.

2.4.1 contains all known bug fixes for all stable releases (including
the ones we made for the previous stable series).

Thanks to all participants, whether you sent merge proposals, comments,
suggestions and feedback, we very much appreciate all of them.

Bazaar is now available for download from
https://launchpad.net/bzr/2.4/2.4b4/ as a source tarball.

Installers are available for windows from the url above, OSX ones are on
their way.

2.4.1 has also been uploaded to debian and ubuntu.

The detailed changelog is available below,

Vincent


Bug Fixes
*

* ``config.LocationMatcher`` properly excludes unrelated sections.
  (Vincent Ladeuil, #829237)

* ``dirstate.fdatasync`` and ``repository.fdatasync`` can now properly be
  disabled. (Vincent Ladeuil, #824513)

* Disable ``os.fsync`` and ``os.fdatasync`` by default when running
  ``bzr selftest``. You can use ``--sync`` to re-enable them.
  (John Arbash Meinel, #837293)

* Fix i18n use when no environment variables are set. (Jelmer Vernooij, #810701)

* Avoid UnicodeDecode error when reporting EINVAL from transports.
  (IWATA Hidetaka, #829237)

Documentation
*

* Corrected documentation for BZR_PROGRESS_BAR.
  (Dennis Benzinger, #735417)

Testing
***

* The test suite should now be able to run under weird environments where
  ``/etc/passwd`` doesn't contain the ``uid`` for the user running selftest
  or where ``fakeroot`` is used but ``/root`` is inacessible.
  (Vincent Ladeuil, #825027)
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

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


Re: using python in web applications

2011-09-13 Thread alex23
On Sep 10, 1:54 pm, Littlefield, Tyler ty...@tysdomain.com wrote:
 I'm not feeling particularly masochistic, so I do not want to develop
 this project in PHP; essentially I'm looking to build a web-based MMO.

Google have been promoting the use of appengine along with HTML5  JS
to produce games. One advantage of using GAE to host the server is it
takes care of the scaling for you.

I found these presentations fascinating:
http://cc-2011-html5-games.appspot.com/#1
http://io-2011-html5-games-hr.appspot.com/#1

This article covers the process in a little more depth:
http://clouddbs.blogspot.com/2011/02/how-to-write-html5-game-in-30-days-with.html

Google are also aggregating platform-specific info here:
http://code.google.com/games

Hope this helps (and let us know when you have something to show off!)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Easiest framework to develop simple interactive web site in python?

2011-09-13 Thread John Reid

On 12/09/11 19:37, Stefaan Himpe wrote:

The simplest one to learn is web2py http://www.web2py.com
No configuration needed, just unpack and get started.
It also has very good documentation and tons of little examples to get
things done.

The other options you mentioned are good too :)



OK I've had a look at bottle, cherrypy and web2py and they look fairly 
straightforward. I'll check out some more and see where I get to. Thanks 
for the tips,

John.

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


Re: Easiest framework to develop simple interactive web site in python?

2011-09-13 Thread limodou
On Tue, Sep 13, 2011 at 3:30 PM, John Reid j.r...@mail.cryst.bbk.ac.uk wrote:
 On 12/09/11 19:37, Stefaan Himpe wrote:

 The simplest one to learn is web2py http://www.web2py.com
 No configuration needed, just unpack and get started.
 It also has very good documentation and tons of little examples to get
 things done.

 The other options you mentioned are good too :)


 OK I've had a look at bottle, cherrypy and web2py and they look fairly
 straightforward. I'll check out some more and see where I get to. Thanks for
 the tips,
 John.


maybe you can also try out uliweb.

-- 
I like python!
UliPad The Python Editor: http://code.google.com/p/ulipad/
UliWeb simple web framework: http://code.google.com/p/uliweb/
My Blog: http://hi.baidu.com/limodou
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How do I automate the removal of all non-ascii characters from my code?

2011-09-13 Thread jmfauth
On 12 sep, 23:39, Rhodri James rho...@wildebst.demon.co.uk wrote:


 Now read what Steven wrote again.  The issue is that the program contains  
 characters that are syntactically illegal.  The engine can be perfectly  
 correctly translating a character as a smart quote or a non breaking space  
 or an e-umlaut or whatever, but that doesn't make the character legal!


Yes, you are right. I did not understand in that way.

However, a small correction/precision. Illegal character
do not exit. One can only have an ill-formed encoded code
points or an illegal encoded code point representing a
character/glyph.

Basically, in the present case. The issue is most probably
a mismatch between the coding directive and the real
coding, with no coding directive == 'ascii'.


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


Re: How do I automate the removal of all non-ascii characters from my code?

2011-09-13 Thread Steven D'Aprano
On Tue, 13 Sep 2011 05:49 pm jmfauth wrote:

 On 12 sep, 23:39, Rhodri James rho...@wildebst.demon.co.uk wrote:
 
 
 Now read what Steven wrote again.  The issue is that the program contains
 characters that are syntactically illegal.  The engine can be perfectly
 correctly translating a character as a smart quote or a non breaking
 space or an e-umlaut or whatever, but that doesn't make the character
 legal!

 
 Yes, you are right. I did not understand in that way.
 
 However, a small correction/precision. Illegal character
 do not exit. One can only have an ill-formed encoded code
 points or an illegal encoded code point representing a
 character/glyph.

You are wrong there. There are many ASCII characters which are illegal in
Python source code, at least outside of comments and string literals, and
possibly even there.

 code = x = 1 + \b 2  # all ASCII characters
 print(code)
x = 1 + 2
 exec(code)
Traceback (most recent call last):
  File stdin, line 1, in module
  File string, line 1
x = 1 + 2
^
SyntaxError: invalid syntax


Now, imagine that somehow a \b ASCII backspace character somehow gets
introduced into your source file. When you go to run the file, or import
it, you will get a SyntaxError. Changing the encoding will not help.



-- 
Steven

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


Michael Jordan 23.

2011-09-13 Thread fashion t shirts seller
In addition to the expression of this athletes foot propulsion
technology that they run very fast from the other major areas,
including Air Jordan 2009, satin sheets and the rear panel of nba
basketball shoes, said middle layer blown-glass is a unique movement
in each shoes. The silk is inspired by the belief that People Michael
Jordan in basketball is very similar to the art of personal
http://www.cheap-nbabasketballshoes.com/defense to defend themselves
in a sport of fencing. Sheets are used to remind the importance of the
defensive players wore light clothing fencers irony. Hologram of a
diamond shape to be included in the ankle support and insurance,
leather, also used in the nba players 
http://www.cheap-nbabasketballshoes.com/shoes,
so that it is not only a function of the courts, but Ye Hao looked at
the court. Jordan brand sports shoes, which add an additional buffer
to keep athletes safe and comfortable ankle. In order to fully
understand this work into the design of 
http://www.cheap-nbabasketballshoes.com/sports
shoes, a person must do a careful observation and analysis of every
part of the shoes. For example, the end including the full range of
models, which helps to increase the grip, the needle in the upper two
rows and deliberately sewn three rows below it in order to reflect the
famous Michael Jordan 23. http://www.cheap-nbabasketballshoes.com/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How do I automate the removal of all non-ascii characters from my code?

2011-09-13 Thread jmfauth
On 13 sep, 10:15, Steven D'Aprano steve
+comp.lang.pyt...@pearwood.info wrote:

The intrinsic coding of the characters is one thing,
The usage of bytes stream supposed to represent a text
is one another thing,

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


Re: Should a beginner do some coding excises? How can I find the sources?

2011-09-13 Thread sillyou su
On Sep 13, 1:14 pm, memilanuk memila...@gmail.com wrote:
 On 09/12/2011 09:20 PM, sillyou su wrote:

  I'm reading Learning Python( Chinese version). Before I go through
  the whole book, I want to do some excises matching each charter.
  Any tips? Any better advice?

 For the code examples, have you tried looking up the home page for the
 book?  Google for 'oreilly learning python' and find the correct edition
 that you have.

 If its the 4th ed (current), you should end up on a page like this:

 http://shop.oreilly.com/product/9780596158071.do

 Down in the right hand side-bar, there should be a menu 'Essential
 Links' and one of the options is 'Download code' or something along
 those lines.  The link should take you to a zip file with all the code
 examples in the book.

 As far as practice exercises... maybe something like
 codingbat.com/python would be helpful.  Its not related to the book at
 all, and doesn't go nearly as in depth... but its kind of neat to play
 with and see how your code works when someone else is grading it! (at
 least for me).

 HTH,

 Monte

codingbat.com/python!
The website is really interesting.
Thank you!
-- 
http://mail.python.org/mailman/listinfo/python-list


problem:import csv data

2011-09-13 Thread 守株待兔
import sqlite3 
con = sqlite3.connect('/home/stock.db')
cur = con.cursor()
cur.execute('''CREATE TABLE quote (ticker TEXT,date TEXT, popen TEXT, high 
TEXT, low TEXT,vol TEXT,adjclose TEXT);''')
i=/tmp/data.csv
cur.execute('.separator , ')
cur.execute('.import  %s  quote'  %  i)
con.commit()
cur.close()
con.close()

the output is :
cur.execute('.separator, ')
sqlite3.OperationalError: near .: syntax error

how to fix it?-- 
http://mail.python.org/mailman/listinfo/python-list


send string to input of another process

2011-09-13 Thread Alex Naumov
Hello everybody,

I'm looking for some solution, maybe someone of you can help me.

I call another process via os.system(process) and it waits for some input.
I have to write a comment (for example, like using svn or git), and after
that to close input (for example, like :wq using vim).
How can I give/write this comment and put it in the input for next process
(which start after)?


Thanks a lot for your time and help.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How do I automate the removal of all non-ascii characters from my code?

2011-09-13 Thread ron
On Sep 12, 4:49 am, Steven D'Aprano steve
+comp.lang.pyt...@pearwood.info wrote:
 On Mon, 12 Sep 2011 06:43 pm Stefan Behnel wrote:

  I'm not sure what you are trying to say with the above code, but if it's
  the code that fails for you with the exception you posted, I would guess
  that the problem is in the [more stuff here] part, which likely contains
  a non-ASCII character. Note that you didn't declare the source file
  encoding above. Do as Gary told you.

 Even with a source code encoding, you will probably have problems with
 source files including \xe2 and other bad chars. Unless they happen to
 fall inside a quoted string literal, I would expect to get a SyntaxError.

 I have come across this myself. While I haven't really investigated in great
 detail, it appears to happen when copying and pasting code from a document
 (usually HTML) which uses non-breaking spaces instead of \x20 space
 characters. All it takes is just one to screw things up.

 --
 Steven

Depending on the load, you can do something like:

.join([x for x in string if ord(x)  128])

It's worked great for me in cleaning input on webapps where there's a
lot of copy/paste from varied sources.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: problem:import csv data

2011-09-13 Thread Miki Tebeka
.separator (and .import) are not SQL commands but sqlite3 commands.
You can get the same effect with the following code:

with open('/tmp/data.csv') as fo:
reader = csv.reader(fo)
cur.executemany('INSERT INTO quote VALUES (?, ?, ?, ?, ?, ?, ?)'), 
reader)

HTH
--
Miki Tebeka miki.teb...@gmail.com
http://pythonwise.blogspot.com
-- 
http://mail.python.org/mailman/listinfo/python-list


The Usenet newsgroup news:comp.lang.python ...

2011-09-13 Thread mano mano
Mikael Lyngvig accurately summarizes comp.lang.python discussion of
the technical merits of Tkinter, wxPython, and Python-bound JPI.
Malcolm Tredinnick ...

http://123maza.com/48/doll789/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How do I automate the removal of all non-ascii characters from my code?

2011-09-13 Thread Vlastimil Brom
2011/9/13 ron vacor...@gmail.com:

 Depending on the load, you can do something like:

 .join([x for x in string if ord(x)  128])

 It's worked great for me in cleaning input on webapps where there's a
 lot of copy/paste from varied sources.
 --
 http://mail.python.org/mailman/listinfo/python-list

Well, for this kind of dirty data cleaning you may as well use e.g.

 uäteöxt ÛÜÝ wiÉÊËÌthÞßà áânoûüýþn ASɔɕɖCɗɘəɚɛIɗɘəɚɛIεζ iηθιn 
 жзbetийклweeჟრსn .ტუ..ფ.encode(ascii, ignore).decode(ascii)
u'text  with non ASCII in between ...'


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


Re: PC locks up with list operations

2011-09-13 Thread Carl Banks
On Wednesday, August 31, 2011 5:49:24 AM UTC-7, Benjamin Kaplan wrote:
 32-bit or 64-bit Python? A 32-bit program will crash once memory hits
 2GB. A 64-bit program will just keep consuming RAM until your computer
 starts thrashing. The problem isn't your program using more RAM than
 you have, just more RAM than you have free. Last time I faced a
 situation like this, I just decided it was better to stick to the
 32-bit program and let it crash if it got too big.

On my 64-bit Linux system, I got a memory error in under a second, no thrashing.

I have no swap.  It's overrated.


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


ACCU conference call for proposals

2011-09-13 Thread Jon Jagger

ACCU is a non-profit organisation run by software enthusiasts for
software enthusiasts.

ACCU warmly invites you to propose a session for this leading software
development conference.

Call for Proposals - ACCU 2012
April 24-28, 2012. Barcelo Oxford Hotel, Oxford, UK
Submission website: https://www.conftool.pro/accu2012/
Submission deadline: 16th of October 2011
twitter: @accu2012 #accu2012

More details can be found here
http://accu.org/index.php/conferences/accu_conference_2012/accu2012_Call_for_Papers

The conference has always benefited from the strength of its
programme. Please help us make 2012 another successful event.

Jon Jagger
Conference Chair
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: send string to input of another process

2011-09-13 Thread Kushal Kumaran
On 13 Sep 2011 17:53, Alex Naumov alexander_nau...@opensuse.org wrote:

 Hello everybody,

 I'm looking for some solution, maybe someone of you can help me.

 I call another process via os.system(process) and it waits for some
input. I have to write a comment (for example, like using svn or git), and
after that to close input (for example, like :wq using vim).
 How can I give/write this comment and put it in the input for next process
(which start after)?



Take a look at the subprocess module, especially the communicate method.
Note that you will not be able to script screen-oriented programs like vim
using this, unless it has some mode where you can drive it by piping
commands on stdin.

If you want to provide commit messages, I'm sure your vc system accepts
those on the command line instead.

-- 
regards,
kushal
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How do I automate the removal of all non-ascii characters from my code?

2011-09-13 Thread Alec Taylor
Hmm, nothing mentioned so far works for me...

Here's a very small test case:

 python -u Convert to Creole.py
  File Convert to Creole.py, line 1
SyntaxError: Non-ASCII character '\xe2' in file Convert to Creole.py
on line 1, but no encoding declared; see
http://www.python.org/peps/pep-0263.html for details
 Exit Code: 1

Line 1: a=u'''≤'''.encode(ascii, ignore).decode(ascii)

On Tue, Sep 13, 2011 at 11:33 PM, Vlastimil Brom
vlastimil.b...@gmail.com wrote:
 2011/9/13 ron vacor...@gmail.com:

 Depending on the load, you can do something like:

 .join([x for x in string if ord(x)  128])

 It's worked great for me in cleaning input on webapps where there's a
 lot of copy/paste from varied sources.
 --
 http://mail.python.org/mailman/listinfo/python-list

 Well, for this kind of dirty data cleaning you may as well use e.g.

 uäteöxt ÛÜÝ wiÉÊËÌthÞßà áânoûüýþn ASɔɕɖCɗɘəɚɛIɗɘəɚɛIεζ iηθιn 
 жзbetийклweeჟრსn .ტუ..ფ.encode(ascii, ignore).decode(ascii)
 u'text  with non ASCII in between ...'


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

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


Re: How do I automate the removal of all non-ascii characters from my code?

2011-09-13 Thread Jussi Piitulainen
Alec Taylor writes:

 Hmm, nothing mentioned so far works for me...
 
 Here's a very small test case:
 
  python -u Convert to Creole.py
   File Convert to Creole.py, line 1
 SyntaxError: Non-ASCII character '\xe2' in file Convert to Creole.py
 on line 1, but no encoding declared; see
 http://www.python.org/peps/pep-0263.html for details
  Exit Code: 1
 
 Line 1: a=u'''≤'''.encode(ascii, ignore).decode(ascii)

The people who told you to declare the source code encoding in the
source file would like to see Line 0.

See http://www.python.org/peps/pep-0263.html.

[1001] ruuvi$ cat ctc.py
# coding=utf-8
print u'''x ≤ 1'''.encode(ascii, ignore).decode(ascii)
[1002] ruuvi$ python ctc.py
x  1
[1003] ruuvi$ 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyWart: Itertools module needs attention

2011-09-13 Thread Ian Kelly
On Mon, Sep 12, 2011 at 4:04 PM, rantingrick rantingr...@gmail.com wrote:

 
 #                          Quote                           #
 
 # The itertools module is great HOWEVER i believe most     #
 # people are recreating the functionalities due to the     #
 # insanely cryptic and/or missing examples from each       #
 # method                                                   #
 

Have you looked at the online itertools documentation at all?

http://docs.python.org/library/itertools.html

 py ''.join(list(itertools.dropwhile(lambda x:x== ,     hello
 word    )))
 'hello word    '
 py ''.join(list(itertools.takewhile(lambda x:x== ,     hello
 word    )))
 '    '

These are too complex to be good examples.  Drop the lambda and
replace it with a built-in.  Also, str.join is perfectly capable of
taking an iterator as its argument.  There is no reason at all to
construct a list first.

 py print itertools.compress.__doc__
 compress(data, selectors) -- iterator over selected data
 Return data elements corresponding to true selector elements.
 Forms a shorter iterator from selected data elements using the
 selectors to choose the data elements.

 
 #                          Quote                           #
 
 # WTF! Would you like to define a Python selector. Could #
 # it be that we should be using selector function or     #
 # predicate function instead?                            #
 

Notice that it says selector elements, not selector functions.
You have misconstrued what this function does.  Hint: it does not use
predicates at all.

I can agree though that this could probably use a simple example in
the doc string.
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Invoke a superclass method from a subclass constructor

2011-09-13 Thread Prasad, Ramit
Written by Kayode Odeyemi
Well, I did try using super(), but I got this:
 class B(A):
... def __init__(self, module):
... super(A, self).log('system')
...
 c = B('module')
=
You should be passed super the current class you want the super class of, not 
the type of the super class. So it should be:
super(B, self).log('system') # Notice that it passed class B


Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423





This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Invoke a superclass method from a subclass constructor

2011-09-13 Thread Prasad, Ramit
You should be passed super the current class you want the super class of, not 
the type of the super class. So it should be:
super(B, self).log('system') # Notice that it passed class B

Ugh, apologies for the poor English; my tea has not kicked in.

That first line would be more understandable as:  'You should pass the current 
class (B) you want the super class of, not the type of the super class (A) 
itself. So it should be:'

To clarify, by passing A to super it retrieves the definition for the base 
class (object) which does not have the function you are trying to access.

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  -- 
http://mail.python.org/mailman/listinfo/python-list


Re: Invoke a superclass method from a subclass constructor

2011-09-13 Thread Kayode Odeyemi
On Tue, Sep 13, 2011 at 5:46 PM, Prasad, Ramit ramit.pra...@jpmorgan.comwrote:

 You should be passed super the current class you want the super class of,
 not the type of the super class. So it should be:

 super(*B*, self).log('system') # Notice that it passed class B

 ** **

 Ugh, apologies for the poor English; my tea has not kicked in.

 ** **

 That first line would be more understandable as:  ‘You should pass the
 current class (B) you want the super class of, not the type of the super
 class (A) itself. So it should be:’

 ** **

 To clarify, by passing A to super it retrieves the definition for the base
 class (object) which does not have the function you are trying to access.*
 ***

 ** **

 Ramit


Thanks for helping me clarify on how to use super() in Py2+. That really
worked!

 class B(A):
... def __init__(self, module):
... self.module = A.log(self, module)
... print self.module # printing here is completely unnecessary
in a good OOP language
...
 c = B('system')
logged
 class B(A):
... def __init__(self, module):
... print super(B, self).log('system') # printing here is
completely unnecessary in a good OOP language
...
 c = B('system')
logged


When an instance of a class is created, all codes within that instance block
should be executed. That's my understanding of OOP.

Thanks everyone!


 

 ** **

 ** **

 Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology

 712 Main Street | Houston, TX 77002

 work phone: 713 - 216 - 5423

 

 This email is confidential and subject to important disclaimers and
 conditions including on offers for the purchase or sale of securities,
 accuracy and completeness of information, viruses, confidentiality, legal
 privilege, and legal entity disclaimers, available at
 http://www.jpmorgan.com/pages/disclosures/email.




-- 
Odeyemi 'Kayode O.
http://www.sinati.com. t: @charyorde
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Invoke a superclass method from a subclass constructor

2011-09-13 Thread Ian Kelly
On Tue, Sep 13, 2011 at 10:56 AM, Kayode Odeyemi drey...@gmail.com wrote:
 class B(A):
 ...     def __init__(self, module):
 ...             self.module = A.log(self, module)
 ...             print self.module # printing here is completely unnecessary
 in a good OOP language
 ...
 c = B('system')
 logged
 class B(A):
 ...     def __init__(self, module):
 ...             print super(B, self).log('system') # printing here is
 completely unnecessary in a good OOP language
 ...
 c = B('system')
 logged

 When an instance of a class is created, all codes within that instance block
 should be executed. That's my understanding of OOP.

The initializer should be executed, which is what Python does.  Your
initializer then calls A.log, which does nothing interesting at all.

My question is, what exactly is it that you intend A.log to do?  As
written, it does not do any logging.  It merely constructs a string
and then returns it.  Neither constructing a string, nor returning a
string, imply logging it or printing it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How do I automate the removal of all non-ascii characters from my code?

2011-09-13 Thread Vlastimil Brom
2011/9/13 Alec Taylor alec.tayl...@gmail.com:
 Hmm, nothing mentioned so far works for me...

 Here's a very small test case:

 python -u Convert to Creole.py
  File Convert to Creole.py, line 1
 SyntaxError: Non-ASCII character '\xe2' in file Convert to Creole.py
 on line 1, but no encoding declared; see
 http://www.python.org/peps/pep-0263.html for details
 Exit Code: 1

 Line 1: a=u'''≤'''.encode(ascii, ignore).decode(ascii)

 On Tue, Sep 13, 2011 at 11:33 PM, Vlastimil Brom
 vlastimil.b...@gmail.com wrote:
 2011/9/13 ron vacor...@gmail.com:

 Depending on the load, you can do something like:

 .join([x for x in string if ord(x)  128])

 It's worked great for me in cleaning input on webapps where there's a
 lot of copy/paste from varied sources.
 --
 http://mail.python.org/mailman/listinfo/python-list

 Well, for this kind of dirty data cleaning you may as well use e.g.

 uäteöxt ÛÜÝ wiÉÊËÌthÞßà áânoûüýþn ASɔɕɖCɗɘəɚɛIɗɘəɚɛIεζ iηθιn 
 жзbetийклweeჟრსn .ტუ..ფ.encode(ascii, ignore).decode(ascii)
 u'text  with non ASCII in between ...'


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



Ok, in that case the encoding probably would be utf-8; \xe2 is just
the first part of the encoded data

 u'≤'.encode(utf-8)
'\xe2\x89\xa4'


Setting this encoding at the beginning of the file, as mentioned
before, might solve the problem while retaining the symbol in question
(or you could move from syntax error to some unicode related error
depending on other circumstances...).

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


Re: Invoke a superclass method from a subclass constructor

2011-09-13 Thread Dave Angel

On 01/-10/-28163 02:59 PM, Kayode Odeyemi wrote:


When an instance of a class is created, all codes within that instance block
should be executed. That's my understanding of OOP.

I don't understand this phrasing at all.   Could you show a specific 
example of something that does not execute code you think should be 
executed?  I suspect you're just confused by things the interactive 
session is printing out, which are not part of the language, and work a 
bit differently.


DaveA

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


Re: Invoke a superclass method from a subclass constructor

2011-09-13 Thread Kayode Odeyemi
On Tue, Sep 13, 2011 at 8:31 PM, Dave Angel da...@ieee.org wrote:

 I suspect you're just confused by things the interactive session is
 printing out, which are not part of the language, and work a bit
 differently.


You are right. This is where I missed it. The command interface requires a
print command, as against using a return statement.

My apologies.



-- 
Odeyemi 'Kayode O.
http://www.sinati.com. t: @charyorde
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: unpyc3 - a python bytecode decompiler for Python3

2011-09-13 Thread Arnaud Delobelle
Hi all,

Unpyc3 can recreate Python3 source code from code objects, function
source code from function objects, and module source code from .pyc
files. The current version is able to decompile itself successfully
:). It has been tested with Python3.2 only.

It currently reconstructs most of Python 3 (see TODO below) constructs
but probably needs to be tested more thoroughly. All feedback welcome.

Unpyc3 is a single file and is available at http://code.google.com/p/unpyc3/

Example:

 from unpyc3 import decompile
 def foo(x, y, z=3, *args):
...global g
...for i, j in zip(x, y):
...if z == i + j or args[i] == j:
...g = i, j
...return
...
 print(decompile(foo))
def foo(x, y, z=3, *args):
global g
for i, j in zip(x, y):
if z == i + j or args[i] == j:
g = i, j
return

TODO:

* Support for keyword-only arguments
* Handle assert statements
* Show docstrings for functions and modules
* Nice spacing between function/class declarations

Have fun!

Note: unpyc3 is totally unrelated to another project called unpyc
which I discovered when I tried to register the same project name on
google code.

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


Need some experience

2011-09-13 Thread Tim Hanson
I have been a desktop Linux user for better than eleven years, as a hobby.  
Back when we still did most of our computing on desktops I even set up a 
rudimentary server setup in my home.  Nothing fancy or anything, but I was 
proud of it and of the fact that it was built Microsoft free.  I have no 
formal education in IT nor programming.  Retired now, my career was finance; I 
was an IRS field agent.

Since retiring two years ago, I have renewed my interest in software.  I know 
some C and lately decided to learn Python.  I have worked through a couple of 
the introductory texts and have a feeling for the OOP model, although I won't 
be able to  call myself an experienced practitioner anytime soon.

I am looking for an open source project that will allow me to develop my 
skills further.

Financially, I'm set; I'm not looking for a job.  I'm looking for some drudge 
work, where I can look at other peoples' code and make a contribution.  
Naturally I do not want to do this forever; I'm hoping to get up to speed with 
my skill set so I can work to more complexity later.

Does anyone have some ideas that would help me?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Need some experience

2011-09-13 Thread Thomas Jollans
On 13/09/11 22:25, Tim Hanson wrote:
 I have been a desktop Linux user for better than eleven years, as a hobby.  
 Back when we still did most of our computing on desktops I even set up a 
 rudimentary server setup in my home.  Nothing fancy or anything, but I was 
 proud of it and of the fact that it was built Microsoft free.  I have no 
 formal education in IT nor programming.  Retired now, my career was finance; 
 I 
 was an IRS field agent.
 
 Since retiring two years ago, I have renewed my interest in software.  I know 
 some C and lately decided to learn Python.  I have worked through a couple of 
 the introductory texts and have a feeling for the OOP model, although I won't 
 be able to  call myself an experienced practitioner anytime soon.
 
 I am looking for an open source project that will allow me to develop my 
 skills further.
 
 Financially, I'm set; I'm not looking for a job.  I'm looking for some drudge 
 work, where I can look at other peoples' code and make a contribution.  
 Naturally I do not want to do this forever; I'm hoping to get up to speed 
 with 
 my skill set so I can work to more complexity later.
 
 Does anyone have some ideas that would help me?

This is becoming something of an FAQ - I don't suppose there's a canned
response link somewhere ? ;-)

I like to recommend CPython itself — which is a bit hypocritical, as I
haven't touched it in quite a while. It has a constantly overflowing bug
tracker where I'm sure you can find a lot of fascinating problems that
need solving. The community, I have found, is welcoming and friendly.
Much of the standard library is written in Python, but if you know C,
you can have a go at the C code as well.

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


Re: Need some experience

2011-09-13 Thread Tim Hanson
On Tuesday, September 13, 2011 01:37:05 pm Thomas Jollans wrote:
 On 13/09/11 22:25, Tim Hanson wrote:
  I have been a desktop Linux user for better than eleven years, as a
  hobby. Back when we still did most of our computing on desktops I even
  set up a rudimentary server setup in my home.  Nothing fancy or
  anything, but I was proud of it and of the fact that it was built
  Microsoft free.  I have no formal education in IT nor programming. 
  Retired now, my career was finance; I was an IRS field agent.
  
  Since retiring two years ago, I have renewed my interest in software.  I
  know some C and lately decided to learn Python.  I have worked through a
  couple of the introductory texts and have a feeling for the OOP model,
  although I won't be able to  call myself an experienced practitioner
  anytime soon.
  
  I am looking for an open source project that will allow me to develop my
  skills further.
  
  Financially, I'm set; I'm not looking for a job.  I'm looking for some
  drudge work, where I can look at other peoples' code and make a
  contribution. Naturally I do not want to do this forever; I'm hoping to
  get up to speed with my skill set so I can work to more complexity
  later.
  
  Does anyone have some ideas that would help me?
 
 This is becoming something of an FAQ - I don't suppose there's a canned
 response link somewhere ? ;-)
 
 I like to recommend CPython itself — which is a bit hypocritical, as I
 haven't touched it in quite a while. It has a constantly overflowing bug
 tracker where I'm sure you can find a lot of fascinating problems that
 need solving. The community, I have found, is welcoming and friendly.
 Much of the standard library is written in Python, but if you know C,
 you can have a go at the C code as well.
 
 Thomas

That's not a bad idea.  From the past I know that bug fixing is a great way to 
learn a language.  If you know a specific site to key in on, feel free to send 
me there.  Otherwise I'll poke around the Python site and find it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Need some experience

2011-09-13 Thread Tim Hanson
On Tuesday, September 13, 2011 01:37:05 pm Thomas Jollans wrote:
 On 13/09/11 22:25, Tim Hanson wrote:
  I have been a desktop Linux user for better than eleven years, as a
  hobby. Back when we still did most of our computing on desktops I even
  set up a rudimentary server setup in my home.  Nothing fancy or
  anything, but I was proud of it and of the fact that it was built
  Microsoft free.  I have no formal education in IT nor programming. 
  Retired now, my career was finance; I was an IRS field agent.
  
  Since retiring two years ago, I have renewed my interest in software.  I
  know some C and lately decided to learn Python.  I have worked through a
  couple of the introductory texts and have a feeling for the OOP model,
  although I won't be able to  call myself an experienced practitioner
  anytime soon.
  
  I am looking for an open source project that will allow me to develop my
  skills further.
  
  Financially, I'm set; I'm not looking for a job.  I'm looking for some
  drudge work, where I can look at other peoples' code and make a
  contribution. Naturally I do not want to do this forever; I'm hoping to
  get up to speed with my skill set so I can work to more complexity
  later.
  
  Does anyone have some ideas that would help me?
 
 This is becoming something of an FAQ - I don't suppose there's a canned
 response link somewhere ? ;-)
 
 I like to recommend CPython itself — which is a bit hypocritical, as I
 haven't touched it in quite a while. It has a constantly overflowing bug
 tracker where I'm sure you can find a lot of fascinating problems that
 need solving. The community, I have found, is welcoming and friendly.
 Much of the standard library is written in Python, but if you know C,
 you can have a go at the C code as well.
 
 Thomas
Never mind.  I found it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Need some experience

2011-09-13 Thread Christian Heimes
Am 13.09.2011 22:52, schrieb Tim Hanson:
 That's not a bad idea.  From the past I know that bug fixing is a great way 
 to 
 learn a language.  If you know a specific site to key in on, feel free to 
 send 
 me there.  Otherwise I'll poke around the Python site and find it.

It's a great idea. We are always looking for volunteers that help the
community to reduce the amount of open bugs. The bug tracker at
http://bugs.python.org/ even has a category for beginners. You just have
to search for keyword - easy and you'll get a bunch of low hanging
fruits to pick from.

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


Re: Need some experience

2011-09-13 Thread Tim Hanson
On Tuesday, September 13, 2011 02:36:52 pm Christian Heimes wrote:
 Am 13.09.2011 22:52, schrieb Tim Hanson:
  That's not a bad idea.  From the past I know that bug fixing is a great
  way to learn a language.  If you know a specific site to key in on, feel
  free to send me there.  Otherwise I'll poke around the Python site and
  find it.
 
 It's a great idea. We are always looking for volunteers that help the
 community to reduce the amount of open bugs. The bug tracker at
 http://bugs.python.org/ even has a category for beginners. You just have
 to search for keyword - easy and you'll get a bunch of low hanging
 fruits to pick from.

This is exactly what I'm looking for. I don't know who is the volunteer  
here, me for obvious reasons, or the Python community for doing some free 
hand-holding.  Now I know how I'll spend the next year.  Thank you!
-- 
http://mail.python.org/mailman/listinfo/python-list


ImportError: cannot import name dns

2011-09-13 Thread Jack Bates
Why is the following ImportError raised?

$ ./test
Traceback (most recent call last):
  File ./test, line 3, in module
from foo import dns
  File /home/jablko/foo/dns.py, line 1, in module
from foo import udp
  File /home/jablko/foo/udp.py, line 1, in module
from foo import dns
ImportError: cannot import name dns
$

I reproduce this error with the following four files and five lines:

== foo/dns.py ==
from foo import udp

== foo/udp.py ==
from foo import dns

== foo/__init__.py ==
(empty)

== test ==
#!/usr/bin/env python

from foo import dns
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Need some experience

2011-09-13 Thread Ben Finney
Tim Hanson tjhan...@yahoo.com writes:

 On Tuesday, September 13, 2011 02:36:52 pm Christian Heimes wrote:
  We are always looking for volunteers that help the community to
  reduce the amount of open bugs. The bug tracker at
  http://bugs.python.org/ even has a category for beginners. You just
  have to search for keyword - easy and you'll get a bunch of low
  hanging fruits to pick from.

 This is exactly what I'm looking for. I don't know who is the volunteer  
 here, me for obvious reasons, or the Python community for doing some free 
 hand-holding.  Now I know how I'll spend the next year.  Thank you!

Excellent attitude. Thank you in advance for contributing to the Python
community.

-- 
 \“With Lisp or Forth, a master programmer has unlimited power |
  `\ and expressiveness. With Python, even a regular guy can reach |
_o__)   for the stars.” —Raymond Hettinger |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Usenet newsgroup news:comp.lang.python ...

2011-09-13 Thread Ben Finney
mano mano manode...@gmail.com writes:

 Mikael Lyngvig accurately summarizes comp.lang.python discussion

No, you're posting spam links. Go away and spend the rest of your
miserable life in a deep hole.

-- 
 \  “If society were bound to invent technologies which could only |
  `\   be used entirely within the law, then we would still be sitting |
_o__)   in caves sucking our feet.” —Gene Kan, creator of Gnutella |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: The Usenet newsgroup news:comp.lang.python ...

2011-09-13 Thread Prasad, Ramit
 Mikael Lyngvig accurately summarizes comp.lang.python discussion

No, you're posting spam links. Go away and spend the rest of your
miserable life in a deep hole.

I was wondering since the text seemed like plausible non-spam (to me). 

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423



This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Usenet newsgroup news:comp.lang.python ...

2011-09-13 Thread Chris Angelico
On Wed, Sep 14, 2011 at 8:53 AM, Prasad, Ramit
ramit.pra...@jpmorgan.com wrote:
 I was wondering since the text seemed like plausible non-spam (to me).


I suspect it was autogenerated from subject lines of recent emails.
It'd not be hard to design a template that covers comp.lang.* or even
comp.*.

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


RE: ImportError: cannot import name dns

2011-09-13 Thread Prasad, Ramit
-Original Message-
From: python-list-bounces+ramit.prasad=jpmorgan@python.org 
[mailto:python-list-bounces+ramit.prasad=jpmorgan@python.org] On Behalf Of 
Jack Bates
Sent: Tuesday, September 13, 2011 5:28 PM
To: python-list@python.org
Subject: ImportError: cannot import name dns

Why is the following ImportError raised?

$ ./test
Traceback (most recent call last):
  File ./test, line 3, in module
from foo import dns
  File /home/jablko/foo/dns.py, line 1, in module
from foo import udp
  File /home/jablko/foo/udp.py, line 1, in module
from foo import dns
ImportError: cannot import name dns
$

I reproduce this error with the following four files and five lines:

== foo/dns.py ==
from foo import udp

== foo/udp.py ==
from foo import dns

== foo/__init__.py ==
(empty)

== test ==
#!/usr/bin/env python

from foo import dns


===
 
It is a circular dependency. Dns will try to import udp which will in turn 
import dns (again) in an endless cycle; instead an ImportError is raised. 

Circular dependency is a Bad Thing.

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Need some experience

2011-09-13 Thread Terry Reedy



It's a great idea. We are always looking for volunteers that help the
community to reduce the amount of open bugs. The bug tracker at
http://bugs.python.org/ even has a category for beginners. You just have
to search for keyword -  easy and you'll get a bunch of low hanging
fruits to pick from.


This is exactly what I'm looking for. I don't know who is the volunteer
here, me for obvious reasons, or the Python community for doing some free
hand-holding.  Now I know how I'll spend the next year.  Thank you!


Also consider the core-mentorship mailing list and the dev guide at
http://docs.python.org/devguide
--
Terry Jan Reedy

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


Offer various hats including Red Bull Hats on http://www.mlbhatshop.com/

2011-09-13 Thread zhenzhen zhang
Defending MX2 champion Ken is currently leading the MX2 championship
while Max Nagl heads to his favourite track of the season looking for
points to close the gap on fellow Red Bull Teka KTM Factory Racing
team http://www.mlbhatshop.com/  rider Tony Cairoli.  by red bull
hats.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Need some experience

2011-09-13 Thread Tim Hanson
On Tuesday, September 13, 2011 06:12:27 pm Terry Reedy wrote:
  It's a great idea. We are always looking for volunteers that help the
  community to reduce the amount of open bugs. The bug tracker at
  http://bugs.python.org/ even has a category for beginners. You just have
  to search for keyword -  easy and you'll get a bunch of low hanging
  fruits to pick from.
  
  This is exactly what I'm looking for. I don't know who is the volunteer
  here, me for obvious reasons, or the Python community for doing some free
  hand-holding.  Now I know how I'll spend the next year.  Thank you!
 
 Also consider the core-mentorship mailing list and the dev guide at
 http://docs.python.org/devguide

This is equally helpful.  Thanks!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyWart: Itertools module needs attention

2011-09-13 Thread rantingrick
On Sep 13, 10:45 am, Ian Kelly ian.g.ke...@gmail.com wrote:

 Have you looked at the online itertools documentation at all?

 http://docs.python.org/library/itertools.html

Yes the online docs are much better. I really like the source code
showing the inner workings of the methods. However i always get upset
when i see poorly thought out doc-strings. My philosophy is that we
should use the built in help function first and only visit the
documentation if more instruction is needed.


I may need to create another PyWart on the topic of doc-strings and
how the author of these strings needs to forget everything he knows
and imagine he is a complete python neophyte. I remember my initial
frustrations learning about functions (in another life it seems) and
my inability to grasp the concept was due to poor examples. I believe
the author use the Fibonacci sequence as an example (Python docs use
this example also). What an idiot!

What does conditionals, linear assignment, loops, the print function,
in-place addition, logic, blah, blah, have to do with understanding a
function... NOTHING! The most basic and by far the best first example
for functions (in any language) is this...

def add(x, y):
return x + y

Followed by this...

def sub(x,y):
return x - y

Simple and to the point. It simply reeks of ah ha! I dare anyone to
create a better introductory function example. Dear Tutorial Writer:
When writing tutorials please check your ego at the door. Thank you.
-- 
http://mail.python.org/mailman/listinfo/python-list


GIL switch interval

2011-09-13 Thread Matt Joiner
i'm curious as to what can be done with (and handled better) by
adjusting sys.setswitchinterval
i've opened a question on SO for this, that people might find of
interest: 
http://stackoverflow.com/questions/7376776/sys-setswitchinterval-in-python-3-2-and-beyond
-- 
http://mail.python.org/mailman/listinfo/python-list


Connection reset by peer

2011-09-13 Thread 守株待兔
there is a multi-threads program  dowloading  data from yahoo,the main 
structure is as the following(omit something  unimportant )


class   webdata(object):
def  __init__(self,name):
self.jobs = Queue.Queue()
if  x  in  name:
self.jobs.put(x)
def  download(self):
   try:
weburl=self.jobs.get()
url = weburl
hx = httplib2.Http()
resp, content = hx.request(url, headers=headers)   
print
self.jobs.task_done()
except:
print  url,wrong
self.jobs.task_done()
   
def  run(self):   
for i in range(30):
  threading.Thread(target=self.download).start()  
self.jobs.join()
   
if  __name__==__main__: 
 webdata('quote').run()



quote  is  a  list  which  i want to download,i was confused ,this program  can 
download something,
can't download something,
when i cancel  try,except , i get the output:
File /usr/local/lib/python2.7/dist-packages/httplib2/__init__.py, line 1436, 
in request
(response, content) = self._request(conn, authority, uri, request_uri, 
method, body, headers, redirections, cachekey)
  File /usr/local/lib/python2.7/dist-packages/httplib2/__init__.py, line 
1188, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, 
headers)
  File /usr/local/lib/python2.7/dist-packages/httplib2/__init__.py, line 
1171, in _conn_request
content = response.read()
  File /usr/lib/python2.7/httplib.py, line 541, in read
return self._read_chunked(amt)
  File /usr/lib/python2.7/httplib.py, line 590, in _read_chunked
value.append(self._safe_read(chunk_left))
  File /usr/lib/python2.7/httplib.py, line 647, in _safe_read
chunk = self.fp.read(min(amt, MAXAMOUNT))
  File /usr/lib/python2.7/socket.py, line 380, in read
data = self._sock.recv(left)
error: [Errno 104] Connection reset by peer

i  want to know,  my  computer(client)  reset  it  ,or  the yahoo (server)  
reset it ,what is the peer??-- 
http://mail.python.org/mailman/listinfo/python-list


stackoverflow and c.l.py (was: GIL switch interval)

2011-09-13 Thread Stefan Behnel

Matt Joiner, 14.09.2011 04:23:

i'm curious as to what can be done with (and handled better) by
adjusting sys.setswitchinterval
i've opened a question on SO for this, that people might find of
interest: http://stackoverflow.com[...]


I wonder why people ask this kind of question on stackoverflow, and then 
come here asking people to go over there, read the question, and 
(potentially) provide an answer.


IMHO, c.l.py is a much better place to ask Python(-related) questions than 
stackoverflow. It's also a much better place to search for an answer that 
is already available in the archives.


Stefan

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


Re: stackoverflow and c.l.py (was: GIL switch interval)

2011-09-13 Thread Steven D'Aprano
On Wed, 14 Sep 2011 02:12 pm Stefan Behnel wrote:

 Matt Joiner, 14.09.2011 04:23:
 i'm curious as to what can be done with (and handled better) by
 adjusting sys.setswitchinterval
 i've opened a question on SO for this, that people might find of
 interest: http://stackoverflow.com[...]
 
 I wonder why people ask this kind of question on stackoverflow, and then
 come here asking people to go over there, read the question, and
 (potentially) provide an answer.

You should post that question on stackoverflow, and ask them to reply here.



-- 
Steven

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


[issue12969] Command 'open(0, wb).close()' cause crash of Python interpreter [interactive mode]

2011-09-13 Thread Jiří Kučera

New submission from Jiří Kučera sanc...@gmail.com:

Invoking the `close' method of `_io.BufferedWriter' instance created by 
`open(0,wb)' command cause the Python interpreter crash.

Python interpreter info:
  mode: interactive
  version info: Python 3.2.1 (default, Jul 10 2011, 21:51:15) [MSC v.1500 32 
bit (Intel)] on win32

Operanting system info:
  Microsoft Windows XP
  Home Edition
  Version 2002
  Service Pack 3

Commands:
 fd = open(0,wb)
 fd.close()

--
components: Interpreter Core
messages: 143951
nosy: i386x
priority: normal
severity: normal
status: open
title: Command 'open(0,wb).close()' cause crash of Python interpreter 
[interactive mode]
type: crash
versions: Python 3.2

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



[issue12969] Command 'open(0, wb).close()' cause crash of Python interpreter [interactive mode]

2011-09-13 Thread Ezio Melotti

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


--
components: +IO
nosy: +benjamin.peterson, ezio.melotti, pitrou, stutzbach
stage:  - test needed
versions: +Python 3.3

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



[issue12936] armv5tejl: random segfaults in getaddrinfo()

2011-09-13 Thread Stefan Krah

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

The failure was introduced by issue #12655. I attach a minimal script
to reproduce the segfault.

--
nosy: +benjamin.peterson
Added file: http://bugs.python.org/file23138/crash.py

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



[issue12936] armv5tejl: random segfaults in getaddrinfo()

2011-09-13 Thread Stefan Krah

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

And here's a full backtrace of crash.py:


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x400225f0 (LWP 633)]
0x40011d20 in __tls_get_addr () from /lib/ld-linux.so.2
(gdb) bt
#0  0x40011d20 in __tls_get_addr () from /lib/ld-linux.so.2
#1  0x40035a14 in __h_errno_location () from /lib/libpthread.so.0
#2  0x40a788dc in __libc_res_nsearch () from /lib/libresolv.so.2
#3  0x40a66e9c in _nss_dns_gethostbyname3_r () from /lib/libnss_dns.so.2
#4  0x40a670ac in _nss_dns_gethostbyname2_r () from /lib/libnss_dns.so.2
#5  0x40180480 in gaih_inet () from /lib/libc.so.6
#6  0x40181da8 in getaddrinfo () from /lib/libc.so.6
#7  0x406084a4 in socket_getaddrinfo (self=0x405d7bcc, args=0x4089a8b4, 
kwargs=0x0)
at /home/user/mercurial-1.9.2/cpython/Modules/socketmodule.c:4787
#8  0x001ea384 in PyCFunction_Call (func=0x405da1f4, arg=0x4089a8b4, kw=0x0)
at Objects/methodobject.c:84
#9  0x000a3634 in call_function (pp_stack=0xbeab7d1c, oparg=4)
at Python/ceval.c:4000
#10 0x0009cab8 in PyEval_EvalFrameEx (f=0x407457b4, throwflag=0)
at Python/ceval.c:2625
#11 0x000a0bfc in PyEval_EvalCodeEx (_co=0x405d6ab8, globals=0x40591a34, 
locals=0x0, args=0x408884dc, argcount=2, kws=0x408884e4, kwcount=0, 
defs=0x40512a20, defcount=2, kwdefs=0x0, closure=0x0)
at Python/ceval.c:3375
#12 0x000a3cfc in fast_function (func=0x405e30e4, pp_stack=0xbeab8068, n=2, 
na=2, nk=0) at Python/ceval.c:4098
#13 0x000a3838 in call_function (pp_stack=0xbeab8068, oparg=2)
---Type return to continue, or q return to quit---
at Python/ceval.c:4021
#14 0x0009cab8 in PyEval_EvalFrameEx (f=0x40888374, throwflag=0)
at Python/ceval.c:2625
#15 0x000a0bfc in PyEval_EvalCodeEx (_co=0x4089d5d8, globals=0x4088d854, 
locals=0x0, args=0x404e2ac8, argcount=2, kws=0x405b43c8, kwcount=2, 
defs=0x4098fbd0, defcount=6, kwdefs=0x0, closure=0x0)
at Python/ceval.c:3375
#16 0x001c3060 in function_call (func=0x40a2dea4, arg=0x404e2ab4, 
kw=0x409a98f4) at Objects/funcobject.c:629
#17 0x0017f1a0 in PyObject_Call (func=0x40a2dea4, arg=0x404e2ab4, 
kw=0x409a98f4) at Objects/abstract.c:2149
#18 0x001a1a9c in method_call (func=0x40a2dea4, arg=0x404e2ab4, kw=0x409a98f4)
at Objects/classobject.c:318
#19 0x0017f1a0 in PyObject_Call (func=0x4050b9d4, arg=0x404e2574, 
kw=0x409a98f4) at Objects/abstract.c:2149
#20 0x0004a6c0 in slot_tp_init (self=0x405ae504, args=0x404e2574, 
kwds=0x409a98f4) at Objects/typeobject.c:5431
#21 0x00037650 in type_call (type=0x40a31034, args=0x404e2574, kwds=0x409a98f4)
at Objects/typeobject.c:691
#22 0x0017f1a0 in PyObject_Call (func=0x40a31034, arg=0x404e2574, 
kw=0x409a98f4) at Objects/abstract.c:2149
#23 0x000a46bc in do_call (func=0x40a31034, pp_stack=0xbeab84f0, na=1, nk=2)
at Python/ceval.c:4220
#24 0x000a3858 in call_function (pp_stack=0xbeab84f0, oparg=513)
at Python/ceval.c:4023
#25 0x0009cab8 in PyEval_EvalFrameEx (f=0x40558544, throwflag=0)
at Python/ceval.c:2625
#26 0x000a0bfc in PyEval_EvalCodeEx (_co=0x40479d28, globals=0x403d5034, 
locals=0x403d5034, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, 
defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3375
#27 0x000916f4 in PyEval_EvalCode (co=0x40479d28, globals=0x403d5034, 
locals=0x403d5034) at Python/ceval.c:770
#28 0x000e0cb4 in run_mod (mod=0x37c8f8, filename=0x405028c8 crash.py, 
globals=0x403d5034, locals=0x403d5034, flags=0xbeab8864, arena=0x2e5178)
at Python/pythonrun.c:1793
#29 0x000e0a58 in PyRun_FileExFlags (fp=0x2ce260, 
filename=0x405028c8 crash.py, start=257, globals=0x403d5034, 
locals=0x403d5034, closeit=1, flags=0xbeab8864) at Python/pythonrun.c:1750
#30 0x000debcc in PyRun_SimpleFileExFlags (fp=0x2ce260, 
filename=0x405028c8 crash.py, closeit=1, flags=0xbeab8864)
at Python/pythonrun.c:1275
#31 0x000dde68 in PyRun_AnyFileExFlags (fp=0x2ce260, 
filename=0x405028c8 crash.py, closeit=1, flags=0xbeab8864)
at Python/pythonrun.c:1046
#32 0x000ff984 in run_file (fp=0x2ce260, filename=0x401fe028, p_cf=0xbeab8864)
at Modules/main.c:299
#33 0x00100780 in Py_Main (argc=2, argv=0x401fc028) at Modules/main.c:693
#34 0x0001a914 in main (argc=2, argv=0xbeab8994) at ./Modules/python.c:59

--

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



[issue1813] Codec lookup failing under turkish locale

2011-09-13 Thread Stefan Krah

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

https://bugzilla.redhat.com/show_bug.cgi?id=726536 claims that the
glibc issue (which is relevant for skipping the test case) is fixed
in glibc-2.14.90-8.

I suspect the only way of running the test case reliably is whitelisting
a couple of known good glibc versions.

--

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



[issue1172711] long long support for array module

2011-09-13 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
versions: +Python 3.3 -Python 3.2

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



[issue1172711] long long support for array module

2011-09-13 Thread Mark Dickinson

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

Yes, please let's not add any new __int__-based duck typing here; IMO, we 
should be moving away from such uses of __int__.  I'd be fine with __index__ 
based duck-typing.

--

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



[issue7201] double Endian problem and more on arm

2011-09-13 Thread Mark Dickinson

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

 I don't think it is practical to support both ABIs.

I suspect you're right.

--

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



[issue12969] Command 'open(0, wb).close()' cause crash of Python interpreter [interactive mode]

2011-09-13 Thread Jesús Cea Avión

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

Under Python 3, open(integer) tries to open a file descriptor.

So, f=open(0,...); f.close() closes stdin, rightly shutting down the 
interpreter. It is not a crash, it is a shutdown. Tested under Linux.

The point is if opening a file descriptor is actually supported in Python 3...

In python 2.7 I get this: TypeError: coercing to Unicode: need string or 
buffer, int found.

--
nosy: +jcea

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



[issue12969] Command 'open(0, wb).close()' cause crash of Python interpreter [interactive mode]

2011-09-13 Thread Jesús Cea Avión

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

In help(open) I see this:


file is either a text or byte string giving the name (and the path
if the file isn't in the current working directory) of the file to
be opened or an integer file descriptor of the file to be
wrapped. (If a file descriptor is given, it is closed when the
returned I/O object is closed, unless closefd is set to False.)


So, file descriptors are allowed.

The interpreter shutdowns because your are closing STDIN. This is correct, in 
my opinion.

Closing this bug as invalid. If you think this is an error, feel free to 
argue.

--
resolution:  - invalid
status: open - closed

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



[issue12936] armv5tejl: random segfaults in getaddrinfo()

2011-09-13 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 The failure was introduced by issue #12655

Wow, great job!

crash.py looks like a libc and/or kernel bug. Can you try the glibc 2.14 
(released the 2011-05-31)? You should first check if it is not a duplicate of 
http://sources.redhat.com/bugzilla/show_bug.cgi?id=12453

--

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



[issue12915] Add inspect.locate and inspect.resolve

2011-09-13 Thread Éric Araujo

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

In addition, error handling/reporting is not trivial to get right.  We’ve had 
to fix the code in distutils2 and it’s still not quite right (#12703).

I opened this report because I’d like to see all stdlib modules use the same 
functions and I’d prefer people to copy-paste the same robust code for 
backports.

--

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



[issue5845] rlcompleter should be enabled automatically

2011-09-13 Thread Éric Araujo

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

FTR, I tried checking sys.ps1 instead of argv but it’s the same problem.

--

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



[issue12785] list_distinfo_file is wrong

2011-09-13 Thread Éric Araujo

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

I have added tests to make sure the return value (depending on the local 
parameter) is correct.  Please test when you have a free slot.  If it fails, 
the usual line after the XXX comment should be deleted and the test re-run.

--
Added file: http://bugs.python.org/file23139/fix-list_distinfo_files.diff

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



[issue12785] list_distinfo_file is wrong

2011-09-13 Thread Éric Araujo

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


Removed file: http://bugs.python.org/file22948/fix-list_distinfo_files.diff

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



[issue12785] list_distinfo_file is wrong

2011-09-13 Thread Éric Araujo

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


Removed file: http://bugs.python.org/file23065/fix-list_distinfo_files-2.diff

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



[issue12967] AttributeError distutils\log.py

2011-09-13 Thread Éric Araujo

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

When will it raise an AttributeError?

--

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



[issue12969] Command 'open(0, wb).close()' cause crash of Python interpreter [interactive mode]

2011-09-13 Thread Ezio Melotti

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

fd support is intentional, see Modules/_io/_iomodule.c:318

OTOH closing sys.stdin doesn't exit Python, so I'm not sure why closing fd 0 
should.

I was also thinking about possible security implications of this, but if 
someone tries to pass '0' as filename, it will most likely be passed to open as 
a string.

--

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



[issue12970] os.wlak() consider some symlinks as dirs instead of non-dirs

2011-09-13 Thread Марк Коренберг

New submission from Марк Коренберг socketp...@gmail.com:

Consider code:

for (root, dirs, nondirs) in os.walk(path, followlinks=False):
print (nondirs)

This code will not print symlinks that refer to some dir. I think it is the bug.

In other words: If followlinks is True, we should consider some symlinks as 
dirs. If not, any symlink is the non-dir.

Patch included.

Also, please fix documentation about this nuance.

--
assignee: docs@python
components: Documentation, Library (Lib)
files: z.patch
keywords: patch
messages: 143965
nosy: docs@python, mmarkk
priority: normal
severity: normal
status: open
title: os.wlak() consider some symlinks as dirs instead of non-dirs
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file23140/z.patch

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



[issue12970] os.wlak() consider some symlinks as dirs instead of non-dirs

2011-09-13 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
nosy: +haypo

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



[issue8713] multiprocessing needs option to eschew fork() under Linux

2011-09-13 Thread sbt

sbt shibt...@gmail.com added the comment:

Here is a patch which adds the following functions:

  forking_disable()
  forking_enable()
  forking_is_enabled()
  set_semaphore_prefix()
  get_semaphore_prefix()

To create child processes using fork+exec on Unix, call
forking_disable() at the beginning of the program.

I have tested the patch on Linux (by adding forking_disable() to
test_multiprocessing), and it seems to work.  However, the patch does
not modify test_multiprocessing, and I am not sure of the best way to
do so.  (See below.)

There are some issues with named semaphores.  When forking is
disabled, the name of the semaphore must be left unlinked so that
child processes can use sem_open() on the name.  The patch therefore
delays unlinking the name (only when forking is disabled) until the
original SemLock object is garbage collected or the process which
created it exits.

But if a process is killed without exiting cleanly then the name may
be left unlinked.  This happens, for instance, if I run
test_multiprocessing and then keep hitting ^C until all the processes
exit.  On Linux this leaves files with names like

  /dev/shm/sem.mp-fa012c80-4019-2

which represent leaked semaphores.  These won't be destroyed until the
computer reboots or the semaphores are manually removed (by using
sem_unlink() or by unlinking the entry from the file system).

If some form of this patch is accepted, then the problem of leaked
semaphores needs to be addressed, otherwise the buildbots are likely
run out of named semaphores.  But I am not sure how best to do this in
a platform agnostic way.  (Maybe a forked process could collect names
of all semaphores created, via a pipe.  Then it could try to
sem_unlink() all those names when all write-ends of the pipe are
closed.)

--
keywords: +patch
nosy: +sbt
Added file: http://bugs.python.org/file23141/mp_fork_exec.patch

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



[issue12970] os.wlak() consider some symlinks as dirs instead of non-dirs

2011-09-13 Thread Марк Коренберг

Марк Коренберг socketp...@gmail.com added the comment:

Also, there is some mis-optimisation for followlinks=False: stat() and then 
lstat() will be called. Instead of one lstat().

Code may be rewritten as (but I don't know about cross-platform issues):
-
if followlinks:
mode = os.stat(path).st_mode
else:
mode = os.lstat(path).st_mode

if stat.S_ISDIR(mode):
dirs.append(path)
else:
nondir.append(path)
-
It will be much cleaner than current (or patched with my patch) implementation

--

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



[issue12971] os.isdir() should contain skiplinks=False in arguments

2011-09-13 Thread Марк Коренберг

New submission from Марк Коренберг socketp...@gmail.com:

When skiplinks is False (by default), it should as in current implementation, 
i.e. using stat().

if skiplinks is True, isidr() should use lstat() and same logick. 

If one will be implemented, os.walk() should be patched (see issue12970) to use 
this new isdir() with this new parameter instead of own logick in os.walk().

--
components: Library (Lib)
messages: 143968
nosy: mmarkk
priority: normal
severity: normal
status: open
title: os.isdir() should contain skiplinks=False in arguments
type: feature request
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4

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



[issue12970] os.walk() consider some symlinks as dirs instead of non-dirs

2011-09-13 Thread Марк Коренберг

Changes by Марк Коренберг socketp...@gmail.com:


--
title: os.wlak() consider some symlinks as dirs instead of non-dirs - 
os.walk() consider some symlinks as dirs instead of non-dirs

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



[issue12968] vvccc留查!!!

2011-09-13 Thread Benjamin Peterson

Changes by Benjamin Peterson benja...@python.org:


--
resolution:  - invalid
status: open - closed

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



[issue8713] multiprocessing needs option to eschew fork() under Linux

2011-09-13 Thread sbt

Changes by sbt shibt...@gmail.com:


Removed file: http://bugs.python.org/file23141/mp_fork_exec.patch

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



[issue8713] multiprocessing needs option to eschew fork() under Linux

2011-09-13 Thread sbt

sbt shibt...@gmail.com added the comment:

Small fix to patch.

--
Added file: http://bugs.python.org/file23142/mp_fork_exec.patch

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



[issue11981] dupe self.fp.tell() in zipfile.ZipFile.writestr

2011-09-13 Thread Alan McIntyre

Alan McIntyre alan.mcint...@gmail.com added the comment:

I also can't see any file operations that might occur between the two .tell() 
calls, and a full test pass (including test_zipfile64) on the py3k development 
branch doesn't turn up any problems on Linux (2.6.38, x86_64) for me, so I 
agree the second .tell() could be removed.

--

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



[issue12301] Use :role:`sys.thing` instead of ``sys.thing`` throughout

2011-09-13 Thread Éric Araujo

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

Alright, I’ll propose piecemeal patches.

Georg, two questions:
1) In the tutorial, should classes with no target use ``MyClass`` or 
:class:`!MyClass`?  

2) Should file extensions use ``.py`` or :file:`.py`?  We currently have both.

--

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



[issue1739648] zipfile.testzip() using progressive file reads

2011-09-13 Thread Alan McIntyre

Alan McIntyre alan.mcint...@gmail.com added the comment:

I re-checked testzip-patch3.diff since some time has passed since I last 
commented on it, and it still seems to work ok (the small test_zipfile.py block 
failed to apply, but that's easy enough to do manually).  Passes full test run, 
test_zipfile64.py, etc., on Linux x86_64.

If there is something about the patch that still needs to be addressed before 
it can be committed, let me know and I'll see what I can do.

--

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



[issue1757072] Zipfile robustness

2011-09-13 Thread Alan McIntyre

Alan McIntyre alan.mcint...@gmail.com added the comment:

So far I haven't had the opportunity to sit down and write up a lenient 
zipfile handling patch; my apologies to those that could really use one.  If 
somebody does propose a patch, I'll be glad to test and review it.

I suppose I would like to see the issue kept open for a while, even if just to 
collect common bending of the rules cases that people would like to see 
supported.

--

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



[issue12397] re match object methods have no docstrings

2011-09-13 Thread Éric Araujo

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


--
nosy: +eric.araujo

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



[issue12936] armv5tejl: random segfaults in getaddrinfo()

2011-09-13 Thread Stefan Krah

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

I wonder whether it is http://sources.redhat.com/bugzilla/show_bug.cgi?id=12453.

The demo script from there crashes both on debian-arm and Ubuntu Lucid,
but this specific segfault only occurs on debian arm.

Attached is a minimal C test case that only crashes on debian-arm
when sched_setaffinity() is called *and* the program is linked to
pthread:


$ gcc -Wall -W -O0 -g -o crash crash.c
$ ./crash
$
$ gcc -Wall -W -O0 -g -o crash crash.c -pthread
$ ./crash
Segmentation fault (core dumped)

# comment out: sched_setaffinity(0, size, cpusetp);

$ gcc -Wall -W -O0 -g -o crash crash.c -pthread
$ ./crash
$ 


On Ubuntu all three cases run fine. Perhaps this is a bug in
sched_setaffinity()?

--
Added file: http://bugs.python.org/file23143/crash.c

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



[issue11473] upload command no longer accepts repository by section name

2011-09-13 Thread Éric Araujo

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

This is a strange bug.  I added a test using -r server2, using the 
already-existing PYPIRC_LONG_PASSWORD string as .pypirc contents.  The test 
passes.  To make sure changing one test would not affect another one, I created 
a new .pypirc file, PYPIRC_CUSTOM_SERVER, and then I got to see your bug!  I 
tried various combinations of keys (realm or not, user or not), changed the 
markup (: or = as delimiter, spaces or not) but could not easily find the root 
of the bug.

Can you publish a .pypirc file that works with 2.7 and not with 3.2?  That 
would be a good starting point.

--
keywords: +patch
Added file: http://bugs.python.org/file23144/test-11473-py32.diff

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



[issue12301] Use :role:`sys.thing` instead of ``sys.thing`` throughout

2011-09-13 Thread Georg Brandl

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

Basically, :class:`!Foo` has no advantage over ``Foo``. The no-linking syntax 
is really only there for completeness, but I would prefer the plainer and 
easier to read (in source) ``Foo``.

For files, :file: really only has an advantage if you do something with the 
information that it's a file (which we don't, currently), or if you use the 
special feature that you can embed variable parts with {}.

--

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



[issue12972] Color prompt + readline

2011-09-13 Thread Damian

New submission from Damian atag...@gmail.com:

Hi, when using terminal coloring codes (for instance '\x1b[32mhello 
world\x1b[0m' for a green 'hello world') the raw_input function and readline 
module behave well except under a very specific use case...



import readline # provides history via up/down

prompt = '\x1b[32m \x1b[0m' # green ' ' prompt

while True:
  raw_input(prompt)



This provides a green prompt and up/down cycles through prior input. This works 
well as long as the input is shorter than the prompt string length (in this 
case 13 characters). However, if the input is longer than the prompt then 
up/down thinks that the first thirteen rendered characters now belong to the 
prompt. For instance...

atagar@fenrir:~/Desktop/arm$ python tmp.py 
 http://docs.python.org/library/readline

Press up, then down to get back to a blank prompt. You'll have...
 http://do

This is probably due to a len() check on the raw_input argument...
 len(' http://do')
13
 len('\x1b[32m \x1b[0m')
13

I'm at a bit of a loss for investigating this further - help would be 
appreciated! -Damian

--
messages: 143977
nosy: atagar1
priority: normal
severity: normal
status: open
title: Color prompt + readline
type: behavior
versions: Python 2.6

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



[issue12936] armv5tejl segfaults: sched_setaffinity() vs. pthread_setaffinity_np()

2011-09-13 Thread Stefan Krah

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

I think I got it: pthread_setaffinity_np() does not crash. 
 
`man sched_setaffinity` is slightly ambiguous, but there is this remark:

(If  you  are  using  the POSIX threads API, then use pthread_setaffinity_np(3) 
 instead of sched_setaffinity().)


I'm attaching the non-crashing version.

--
title: armv5tejl: random segfaults in getaddrinfo() - armv5tejl segfaults: 
sched_setaffinity() vs. pthread_setaffinity_np()
Added file: http://bugs.python.org/file23145/pthread_nocrash.c

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



[issue12936] armv5tejl segfaults: sched_setaffinity() vs. pthread_setaffinity_np()

2011-09-13 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

 I think I got it: pthread_setaffinity_np() does not crash.

Nice.
Out of curiosity, I just looked at the source code, and it just does 
sched_setaffinity(thread-tid), so you can do the same with 
sched_setaffinity(syscall(SYS_gettid)) for the current thread.
However, I don't think we should/could add this to the posix module: it expects 
a pthread_t instead of a PID, to which we don't have access.
Furthermore, even though we're linked with pthread, this should normally 
succeed - or at least not crash - when called from the main thread - and it 
does on my Debian squeeze box.
So I'd suggest closing this issue.

--

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



[issue1172711] long long support for array module

2011-09-13 Thread Meador Inge

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

 Yes, please let's not add any new __int__-based duck typing here;

Mark, just to clarify a bit, the behavior is already there in the array module 
(by way of 'PyLong_AsLong').  The fact that it is there was picked up on a code 
review for this issue.

Anyway, I think we should open a new issue to track the '__index__' vs. 
'__int__' stuff.

--

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



[issue12936] armv5tejl segfaults: sched_setaffinity() vs. pthread_setaffinity_np()

2011-09-13 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 However, I don't think we should/could add this to the posix module: 
 it expects a pthread_t instead of a PID, to which we don't have access.

We already have such function:
http://docs.python.org/dev/library/signal.html#signal.pthread_kill

I added threading.get_ident() to easily get the thread identifier. In Python  
3.3, you can use threading.current_thread().ident.

It's not documented, but if you pass a random integer, signal.pthread_kill() 
does crash.

--

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



[issue12785] list_distinfo_file is wrong

2011-09-13 Thread Jeremy Kloth

Jeremy Kloth jeremy.kloth+python-trac...@gmail.com added the comment:

The attached patch seems to work as-is.  That is, just testing for `self.path` 
as the prefix.  On Windows, at least, the paths in RECORD are always absolute.

Further changes will be necessary, of course, once changes for alternative 
paths (--prefix, --home, and so on) are incorporated.

--
nosy: +jkloth

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



[issue1172711] long long support for array module

2011-09-13 Thread Mark Dickinson

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

 Mark, just to clarify a bit, the behavior is already there in the array module

Okay, understood.  But the new 'long long' support provided by this patch still 
allows for __int__-based duck typing, right?

 array('Q', [1, 2, Decimal(3.2)])
array('Q', [1, 2, 3])

That's the new duck typing I meant.  I see this acceptance of things with an 
__int__ method as a mistake, and my gut reaction earlier was that it seems 
wrong to propagate that mistake into the new long long functionality, even 
though it's already present in other places in the array module.

On second thoughts though, it would be a peculiar inconsistency to be able to 
pass Decimal objects to array('L', ...) but not to array('Q', ...).  So 
probably better to accept this behaviour for now, and open another issue for 
the __int__ / __index__ discussion, as you suggest.

BTW, the patch and tests look good to me, and all tests pass here (OS X !0.6, 
64-bit) (Well, not quite true, but I fail to see how these changes could be 
responsible for the test_socket and test_packaging failures I'm seeing :-).  I 
get compile-time warnings from the 'int' declarations that should be 
'Py_ssize_t', but I understand that's taken care of already...

--

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



[issue12936] armv5tejl segfaults: sched_setaffinity() vs. pthread_setaffinity_np()

2011-09-13 Thread Stefan Krah

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

Charles-François Natali rep...@bugs.python.org wrote:
 Out of curiosity, I just looked at the source code, and it just does
 sched_setaffinity(thread-tid), so you can do the same with
 sched_setaffinity(syscall(SYS_gettid)) for the current thread.

sched_setaffinity(syscall(SYS_gettid), size, cpusetp) crashes, too.
This seems to be a violation of the man page, which states:

The value returned from a call to gettid(2) can be passed in
 the argument pid.

Unless one uses a somewhat warped interpretation that linking
against pthread constitutes using the POSIX threads API. That
would be the only loophole that would allow the crash.

 However, I don't think we should/could add this to the posix module:
 it expects a pthread_t instead of a PID, to which we don't have access.

If we have access (and as I understood from Victor's post we do):
pthread_getaffinity_np() also exists on FreeBSD, which would be
an advantage.

 So I'd suggest closing this issue.

I don't care strongly about using pthread_getaffinity_np(), but at least I'd
like to skip the scheduling sections on arm-linux if they don't work reliably.

--

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



[issue12973] int_pow() implementation is incorrect

2011-09-13 Thread Adam

New submission from Adam a...@netbsd.org:

int_pow() (from Objects/intobject.c) shows incorrect results when Python is 
compiled with Clang (llvm.org); long story short: int_pow() function should use 
'unsigned long' type instead of 'long' or some code gets optimised out.

Please, refer to this bug report to find out the details:
http://llvm.org/bugs/show_bug.cgi?id=10923

--
messages: 143985
nosy: a...@netbsd.org
priority: normal
severity: normal
status: open
title: int_pow() implementation is incorrect
type: behavior
versions: Python 2.7

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



[issue12973] int_pow() implementation is incorrect

2011-09-13 Thread Stefan Krah

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

I think this is related to issue #11149. Can you try compiling with
-fwrapv?

--
nosy: +skrah

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



[issue12720] Expose linux extended filesystem attributes

2011-09-13 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment:

There is an inconsistency in used header and library.
attr/xattr.h and libattr.so belong to attr package 
(http://savannah.nongnu.org/projects/attr).
glibc provides sys/xattr.h and libc.so.
Both libattr.so and libc.so define getxattr(), setxattr() and other functions.
Modules/posixmodule.c includes attr/xattr.h from attr package, but 
libpython3.3.so isn't linked against libattr.so and is linked against libc.so, 
so functions from glibc are used at run time.

I suggest to use sys/xattr.h:
- sys/xattr.h instead of attr/xattr.h in Modules/posixmodule.c, configure, 
configure.in and pyconfig.h.in
- HAVE_SYS_XATTR_H instead of HAVE_ATTR_XATTR_H in Modules/posixmodule.c and 
pyconfig.h.in

--
resolution: fixed - 
status: closed - open

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



[issue12936] armv5tejl segfaults: sched_setaffinity() vs. pthread_setaffinity_np()

2011-09-13 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

 If we have access (and as I understood from Victor's post we do):
 pthread_getaffinity_np() also exists on FreeBSD, which would be
 an advantage.

Yes, but I see several drawbacks:
- as noted by Victor, it's really easy to crash the interpreter by passing an 
invalid thread ID, which IMHO, should be avoided at all cost
- to be safe, we would need to have a different API depending on whether Python 
is built with threads or not (i.e. sched_setaffinity() without threads, and 
pthread_setaffinity_np())
- pthread_setaffinity_np() is really non-portable (it's guarded by __USE_GNU in 
my system's header)
- sched_setaffinity() seems to work fine on most systems even when linked with 
pthread

 I don't care strongly about using pthread_getaffinity_np(), but at least I'd
 like to skip the scheduling sections on arm-linux if they don't work reliably.

Sounds reasonable.
I guess you could use os.uname() or platform.machine().

--

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



[issue12720] Expose linux extended filesystem attributes

2011-09-13 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 33f7044b5682 by Benjamin Peterson in branch 'default':
Use xattr functions from sys/xattr.h instead of attr/xattr.h (closes #12720)
http://hg.python.org/cpython/rev/33f7044b5682

--
resolution:  - fixed
status: open - closed

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



[issue12973] int_pow() implementation is incorrect

2011-09-13 Thread Stefan Krah

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

I can reproduce your results with a recent clang. gcc has similar
optimization behavior, but for gcc ./configure automatically adds
-fwrapv, which prevents the incorrect results.

I'm closing this as a duplicate of #11149.

--
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - [PATCH] Configure should enable -fwrapv for clang

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



[issue11149] [PATCH] Configure should enable -fwrapv for clang

2011-09-13 Thread Stefan Krah

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


--
nosy: +a...@netbsd.org, skrah

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



[issue11149] [PATCH] Configure should enable -fwrapv for clang

2011-09-13 Thread Stefan Krah

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

Recent clang and Python2.7 (without the patch):

Python 2.7.2+ (2.7:e8d8eb9e05fd, Sep 14 2011, 00:35:51) 
[GCC 4.2.1 Compatible Clang 3.0 (trunk 139637)] on freebsd8
Type help, copyright, credits or license for more information.
 2**63
-9223372036854775808
 2**64
0
 


The patch is fine and I'm going to commit it tomorrow if there are no
objections.

--
priority: high - critical

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



  1   2   >