Re: Running a Python script on a web server

2011-06-08 Thread Abhijeet Mahagaonkar
Python doesn't normally run in a web browser. There's two easy options: Is there an option of running it like php? I have never written in php, but my understanding is that the php script will be saved in some remote server and we will be able to run it using the url. pls correct me if i;m wrong.

Re: Running a Python script on a web server

2011-06-08 Thread Chris Angelico
On Wed, Jun 8, 2011 at 3:52 PM, Abhijeet Mahagaonkar abhijeet.mano...@gmail.com wrote: Python doesn't normally run in a web browser. There's two easy options: Is there an option of running it like php? I have never written in php, but my understanding is that the php script will be saved in

Re: Running a Python script on a web server

2011-06-08 Thread D'Arcy J.M. Cain
On Wed, 8 Jun 2011 11:22:53 +0530 Abhijeet Mahagaonkar abhijeet.mano...@gmail.com wrote: Python doesn't normally run in a web browser. There's two easy options: Is there an option of running it like php? I have never written in php, but my understanding is that the php script will be saved in

Re: Running a Python script on a web server

2011-06-08 Thread Abhijeet Mahagaonkar
I guess i got my answer :) Thanks Regards, Abhijeet On Wed, Jun 8, 2011 at 12:01 PM, D'Arcy J.M. Cain da...@druid.net wrote: On Wed, 8 Jun 2011 11:22:53 +0530 Abhijeet Mahagaonkar abhijeet.mano...@gmail.com wrote: Python doesn't normally run in a web browser. There's two easy options:

Re: Dynamic Zero Padding.

2011-06-08 Thread Friedrich Clausen
On Wed, Jun 8, 2011 at 4:56 AM, Terry Reedy tjre...@udel.edu wrote: On 6/7/2011 7:05 PM, John Posner wrote: You might want to try new style string formatting [1], which I think is better than the old style in this particular case:     Testing {0:0{1}d}.format(42, 4)    'Testing 0042'    

Re: How good is security via hashing

2011-06-08 Thread Nobody
On Tue, 07 Jun 2011 19:38:29 -0700, Paul Rubin wrote: Personally, I'd take whatever cheap entropy I can get and hash it. If you're going to read from /dev/urandom, limit it to a few bytes per minute, not per request. That's really not going to help you. In what way? If I need security,

Re: Call python function from Matlab

2011-06-08 Thread Adam Przybyla
nazmul.is...@gmail.com nazmul.is...@gmail.com wrote: I need to call a python function from a Matlab environment. Is it possible? Let's assume, I have the following python code: def squared(x): y = x * x return y I want to call squared(3) from Matlab workspace/code and get 9.

Re: Call python function from Matlab

2011-06-08 Thread Thomas Rachel
Am 08.06.2011 07:12 schrieb nazmul.is...@gmail.com: I need to call a python function from a Matlab environment. Is it possible? Let's assume, I have the following python code: def squared(x): y = x * x return y I want to call squared(3) from Matlab workspace/code and get 9. Thanks

Re: Call python function from Matlab

2011-06-08 Thread Thomas Rachel
Am 08.06.2011 09:19 schrieb Adam Przybyla: nazmul.is...@gmail.comnazmul.is...@gmail.com wrote: I need to call a python function from a Matlab environment. Is it possible? Let's assume, I have the following python code: def squared(x): y = x * x return y I want to call squared(3)

Re: How good is security via hashing

2011-06-08 Thread Paul Rubin
Nobody nob...@nowhere.com writes: If you're going to read from /dev/urandom, limit it to a few bytes per minute, not per request. That's really not going to help you. In what way? If I need security, I'll use /dev/random or /dev/urandom. If I don't, I'll save the real entropy for something

Web Applications - Separating DB Connections

2011-06-08 Thread Burhan
Hello Everyone: I am trying to find a way to extract and remove database connection information (username, password, schema name) from the application source. I need to do this because in my organization - for security reasons - access to databases is controlled by a separate department; and as

Re: simple web/html testing

2011-06-08 Thread Burhan
On Jun 7, 10:42 pm, Tim jtim.arn...@gmail.com wrote: On Jun 7, 2:05 pm, Miki Tebeka miki.teb...@gmail.com wrote: http://pypi.python.org/pypi/selenium? I looked at Selenium and it may be what I need, but when I searched for selenium and broken link (one of the things I need to test for), I

Re: how to avoid leading white spaces

2011-06-08 Thread rusi
On Jun 7, 11:37 pm, ru...@yahoo.com ru...@yahoo.com wrote: On 06/06/2011 08:33 AM, rusi wrote: For any significant language feature (take recursion for example) there are these issues: 1. Ease of reading/skimming (other's) code 2. Ease of writing/designing one's own 3. Learning curve

Re: how to avoid leading white spaces

2011-06-08 Thread Duncan Booth
ru...@yahoo.com ru...@yahoo.com wrote: On 06/06/2011 09:29 AM, Steven D'Aprano wrote: Yes, but you have to pay the cost of loading the re engine, even if it is a one off cost, it's still a cost, ~$ time python -c 'pass' real 0m0.015s user 0m0.011s sys 0m0.003s ~$ time

Re: How good is security via hashing

2011-06-08 Thread Robin Becker
On 07/06/2011 21:42, Paul Rubin wrote: geremy condradebat...@gmail.com writes: # adds random junk to the filename- should make it hard to guess rrr = os.urandom(16) fname += base64.b64encode(rrr) Don't use b64 output in a filename -- it can have slashes in it! :-( Simplest is to use old

best book about Webdesign with Django

2011-06-08 Thread News123
Hi, Do you have any recommendations for a good book about Web design with Django? Thanks for suggestions. -- http://mail.python.org/mailman/listinfo/python-list

Re: How good is security via hashing

2011-06-08 Thread Thomas Rachel
Am 08.06.2011 11:13 schrieb Robin Becker: we have been using base62 ie 0-9A-Za-z just to reduce the name length. Ugly concerning calculation. Then maybe better use radix32 - 0..9a..v, case-insensitive. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Web Applications - Separating DB Connections

2011-06-08 Thread Stuart MacKay
A simple way to do this is use fabric for deployment. It allows you to upload a file as if it was a template and replaces any placeholder strings with values supplied when you upload. The values can be supplied either in a config file or interactively when the deployment takes place. For my

Tix Combobox

2011-06-08 Thread peter
I'm writing some fairly simple code using a Tkinter GUI, and found I wanted a Combo box. As Tkinter does not provide one, I turned to Tix, and struggled. Extensive googling failed to turn up any python specific documentation, and there was no obvious way to translate the Tcl documentation.

Re: Tix Combobox

2011-06-08 Thread Kevin Walzer
On 6/8/11 8:00 AM, peter wrote: I'm writing some fairly simple code using a Tkinter GUI, and found I wanted a Combo box. As Tkinter does not provide one, I turned to Tix, and struggled. Extensive googling failed to turn up any python specific documentation, and there was no obvious way to

Re: simple web/html testing

2011-06-08 Thread Santi
For static html testing, I'd avoid using Selenium. Even though Selenium is *the* tool for RIA and javascript intensive environments, feels like bringing up a browser with all the coordination and resources that it takes just to crawl the website and find 404s is an overkill. What we

Function declarations ?

2011-06-08 Thread Andre Majorel
Is there a way to keep the definitions of the high-level functions at the top of the source ? I don't see a way to declare a function in Python. Thanks in advance. -- André Majorel http://www.teaser.fr/~amajorel/ J'ai des droits. Les autres ont des devoirs. --

Re: The pythonic way equal to whoami

2011-06-08 Thread TheSaint
Kushal Kumaran wrote: os.geteuid This return 0 for *root* . I don't know if it's a standard for all distro. Mine is Archlinux. I'd just like to avoid error caused by wrong access by user -- goto /dev/null -- http://mail.python.org/mailman/listinfo/python-list

Re: Function declarations ?

2011-06-08 Thread Calvin Spealman
Just write the function, at the top of the source. Easy peasy. On Wed, Jun 8, 2011 at 9:58 AM, Andre Majorel che...@halliburton.com wrote: Is there a way to keep the definitions of the high-level functions at the top of the source ? I don't see a way to declare a function in Python. Thanks

Re: Web Applications - Separating DB Connections

2011-06-08 Thread Burhan
On Jun 8, 1:22 pm, Stuart MacKay smac...@flagstonesoftware.com wrote: A simple way to do this is use fabric for deployment. It allows you to upload a file as if it was a template and replaces any placeholder strings with values supplied when you upload. The values can be supplied either in a

Re: Function declarations ?

2011-06-08 Thread D'Arcy J.M. Cain
On Wed, 8 Jun 2011 13:58:18 + (UTC) Andre Majorel che...@halliburton.com wrote: Is there a way to keep the definitions of the high-level functions at the top of the source ? I don't see a way to declare a function in Python. You don't declare functions in Python. You simply define them.

Re: how to avoid leading white spaces

2011-06-08 Thread ru...@yahoo.com
On 06/08/2011 03:01 AM, Duncan Booth wrote: ru...@yahoo.com ru...@yahoo.com wrote: On 06/06/2011 09:29 AM, Steven D'Aprano wrote: Yes, but you have to pay the cost of loading the re engine, even if it is a one off cost, it's still a cost, [...] At least part of the reason that there's no

Re: how to avoid leading white spaces

2011-06-08 Thread ru...@yahoo.com
On 06/07/2011 06:30 PM, Roy Smith wrote: On 06/06/2011 08:33 AM, rusi wrote: Evidently for syntactic, implementation and cultural reasons, Perl programmers are likely to get (and then overuse) regexes faster than python programmers. ru...@yahoo.com ru...@yahoo.com wrote: I don't see how the

[ANN] RuPy 11 Conference : Call for Proposals

2011-06-08 Thread J. P. Nowak
:: Call for Proposals 2011 RuPy 11 :: Strongly Dynamic Conference http://rupy.eu/ Poznan, Poland October 14th-16th, 2011 RuPy is a conference about dynamically typed programming languages. Held for the first time in April 2007 it gathered enthusiasts from Poland and other countries. The idea

Problems Compiling Python 2.6.7 for Win7

2011-06-08 Thread Jay Osako
I have been trying to get PyODBC to work with Python 2.6 (the latest version it is known to be compatible with) and Django, but have run into a problem which, according to the information I've got elsewhere, probably stems from a DLL incompatibility - apparently, the standard CPython distribution

We wholesale Amazon Kindle/ Monster Beats / Ipods / Apple products of all types

2011-06-08 Thread sdgsad
hi We wholesale Amazon Kindle/ Monster Beats / Ipods / Apple products of all types Apple iPad 2 16GB WiFi 450$ Apple iPad 2 32GB WiFi580$ Apple iPad 2 64GB WiFi 620$ iPad 2 16GB Wi-Fi+3G Verizon/ATT 550$ iPad 2 32GB Wi-Fi+3G Verizon/ATT 650$ iPad 2 64GB Wi-Fi+3G Verizon/ATT 750$

Eigensolver for Large Sparse Matrices in Python

2011-06-08 Thread Andrew MacLean
Hi, I need to solve symmetric generalized eigenvalue problems with large, sparse stiffness and mass matrices, say 'A' and 'B'. The problem is of the form Av = lambdaBV. I have been using lobpcg (scipy.sparse.linalg.lobpcg), in Scipy 0.7.2, although this has been giving me incorrect values that

test_popen

2011-06-08 Thread harrismh777
hi folks, I've installed 3.2 and 2.7.1 on a second development notebook from sources. 3.2 was smooth, and 2.7.1 make test failed test_popen. All other tests either passed or were skipped for valid reasons. I do not remember 3.2 failing popen... so I'm wondering about 2.7? I'm assuming

Re: how to avoid leading white spaces

2011-06-08 Thread rusi
On Jun 8, 7:38 pm, ru...@yahoo.com ru...@yahoo.com wrote: On 06/07/2011 06:30 PM, Roy Smith wrote: On 06/06/2011 08:33 AM, rusi wrote: Evidently for syntactic, implementation and cultural reasons, Perl programmers are likely to get (and then overuse) regexes faster than python

Re: Question about pyjamas inner workings (pyjd's version of imputil.py)

2011-06-08 Thread Luke Kenneth Casson Leighton
[i'm bcc'ing this to python-list because it's something that is generic to python, not pyjamas] On Tue, Jun 7, 2011 at 4:38 PM, Alexander Tsepkov atsep...@gmail.com wrote: I'm working on a python-based side project where I want to be able to generate multiple variations of the program and I

Import error while running python application on Mac OS

2011-06-08 Thread hisan
HI All, I have created an application for Mac OS using py2app module, in my python script i have external modules such as MySQLdb and other , while trying to run on Mac OS i get an error saying unable to import the module MySQLdb. On Windows i convert python script to an exe using py2exe module

Re: simple web/html testing

2011-06-08 Thread Tim
On Jun 8, 9:57 am, Santi santi...@gmail.com wrote: For static html testing, I'd avoid using Selenium. Even though Selenium is *the* tool for RIA and javascript intensive environments, feels like bringing up a browser with all the coordination and resources that it takes just to crawl the

In Python 2.x, is it possible to make unicode as default like in Python 3.x?

2011-06-08 Thread G00gle and Python Lover
Hello. I almost like everything in Python. Code shrinking, logic of processes, libraries, code design etc. But, we... - everybody knows that Python 2.x has lack of unicode support. In Python 3.x, this has been fixed :) And I like 3.x more than 2.x But, still major applications haven't been ported

How to run C++ binaries with python in parallel?

2011-06-08 Thread Pony
Hi all, I'm a newbie with python, and I have a question about running parallel C++ binaries with python. Suppose I have a C++ binary named test and it takes two inputs, if I want to run below three commands in bash: test a b test c d test e f What's the best way to run it parallel with python?

Re: How to run C++ binaries with python in parallel?

2011-06-08 Thread Chris Rebert
On Wed, Jun 8, 2011 at 12:06 PM, Pony lingyu.ma...@googlemail.com wrote: Hi all, I'm a newbie with python, and I have a question about running parallel C++ binaries with python. Suppose I have a C++ binary named test and it takes two inputs, if I want to run below three commands in bash:

Of Functions, Objects, and Methods-I NEED HELP PLEASE

2011-06-08 Thread Cathy James
I am almost there, but I need a little help: I would like to a) print my dogs in the format index. name: breed as follows: 0. Mimi:Poodle 1.Sunny: Beagle 2. Bunny: German Shepard I am getting (0, ('Mimi', 'Poodle')) . Mimi : Poodle instead-what have I done wrong? b) I would like to append to

Re: Bloom Filter in 22 lines of Python (updated)

2011-06-08 Thread Raymond Hettinger
On Jun 6, 10:47 am, geremy condra debat...@gmail.com wrote: On Fri, Jun 3, 2011 at 1:17 PM, Raymond Hettinger pyt...@rcn.com wrote: Thanks for all the feedback on the earlier post. I've updated the recipe to use a cleaner API, simpler code, more easily subclassable, and with optional

Re: The pythonic way equal to whoami

2011-06-08 Thread Christopher Head
On Wed, 08 Jun 2011 21:58:17 +0800 TheSaint nob...@nowhere.net.no wrote: Kushal Kumaran wrote: os.geteuid This return 0 for *root* . I don't know if it's a standard for all distro. Mine is Archlinux. I'd just like to avoid error caused by wrong access by user It is. Until Linux

smtp - python

2011-06-08 Thread Josias L.G
Hi for all, I'm very newbie in python and is very good language. I'm trying to adopt a example: import smtpd import asyncore server = smtpd.PureProxy(('127.0.0.1', 1025), ('mail', 25)) asyncore.loop() I'm trying to copy the email that is send to another email in maildir format. Here, i'm

Re: In Python 2.x, is it possible to make unicode as default like in Python 3.x?

2011-06-08 Thread Benjamin Kaplan
On Wed, Jun 8, 2011 at 11:22 AM, G00gle and Python Lover pythech...@gmail.com wrote: Hello. I almost like everything in Python. Code shrinking, logic of processes, libraries, code design etc. But, we... - everybody knows that Python 2.x has lack of unicode support. In Python 3.x, this has

Re: Of Functions, Objects, and Methods-I NEED HELP PLEASE

2011-06-08 Thread Ethan Furman
Cathy James wrote: I am almost there, but I need a little help: I would like to a) print my dogs in the format index. name: breed as follows: 0. Mimi:Poodle 1.Sunny: Beagle 2. Bunny: German Shepard I am getting (0, ('Mimi', 'Poodle')) . Mimi : Poodle instead-what have I done wrong? b) I

Re: Of Functions, Objects, and Methods-I NEED HELP PLEASE

2011-06-08 Thread Benjamin Kaplan
On Wed, Jun 8, 2011 at 1:09 PM, Cathy James nambo...@gmail.com wrote: I am almost there, but I need a little help: I would like to a) print my dogs in the format  index. name: breed as follows: 0. Mimi:Poodle 1.Sunny: Beagle 2. Bunny: German Shepard I am getting (0, ('Mimi', 'Poodle'))

Re: Of Functions, Objects, and Methods-I NEED HELP PLEASE

2011-06-08 Thread John Gordon
In mailman.30.1307563778.11593.python-l...@python.org Cathy James nambo...@gmail.com writes: b) I would like to append to my list, but my line dogs.dogAppend() is giving a TypeError: for i in enumerate (self.dogAppend()): TypeError: 'list' object is not callable def dogAppend(self):

Re: Bloom Filter in 22 lines of Python (updated)

2011-06-08 Thread geremy condra
On Wed, Jun 8, 2011 at 1:05 PM, Raymond Hettinger pyt...@rcn.com wrote: On Jun 6, 10:47 am, geremy condra debat...@gmail.com wrote: On Fri, Jun 3, 2011 at 1:17 PM, Raymond Hettinger pyt...@rcn.com wrote: Thanks for all the feedback on the earlier post. I've updated the recipe to use a

Re: pthreads in C++ with embedded Python

2011-06-08 Thread Jason Tackaberry
On 11-06-07 07:29 PM, Tom Brown wrote: Any suggestions will be appreciated. Why are you calling PyEval_ReleaseLock() in the CmdThread constructor? This looks suspicious. Also, I don't see where CmdThread::lock() and CmdThread::unlock() are being invoked in your example. Relics from your

Calling a matlab gui from python using pymatlab without allowing python to close it

2011-06-08 Thread Ven
Before proceeding further, my system configuration is as follows: Mac OS X 10.6.6 MATLAB 2010b ActiveState Python 2.7 I have a gui built using matlab. I wrote the following python script to open that matlab gui using pymatlab python module: from pymatlab.matlab import MatlabSession session =

Re: pthreads in C++ with embedded Python

2011-06-08 Thread Tom Brown
On Wed, Jun 8, 2011 at 2:11 PM, Jason Tackaberry t...@urandom.ca wrote: On 11-06-07 07:29 PM, Tom Brown wrote: Any suggestions will be appreciated. Why are you calling PyEval_ReleaseLock() in the CmdThread constructor? This looks suspicious. Also, I don't see where CmdThread::lock() and

Re: Problems Compiling Python 2.6.7 for Win7

2011-06-08 Thread Gabriel Genellina
En Wed, 08 Jun 2011 12:28:56 -0300, Jay Osako josephos...@gmail.com escribió: I have been trying to get PyODBC to work with Python 2.6 (the latest version it is known to be compatible with) and Django, but have run into a problem which, according to the information I've got elsewhere,

Re: pthreads in C++ with embedded Python

2011-06-08 Thread Jason Tackaberry
On 11-06-08 06:28 PM, Tom Brown wrote: I found that PyEval_ReleaseLock() was necessary to keep the program from hanging. The lock() and unlock() methods were used in a previous attempt to lock/unlock the GIL. I just tried your example code and indeed it segfaults as is, but works fine for me

the stupid encoding problem to stdout

2011-06-08 Thread Sérgio Monteiro Basto
hi, cat test.py #!/usr/bin/env python #-*- coding: utf-8 -*- u = u'moçambique' print u.encode(utf-8) print u chmod +x test.py ./test.py moçambique moçambique ./test.py output.txt Traceback (most recent call last): File ./test.py, line 5, in module print u UnicodeEncodeError: 'ascii'

Re: how to avoid leading white spaces

2011-06-08 Thread Chris Torek
On 03/06/2011 03:58, Chris Torek wrote: - This is a bit surprising, since both s1 in s2 and re.search() could use a Boyer-Moore-based algorithm for a sufficiently-long fixed string, and the time required should be proportional to that needed to

Re: The pythonic way equal to whoami

2011-06-08 Thread Nobody
On Wed, 08 Jun 2011 21:58:17 +0800, TheSaint wrote: os.geteuid This return 0 for *root* . I don't know if it's a standard for all distro. UID 0 is the superuser. The name root is conventional, but it's the EUID (effective UID) which is used in permission checks; the kernel doesn't care about

Re: the stupid encoding problem to stdout

2011-06-08 Thread Ben Finney
Sérgio Monteiro Basto sergi...@sapo.pt writes: ./test.py moçambique moçambique In this case your terminal is reporting its encoding to Python, and it's capable of taking the UTF-8 data that you send to it in both cases. ./test.py output.txt Traceback (most recent call last): File

Re: the stupid encoding problem to stdout

2011-06-08 Thread Benjamin Kaplan
2011/6/8 Sérgio Monteiro Basto sergi...@sapo.pt: hi, cat test.py #!/usr/bin/env python #-*- coding: utf-8 -*- u = u'moçambique' print u.encode(utf-8) print u chmod +x test.py ./test.py moçambique moçambique ./test.py output.txt Traceback (most recent call last):  File ./test.py,

Re: The pythonic way equal to whoami

2011-06-08 Thread Cameron Simpson
On 07Jun2011 20:22, Nitin Pawar nitinpawar...@gmail.com wrote: | import getpass | user = getpass.getuser() | | On Tue, Jun 7, 2011 at 7:54 PM, TheSaint nob...@nowhere.net.no wrote: | I was trying to find out whose the program launcher, but os.environ['USER'] | returns the user whom owns the

test_popen

2011-06-08 Thread harrismh777
Looks like my 2.7 test_popen failure is an open issue7671... since Jan 2010. Looks like it really does function ok. At any rate, I was able to test Popen myself today, and it ran fine. I needed to write a script that will disable the touch pad on this HP g series, because there is no way to

[issue12282] ABCMeta import error during build

2011-06-08 Thread Ned Deily
Ned Deily n...@acm.org added the comment: It's being called for hg: -DHGVERSION=\`LC_ALL=C hg id -i .`\ ... -- nosy: +ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12282 ___

[issue12197] non-blocking SSL write in Windows sends large data but raises exception

2011-06-08 Thread David Siroky
David Siroky sir...@dasir.cz added the comment: Sorry, I attached wrong example version. It uses repeated sslsock.write() of the same buffer after catching SSL_ERROR_WANT_WRITE. It delivers the full block but this is a blocking operation. I'm troubled with non-blocking writes. But as I dig

[issue12283] python3.2 smtplib _quote_periods

2011-06-08 Thread DDarko
New submission from DDarko ddarko...@gmail.com: File /usr/lib/python3.2/smtplib.py, line 166, in _quote_periods def _quote_periods(bindata): return re.sub(br'(?m)^\.', '..', bindata) should be: return re.sub(br'(?m)^\.', b'..', bindata) -- components: Extension Modules messages:

[issue12283] python3.2 smtplib _quote_periods

2011-06-08 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- components: +Library (Lib) -Extension Modules nosy: +r.david.murray stage: - patch review type: - behavior versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org

[issue11941] Support st_atim, st_mtim and st_ctim attributes in os.stat_result

2011-06-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I'm not sure if that's deliberate, but the new attributes don't appear in the result repr(): s = os.stat(LICENSE) s posix.stat_result(st_mode=33204, st_ino=524885, st_dev=2053, st_nlink=1, st_uid=500, st_gid=500, st_size=14597,

[issue11277] Crash with mmap and sparse files on Mac OS X

2011-06-08 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: Ok, this patch could be used. *Unless* the code is not protected by the GIL. - Gestalt usage is a bit more complicated according to http://www.cocoadev.com/index.pl?DeterminingOSVersion unless Python only supports OS X

[issue11277] Crash with mmap and sparse files on Mac OS X

2011-06-08 Thread Steffen Daode Nurpmeso
Changes by Steffen Daode Nurpmeso sdao...@googlemail.com: Removed file: http://bugs.python.org/file22273/11277.apple-fix.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11277 ___

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-08 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: mbcs.patch fixes PyUnicode_DecodeMBCS(): - only use flags=0 if errors=replace on Windows = Vista or if errors=ignore on Windows Vista - support any error handler - support any code page (but the code page is hardcoded to CP_ACP)

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-08 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Example with ANSI=cp932 (on Windows Seven): - b'abc\xffdef'.decode('mbcs', 'replace') gives 'abc\uf8f3def' - b'abc\xffdef'.decode('mbcs', 'ignore') gives 'abcdef' -- nosy: +ocean-city

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-08 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Example with ANSI=cp932 (on Windows Seven): - b'abc\xffdef'.decode('mbcs', 'replace') gives 'abc\uf8f3def' - b'abc\xffdef'.decode('mbcs', 'ignore') gives 'abcdef' Oh, and b'\xff'.decode('mbcs', 'surrogateescape') gives '\udcff'

[issue12284] argparse.ArgumentParser: usage example option

2011-06-08 Thread Jonas H.
New submission from Jonas H. jo...@lophus.org: I'd like to see an `examples` option added to argparse.ArgumentParser as found in many man pages. This could also be done using the `epilog` option, but that misses the %(proc)s replacement which makes usage examples like this Example usage:

[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2011-06-08 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: As Raymond noted though, some of the block stack fiddling doesn't make sense until after the bytecode has already been generated. It's OK to have multiple optimisers at different layers, each taking care of the elements that are best suited

[issue11277] Crash with mmap and sparse files on Mac OS X

2011-06-08 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: Steffen: _mac_ver_xml should not be dropped, it is a perfectly fine way to determine the system version. Discussing it is also off-topic for this issue, please keep the discussion focussed. Wrt. mailing Apple: I wouldn't expect and

[issue12285] Unexpected behavior for 0 or negative processes in multiprocessing.pool()

2011-06-08 Thread Jorgen Skancke
New submission from Jorgen Skancke jor...@nt.ntnu.no: A normal way to start a multiprocessing-pool is like this: Multiprocessing.Pool(processes=some_number). However, if 'some_number' is 0 or negative, Python hangs and must be killed. I would expect an error message of the type: Number of

[issue12284] argparse.ArgumentParser: usage example option

2011-06-08 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +bethard ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12284 ___ ___ Python-bugs-list

[issue12282] ABCMeta import error during build

2011-06-08 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: As far as I can tell my python2.7 installation is fine and bug free. hg is working fine when called from the command line. -- ___ Python tracker rep...@bugs.python.org

[issue12279] Add build_distinfo command to packaging

2011-06-08 Thread higery
higery shoulderhig...@gmail.com added the comment: Now, the workaround of my code is just setting the 'distinfo-dir' option with os.curdir value through calling a 'reinitialize_command(self, command, reinit_subcommands=False, **kw)' function , which is added in packaging's Command class for

[issue12282] build process adds CWD (null entry) to PYTHONPATH if PYTHONPATH is set in the build environment

2011-06-08 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: It turns out that I had a stray abc.py file in my current working directory as the result of some previous tests of module-load-order rules. That by itself wouldn't have triggered the problem, but in addition, I have PYTHONPATH set in

[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2011-06-08 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 6d6099f7fe89 by Antoine Pitrou in branch 'default': Issue #9205: concurrent.futures.ProcessPoolExecutor now detects killed http://hg.python.org/cpython/rev/6d6099f7fe89 -- nosy: +python-dev

[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2011-06-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: So, concurrent.futures is fixed now. Unless someone wants to patch multiprocessing.Pool, I am closing this issue. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed

[issue12021] mmap.read requires an argument

2011-06-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Patch looks good to me, thank you :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12021 ___

[issue12187] subprocess.wait() with a timeout uses polling on POSIX

2011-06-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Why not use signalfd() when available? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12187 ___

[issue12197] non-blocking SSL write in Windows sends large data but raises exception

2011-06-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Sorry, I attached wrong example version. It uses repeated sslsock.write() of the same buffer after catching SSL_ERROR_WANT_WRITE. It delivers the full block but this is a blocking operation. In normal non-blocking code you would use select()

[issue12021] mmap.read requires an argument

2011-06-08 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 964d0d65a2a9 by Charles-François Natali in branch 'default': Issue #12021: Make mmap's read() method argument optional. Patch by Petri http://hg.python.org/cpython/rev/964d0d65a2a9 -- nosy: +python-dev

[issue12286] float('nan') breaks sort() method on a list of floats

2011-06-08 Thread Johann C. Rocholl
New submission from Johann C. Rocholl jcroch...@google.com: l = [1.0, 2.0, 3.0, float('nan'), 4.0, 3.0, 2.0, 1.0] l.sort() l [1.0, 2.0, 3.0, nan, 1.0, 2.0, 3.0, 4.0] The expected result is either of the following: [nan, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0] (similar to None) [1.0, 1.0, 2.0,

[issue12286] float('nan') breaks sort() method on a list of floats

2011-06-08 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: This is expected. See also #11986 and #11949. -- nosy: +belopolsky, ezio.melotti, mark.dickinson, rhettinger resolution: - invalid stage: - committed/rejected status: open - closed ___ Python

[issue12021] mmap.read requires an argument

2011-06-08 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: Patch committed. Thanks for the report and the patch! -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue12286] float('nan') breaks sort() method on a list of floats

2011-06-08 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: This is actually a duplicate of issue7915. I don't think there is nothing we can do to improve the situation. In fact discussion at #11949 ends with a +0 from Mark Dickinson to issue a warning whenever nans participate

[issue12197] non-blocking SSL write in Windows sends large data but raises exception

2011-06-08 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12197 ___ ___

[issue12187] subprocess.wait() with a timeout uses polling on POSIX

2011-06-08 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12187 ___ ___

[issue8407] expose signalfd(2) and pthread_sigmask in the signal module

2011-06-08 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8407 ___ ___

[issue1195571] simple callback system for Py_FatalError

2011-06-08 Thread Tom Whittock
Changes by Tom Whittock tom.whitt...@gmail.com: -- nosy: +Tom.Whittock ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195571 ___ ___

[issue1195571] simple callback system for Py_FatalError

2011-06-08 Thread Gregory P. Smith
Gregory P. Smith g...@krypto.org added the comment: This makes sense, I'll add it to 3.3. -- assignee: - gregory.p.smith nosy: +gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195571

[issue12287] ossaudiodev: stack corruption with FD = FD_SETSIZE

2011-06-08 Thread Charles-François Natali
New submission from Charles-François Natali neolo...@free.fr: ossaudiodev's writeall method doesn't check that the FD is less than FD_SETSIZE when passing it to FD_SET: since FD_SET typically doesn't do bound check, it will write to a random location in memory (in this case on the stack). I've

[issue12287] ossaudiodev: stack corruption with FD = FD_SETSIZE

2011-06-08 Thread Charles-François Natali
Changes by Charles-François Natali neolo...@free.fr: Added file: http://bugs.python.org/file22285/test_oss.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12287 ___

[issue12287] ossaudiodev: stack corruption with FD = FD_SETSIZE

2011-06-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: ossaudiodev's writeall method doesn't check that the FD is less than FD_SETSIZE when passing it to FD_SET: since FD_SET typically doesn't do bound check, it will write to a random location in memory (in this case on the stack). I've attached

[issue12288] Python 2.7.1 tkSimpleDialog initialvalue

2011-06-08 Thread Tom Middleton
New submission from Tom Middleton busfa...@gmail.com: Using Tkinter under Python 2.7.1 (Windows XP FWIF) If using the tkSimpleDialog.askinteger() function with an initialvalue = 0, the 0 is not displayed in the dialog box. The same is true for tkSimpleDialog.askfloat(). The cause of this

[issue1195571] simple callback system for Py_FatalError

2011-06-08 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: fatalhook-2.patch: I don't understand the documentation. It says Cause :cfunc:`Py_FatalError` to invoke the given function instead of printing to standard error and aborting out of the process., but if the callback does nothing,

[issue12287] ossaudiodev: stack corruption with FD = FD_SETSIZE

2011-06-08 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: You don't check that 0 = fd (e.g. oss.close()). The select has a specific code for Visual Studio (don't check v FD_SETSIZE): #if defined(_MSC_VER) max = 0; /* not used for Win32 */ #else /*

  1   2   >