Floating point multiplication in python

2011-09-06 Thread xyz
hi all: As we know , 1.1 * 1.1 is 1.21 . But in python ,I got following : 1.1 * 1.1 1.2102 why python get wrong result? Who can tell me where's the 0.0002 from? -- http://mail.python.org/mailman/listinfo/python-list

Re: Floating point multiplication in python

2011-09-06 Thread Chris Rebert
On Mon, Sep 5, 2011 at 10:57 PM, xyz xyzh...@163.com wrote: hi all: As we know ,  1.1 * 1.1 is 1.21 . But in python ,I got following : 1.1 * 1.1 1.2102 why python get wrong result? It's not Python's fault per se, rather it's the inherent nature of binary floating-point

Re: Floating point multiplication in python

2011-09-06 Thread Gary Herron
On 09/05/2011 10:57 PM, xyz wrote: hi all: As we know , 1.1 * 1.1 is 1.21 . But in python ,I got following : 1.1 * 1.1 1.2102 why python get wrong result? Who can tell me where's the 0.0002 from? It's not a python errorIt's the nature of floating point

Re: One line command line filter

2011-09-06 Thread John Wiegley
Jon Redgrave jredgr...@capisco.com writes: It seems unreasonably hard to write simple one-line unix command line filters in python: eg: ls | python -c something print x.upper() [...] Is there a better solution - if not is this worth a PEP? Have you looked at PyP

Re: Floating point multiplication in python

2011-09-06 Thread Steven D'Aprano
On Tue, 6 Sep 2011 03:57 pm xyz wrote: hi all: As we know , 1.1 * 1.1 is 1.21 . But in python ,I got following : 1.1 * 1.1 1.2102 The problem is that 1.1 is a *decimal* number, but computers use *binary*, and it is impossible to express 1.1 exactly as a binary number. So

Re: One line command line filter

2011-09-06 Thread Peter Otten
Jon Redgrave wrote: It seems unreasonably hard to write simple one-line unix command line filters in python: eg: ls | python -c something print x.upper() to get at sys.stdin or similar needs an import, which makes a subsequent for-loop illegal. python -c import sys; for x in

strang thing:

2011-09-06 Thread 守株待兔
i found stange thing that i can't solve import os import csv for name in os.listdir('/tmp/quote/'): filename='/tmp/quote/'+name file = open(filename,'r') file.readline() for row in csv.reader(file): print row[0], row[1], row[2], row[3],row[4], row[5],

Relative seeks on string IO

2011-09-06 Thread Pierre Quentel
Hi, I am wondering why relative seeks fail on string IO in Python 3.2 Example : from io import StringIO txt = StringIO('Favourite Worst Nightmare') txt.seek(8) # no problem with absolute seek but txt.seek(2,1) # 2 characters from current position raises IOError: Can't do

Re: strang thing:

2011-09-06 Thread Chris Angelico
2011/9/6 守株待兔 1248283...@qq.com:     file = open(filename,'r') when i  add    (date,open,high,low,close,vol,adjclose) = (row[0], row[1], You're assigning to the name open, which is shadowing the built-in of the same name. The second time through the loop, you're not calling the usual open()

Re: strang thing:

2011-09-06 Thread Wolfgang Rohdewald
On Dienstag 06 September 2011, 守株待兔 wrote: (date,open,high,low,close,vol,adjclose) = (row[0], row[1], row[2], row[3],row[4], row[5], row[6]) print row[0], row[1], row[2], row[3],row[4], row[5], row[6] the wrong output is : file = open(filename,'r') TypeError: 'str'

Re: Floating point multiplication in python

2011-09-06 Thread Duncan Booth
Gary Herron gher...@islandtraining.com wrote: (But try: print 1.1*1.1 and see that the print statement does hide the roundoff error from you.) That varies according to the version of Python you are using. On my system: Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit

Portable locale usage

2011-09-06 Thread ssegvic
Hi, I am musing on how to write portable Python3 code which would take advantage of the standard locale module. For instance, it would be very nice if we could say something like: # does not work! myISOCountryCode='hr' locale.setlocale(locale.LC_ALL, (myISOCountryCode,

Re: Floating point multiplication in python

2011-09-06 Thread Thomas Rachel
Am 06.09.2011 07:57 schrieb xyz: hi all: As we know , 1.1 * 1.1 is 1.21 . But in python ,I got following : 1.1 * 1.1 1.2102 why python get wrong result? Who can tell me where's the 0.0002 from? 1.1 does not fit in a binary floating point number. It is

Re: Portable locale usage

2011-09-06 Thread Thomas Jollans
On 06/09/11 11:59, ssegvic wrote: Hi, I am musing on how to write portable Python3 code which would take advantage of the standard locale module. For instance, it would be very nice if we could say something like: # does not work! Doesn't it? myISOCountryCode='hr' This is a language

Re: One line command line filter

2011-09-06 Thread Hans Mulder
On 6/09/11 01:18:37, Steven D'Aprano wrote: Terry Reedy wrote: The doc says -ccommand Execute the Python code in command. command can be one or more statements separated by newlines, However, I have no idea how to put newlines into a command-line string. I imagine that it depends on the

Re: Installing WebDAV server

2011-09-06 Thread becky_lewis
On Sep 5, 3:51 pm, Fokke Nauta fnaut...@spamsolfon.nl wrote: Hi Becky, I tried it straight away: directory=D:\Webdav\ directory=D:/Webdav/ Didn't work, in both cases the same error fshandler:get_data: \Webdav not found. I have the opinion that my WebDAV installation is at fault. The

Beginner's query - What is scope of Python for Embedded Programming(C, C++) ?

2011-09-06 Thread Santosh Dumbre
Hi, Please consider a beginner's query - I am 9 -years experienced in C++. Currently working in Automation domain. Will Python help me to work in Automation/Embedded domain ? Your advice is highly appreciated. Please reply. Thanks a lot, Santosh. --

Re: Running Python Demo on the Web?

2011-09-06 Thread Colin J. Williams
On 05-Sep-11 18:00 PM, Python Fiddle Admin wrote: Python has been ported to the web browser at pythonfiddle.com. Python Fiddle can import snippets of code that you are reading on a web page and run them in the browser. It supports a few popular libraries. Another common usage is to post code on

Re: Running Python Demo on the Web?

2011-09-06 Thread becky_lewis
On Sep 5, 11:00 pm, Python Fiddle Admin pythonfid...@gmail.com wrote: Python has been ported to the web browser at pythonfiddle.com. Python Fiddle can import snippets of code that you are reading on a web page and run them in the browser. It supports a few popular libraries. Another common

HDF5 tree walker

2011-09-06 Thread Alex van der Spek
Is there an equivalent to os.path.walk() for HDF5 file trees accessed through h5py? Thanks! Alex van der Spek -- http://mail.python.org/mailman/listinfo/python-list

Python marks an instance of my class undefined

2011-09-06 Thread Kayode Odeyemi
Is there anything I need to do to create an instance of a class? I have this simple code(The class is in a package core.fleet): class Fleet(object): def __init__(self): no-arg constructor def fleet_file_upload(self, filename, type=None): if type == 'user':

Re: Portable locale usage

2011-09-06 Thread Vlastimil Brom
2011/9/6 ssegvic sinisa.seg...@fer.hr: Hi, I am musing on how to write portable Python3 code which would take advantage of the standard locale module. For instance, it would be very nice if we could say something like: # does not work! myISOCountryCode='hr'

Representation of floats (- Mark Dickinson?)

2011-09-06 Thread jmfauth
This is just an attempt to put the http://groups.google.com/group/comp.lang.python/browse_thread/thread/a008af1ac2968833# discussion at a correct level. With Python 2.7 a new float number representation (the David Gay's algorithm) has been introduced. If this is well honored in Python 2.7, it

Re: Python marks an instance of my class undefined

2011-09-06 Thread Kayode Odeyemi
I was able to get this solved by calling class like this: from core.fleet import Fleet f = Fleet() Thanks to a thread from the list titled TypeError: 'module' object is not callable On Tue, Sep 6, 2011 at 2:02 PM, Kayode Odeyemi drey...@gmail.com wrote: Is there anything I need to do to

Re: Python marks an instance of my class undefined

2011-09-06 Thread Laszlo Nagy
On 2011-09-06 15:42, Kayode Odeyemi wrote: I was able to get this solved by calling class like this: from core.fleet import Fleet f = Fleet() Thanks to a thread from the list titled TypeError: 'module' object is not callable Or you can also do this: import core.fleet # import module

Re: Python marks an instance of my class undefined

2011-09-06 Thread Kayode Odeyemi
On Tue, Sep 6, 2011 at 3:18 PM, Laszlo Nagy gand...@shopzeus.com wrote: On 2011-09-06 15:42, Kayode Odeyemi wrote: I was able to get this solved by calling class like this: from core.fleet import Fleet f = Fleet() Thanks to a thread from the list titled TypeError: 'module' object is not

Re: Installing WebDAV server

2011-09-06 Thread Fokke Nauta
becky_lewis bex.le...@gmail.com wrote in message news:f5b9ec16-de9a-4365-81a8-860dc27a9...@d25g2000yqh.googlegroups.com... On Sep 5, 3:51 pm, Fokke Nauta fnaut...@spamsolfon.nl wrote: Hi Becky, I tried it straight away: directory=D:\Webdav\ directory=D:/Webdav/ Didn't work, in both cases

Re: Portable locale usage

2011-09-06 Thread ssegvic
On 6 ruj, 13:16, Thomas Jollans t...@jollybox.de wrote: locale.setlocale(locale.LC_ALL, (myISOCountryCode, locale.getpreferredencoding())) As far as I can tell, this does work. Can you show us a traceback? Sorry, I was imprecise. I wanted to say that the above snippet does not work both on

Re: Python marks an instance of my class undefined

2011-09-06 Thread Hans Mulder
On 6/09/11 16:18:32, Laszlo Nagy wrote: On 2011-09-06 15:42, Kayode Odeyemi wrote: I was able to get this solved by calling class like this: from core.fleet import Fleet f = Fleet() Thanks to a thread from the list titled TypeError: 'module' object is not callable Or you can also do this:

Re: Portable locale usage

2011-09-06 Thread ssegvic
On 6 ruj, 15:13, Vlastimil Brom vlastimil.b...@gmail.com wrote: There may be some differences btween OSes end the versions, but using python 2.7 and 3.2 on Win XP and Win7 (Czech) I get the following results for setlocale: locale.setlocale(locale.LC_ALL,'Croatian') 'Croatian_Croatia.1250'

Re: Portable locale usage

2011-09-06 Thread Thomas Jollans
On 06/09/11 16:46, ssegvic wrote: For the moment, I only wish to properly sort a Croatian text file both on Windows and Linux (I am a cautious guy, I like reachable goals). When the locale is properly set, sorting works like a charm with mylist.sort(key=locale.strxfrm). The problem with that

Re: Floating point multiplication in python

2011-09-06 Thread Thomas 'PointedEars' Lahn
Thomas Rachel wrote: Now if you multiply two values with an error, the error also propagates into the result - PLUs the result can have its own error source - in the same order of magnitude. (a+e) * (a+e) = a*a + 2*a*e + e*e. So your new error term is 2*a*e + e*e or (2*a + e) * e. Your

PEP 20 - Silly Question?

2011-09-06 Thread Joseph Armbruster
I have used Python for some time and ran a windows build-bot for a bit. This morning, I told a fellow developer There should be only one obvious way to do it. and then I proceeded to forward him to the Zen of Python and sent him a link to: http://www.python.org/dev/peps/pep-0020/ I noticed that

Re: PEP 20 - Silly Question?

2011-09-06 Thread Eric Snow
On Tue, Sep 6, 2011 at 10:17 AM, Joseph Armbruster josepharmbrus...@gmail.com wrote: I have used Python for some time and ran a windows build-bot for a bit.  This morning, I told a fellow developer There should be only one obvious way to do it. and then I proceeded to forward him to the Zen of

Re: PEP 20 - Silly Question?

2011-09-06 Thread Zero Piraeus
: On 6 September 2011 12:17, Joseph Armbruster josepharmbrus...@gmail.com wrote: I noticed that it says only 19 of 20 have been written down.  Which one was not written down? The last one. -[]z. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 20 - Silly Question?

2011-09-06 Thread Peter Otten
Joseph Armbruster wrote: I have used Python for some time and ran a windows build-bot for a bit. This morning, I told a fellow developer There should be only one obvious way to do it. and then I proceeded to forward him to the Zen of Python and sent him a link to:

Advice on how to get started with 2D-plotting ?

2011-09-06 Thread Fred Pacquier
Hi, I'm a Python long-timer, but I've never had to use tools like Matplotlib others before. Now, for my work, I would need to learn the basics fast, for a one-time quick-n-dirty job. This involves a graphic comparison of RFC1918 IP subnets allocation across several networks. The idea is to

Re: Installing WebDAV server

2011-09-06 Thread Fokke Nauta
Dennis Lee Bieber wlfr...@ix.netcom.com wrote in message news:mailman.809.1315328739.27778.python-l...@python.org... On Tue, 6 Sep 2011 16:46:17 +0200, Fokke Nauta fnaut...@spamsolfon.nl declaimed the following in gmane.comp.python.general: ---

Re: Tkinter label height to fit content

2011-09-06 Thread Bart Kastermans
I build on the suggestion by rantingrick, but took it in a bit different direction. I now have working code that performs reasonable. The reason for the class lines (as opposed to just a function) is b/c font.measure appears not that fast. So I want to remember between different calls to

Re: Relative seeks on string IO

2011-09-06 Thread Terry Reedy
On 9/6/2011 3:18 AM, Pierre Quentel wrote: I am wondering why relative seeks fail on string IO in Python 3.2 Good question. from io import StringIO txt = StringIO('Favourite Worst Nightmare') txt.seek(8) # no problem with absolute seek Please post code without non-code

Re: Portable locale usage

2011-09-06 Thread garabik-news-2005-05
Thomas Jollans t...@jollybox.de wrote: It looks like you don't actually care about the encoding: in your first example, you use the default system encoding, which you do not control, and in your second example, you're using two different encodings on the two platforms. So why do you care

Re: Tkinter label height to fit content

2011-09-06 Thread rantingrick
Hmm, i can replace all that code with this... # # Easy_as.py # import Tkinter as tk from ScrolledText import ScrolledText import tkFont import random # Create some puesdo data. data = [ '{0}.{1}'.format(x, 'blah'*random.randint(4, 50)) for x in range(100) ] ##print data # Create the

import os or import os.path

2011-09-06 Thread Jabba Laci
Hi, If I want to use the 'os.path' module, it's enought to import 'os': import os if os.path.isfile('/usr/bin/bash'): print 'got it' In other source codes I noticed that people write 'import os.path' in this case. Which is better practice? Thanks, Laszlo --

Re: Tkinter label height to fit content

2011-09-06 Thread rantingrick
Or if you prefer the alternating background approach... ## # Easy_as.py ## import Tkinter as tk from ScrolledText import ScrolledText import tkFont import random END = 'end' INSERT = 'insert' # # Create some puesdo data. data = [ '{0}.{1}'.format(x,

Re: import os or import os.path

2011-09-06 Thread Ian Kelly
On Tue, Sep 6, 2011 at 3:25 PM, Jabba Laci jabba.l...@gmail.com wrote: Hi, If I want to use the 'os.path' module, it's enought to import 'os': import os if os.path.isfile('/usr/bin/bash'):    print 'got it' In other source codes I noticed that people write 'import os.path' in this case.

MIMEText encode error - Python 2.6.6

2011-09-06 Thread neubyr
I am trying to write a program which can email file's content using smtplib. I am getting following error while using Python 2.6.6 version. {{{ File ./killed_jobs.py, line 88, in sendmail msg = MIMEText(ipfile.read, 'plain') File /home/ssp/sge/python/2.6.6/lib/python2.6/email/mime/text.py,

Re: Tkinter label height to fit content

2011-09-06 Thread Bart Kastermans
rantingrick rantingr...@gmail.com writes: Hmm, i can replace all that code with this... Because I stupidly forgot to repeat the original problem I had, and my code doesn't show it (and doesn't show the correct use of the function I wrote). The code shows that I now know how to compute the

Re: Advice on how to get started with 2D-plotting ?

2011-09-06 Thread rantingrick
On Sep 6, 1:27 pm, Fred Pacquier xne...@fredp.lautre.net wrote: I'm a Python long-timer, but I've never had to use tools like Matplotlib others before. Now, for my work, I would need to learn the basics fast, for a one-time quick-n-dirty job. ## ## START SCRIPT ##

Re: MIMEText encode error - Python 2.6.6

2011-09-06 Thread MRAB
On 06/09/2011 22:52, neubyr wrote: I am trying to write a program which can email file's content using smtplib. I am getting following error while using Python 2.6.6 version. {{{ File ./killed_jobs.py, line 88, in sendmail msg = MIMEText(ipfile.read, 'plain') File

Re: Tkinter label height to fit content

2011-09-06 Thread rantingrick
On Sep 6, 5:00 pm, Bart Kastermans bkast...@gmail.com wrote: rantingrick rantingr...@gmail.com writes: Hmm, i can replace all that code with this... Because I stupidly forgot to repeat the original problem I had, and my code doesn't show it (and doesn't show the correct use of the function I

Re: Tkinter label height to fit content

2011-09-06 Thread rantingrick
On Sep 6, 5:40 pm, rantingrick rantingr...@gmail.com wrote: On Sep 6, 5:00 pm, Bart Kastermans bkast...@gmail.com wrote: Take your input data and replace ALL single newlines with null strings CORRECTION: Take your input data and replace ALL single newlines with A SINGLE SPACE --

Re: Tkinter label height to fit content

2011-09-06 Thread Bart Kastermans
rantingrick rantingr...@gmail.com writes: On Sep 6, 5:00 pm, Bart Kastermans bkast...@gmail.com wrote: rantingrick rantingr...@gmail.com writes: Hmm, i can replace all that code with this... Because I stupidly forgot to repeat the original problem I had, and my code doesn't show it (and

Re: PEP 20 - Silly Question?

2011-09-06 Thread Ben Finney
Zero Piraeus sche...@gmail.com writes: On 6 September 2011 12:17, Joseph Armbruster josepharmbrus...@gmail.com wrote: I noticed that it says only 19 of 20 have been written down.  Which one was not written down? The last one. I always thought it was the first one. Or the 6.25th one, I

Re: Can't use subprocess.Popen() after os.chroot() - why?

2011-09-06 Thread Nobody
On Sun, 04 Sep 2011 07:22:07 -0700, Erik wrote: I'm trying to do the following: os.chroot(/tmp/my_chroot) p = Popen(/bin/date, stdin=PIPE, stdout=PIPE, stderr=PIPE) but the Popen call is dying with the following exception: LookupError: unknown encoding: string-escape Am I missing

Re: import os or import os.path

2011-09-06 Thread Mark Hammond
On 7/09/2011 7:47 AM, Ian Kelly wrote: On Tue, Sep 6, 2011 at 3:25 PM, Jabba Lacijabba.l...@gmail.com wrote: Hi, If I want to use the 'os.path' module, it's enought to import 'os': import os if os.path.isfile('/usr/bin/bash'): print 'got it' In other source codes I noticed that people

Re: PEP 20 - Silly Question?

2011-09-06 Thread MRAB
On 07/09/2011 01:36, Ben Finney wrote: Zero Piraeussche...@gmail.com writes: On 6 September 2011 12:17, Joseph Armbrusterjosepharmbrus...@gmail.com wrote: I noticed that it says only 19 of 20 have been written down. Which one was not written down? The last one. I always thought it was

Re: PEP 20 - Silly Question?

2011-09-06 Thread Joshua Miller
You sure it wasn't the invisible one? you know the one in the white text that blends into the background? On Tue, Sep 6, 2011 at 9:25 PM, MRAB pyt...@mrabarnett.plus.com wrote: On 07/09/2011 01:36, Ben Finney wrote: Zero Piraeussche...@gmail.com  writes: On 6 September 2011 12:17, Joseph

Looking for open-source Python projects to help out with

2011-09-06 Thread Littlefield, Tyler
Hello: I've got a bit of time on my hands, so I'm curious what sorts of projects there are that people needs help with. I'd like to choose something that doesn't have a ton of red tape, but is stable, which is why I ask here instead of just Googling open source projects. My main interests lie

Re: strange thing:

2011-09-06 Thread W. eWatson
CA, Did you respond to my off-NG msg about FORTRAN? Perhaps it's caught in my spam on the net. -- http://mail.python.org/mailman/listinfo/python-list

Re: strange thing:

2011-09-06 Thread Chris Angelico
On Wed, Sep 7, 2011 at 12:43 PM, W. eWatson wolftra...@invalid.com wrote: CA, Did you respond to my off-NG msg about FORTRAN? Perhaps it's caught in my spam on the net. No, I didn't; as someone else pointed out, you'll get better results asking on a dedicated Fortran list. ChrisA --

Re: import os or import os.path

2011-09-06 Thread Joe Riopel
On Tue, Sep 6, 2011 at 5:25 PM, Jabba Laci jabba.l...@gmail.com wrote: Hi, If I want to use the 'os.path' module, it's enought to import 'os': import os if os.path.isfile('/usr/bin/bash'):    print 'got it' In other source codes I noticed that people write 'import os.path' in this case.

Re: Representation of floats (- Mark Dickinson?)

2011-09-06 Thread casevh
On Sep 6, 6:37 am, jmfauth wxjmfa...@gmail.com wrote: This is just an attempt to put thehttp://groups.google.com/group/comp.lang.python/browse_thread/thread/... discussion at a correct level. With Python 2.7 a new float number representation (the David Gay's algorithm) has been introduced.

Re: sqlite3 with context manager

2011-09-06 Thread Tim Arnold
On 9/3/2011 3:03 AM, Carl Banks wrote: On Friday, September 2, 2011 11:43:53 AM UTC-7, Tim Arnold wrote: Hi, I'm using the 'with' context manager for a sqlite3 connection: with sqlite3.connect(my.database,timeout=10) as conn: conn.execute('update config_build set

Re: Floating point multiplication in python

2011-09-06 Thread Steven D'Aprano
On Wed, 7 Sep 2011 02:07 am Thomas 'PointedEars' Lahn wrote: Thomas Rachel wrote: Now if you multiply two values with an error, the error also propagates into the result - PLUs the result can have its own error source - in the same order of magnitude. (a+e) * (a+e) = a*a + 2*a*e + e*e.

Re: strange thing:

2011-09-06 Thread W. eWatson
On 9/6/2011 7:48 PM, Chris Angelico wrote: On Wed, Sep 7, 2011 at 12:43 PM, W. eWatsonwolftra...@invalid.com wrote: CA, Did you respond to my off-NG msg about FORTRAN? Perhaps it's caught in my spam on the net. No, I didn't; as someone else pointed out, you'll get better results asking on a

[issue12850] [PATCH] stm.atomic

2011-09-06 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12850 ___ ___ Python-bugs-list

[issue12906] Slight error in logging module's yaml config

2011-09-06 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- assignee: docs@python - vinay.sajip nosy: +vinay.sajip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12906 ___

[issue12905] multiple errors in test_socket on OpenBSD

2011-09-06 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: I hope that this issue is not related to threads+signals. We got many threads+signals issues on FreeBSD 6. Yep. OpenBSD has a really specific pthread implementation (in user-space, using non-blocking I/O), so it might very well be

[issue12904] Change os.utime c functions to use nanosecond precision where possible

2011-09-06 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: The patch looks fine to me. -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12904 ___

[issue12909] Inconsistent exception usage in PyLong_As* C functions

2011-09-06 Thread Nadeem Vawda
New submission from Nadeem Vawda nadeem.va...@gmail.com: The C functions for converting a Python 'int' object to a C integer are inconsistent about what exception gets raised when the object passed to them is not an integer. Most of these functions raise a TypeError, but

[issue12909] Inconsistent exception usage in PyLong_As* C functions

2011-09-06 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +mark.dickinson, rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12909 ___ ___

[issue12567] curses implementation of Unicode is wrong in Python 3

2011-09-06 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 786668a4fb6b by Victor Stinner in branch 'default': Issue #12567: Fix curses.unget_wch() tests http://hg.python.org/cpython/rev/786668a4fb6b -- ___ Python tracker

[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-09-06 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: O_CLOEXEC is not linux-only. Windows has the same flag. In file-opening functions there is lpSecurityAttributes argument. And there is bInheritHandle member of corresponding structure.

[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-09-06 Thread Alexey Smirnov
Alexey Smirnov alexey.smir...@gmx.com added the comment: FreeBSD 8+ also supports O_CLOEXEC in open(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12105 ___

[issue12910] urrlib.quote quotes too many chars, e.g., '()'

2011-09-06 Thread Jörn Hees
New submission from Jörn Hees nrej9...@joernhees.de: urllib.quote('()') returns '%28%29' Looking into its code it tries to follow RFC 2396 (which is good even though it should follow rfc3986 nowadays), but it doesn't: http://tools.ietf.org/html/rfc2396 (see Appendix A, p.27): ( and ) are in

[issue12909] Inconsistent exception usage in PyLong_As* C functions

2011-09-06 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: +1 for turning these into TypeErrors. It makes little sense that PyLong_AsLongLong and PyLong_AsUnsignedLongLong behave differently here. Do you have a patch handy? -- ___ Python tracker

[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-09-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: O_CLOEXEC is not linux-only. Windows has the same flag. In file-opening functions there is lpSecurityAttributes argument How do you suggest to use it? Even on Windows, python calls open(). And lpSecurityAttributes is an argument of

[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-09-06 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Windows provides a _get_osfhandle() function. There is not the opposite function? :-) Anyway, O_CLOEXEC is not available on all platforms. Even on FreeBSD and Linux, it depends on the OS/kernel version. --

[issue12910] urrlib.quote quotes too many chars, e.g., '()'

2011-09-06 Thread Senthil Kumaran
Senthil Kumaran sent...@uthcode.com added the comment: It can aggressively put these chars !~*\'() in the safe list. I will look at the history to see if they originally present and were removed for some reason or they did not make it the list in the first place. If we do add, then it

[issue1616] compiler warnings

2011-09-06 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset f24352b0df86 by Benjamin Peterson in branch 'default': merge 3.2 (#1616) http://hg.python.org/cpython/rev/f24352b0df86 -- nosy: +python-dev ___ Python tracker

[issue12911] Expose a private accumulator C API

2011-09-06 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: In 47176e8d7060, I fixed json to not blow memory when serializing a large container of small objects. It turns out that the repr() of tuple objects (and, very likely, list objects and possibly other containers) has the same problem. For

[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-09-06 Thread Марк Коренберг
Марк Коренберг socketp...@gmail.com added the comment: Some times ago, Python has used fopen() for open() implementation. Now, it uses OS-kernel native function to open files. AFAIK, open() in Windows is a wrapper around CreateFile, created to support some POSIX programs in Windows. Why not

[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-09-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Why not to use CreateFile() on Windows platform? Good idea! Please open a separate issue for it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12105

[issue6327] [mimetext] long lines get cut with exclamation mark and newline

2011-09-06 Thread Dmitry Simonov
Dmitry Simonov dsimo...@gmail.com added the comment: Quote: == Notes Note that mailservers have a 990-character limit on each line contained within an email message. If an email message is sent that contains lines longer than 990-characters, those lines will be subdivided by

[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-09-06 Thread Brandon Craig Rhodes
Brandon Craig Rhodes bran...@rhodesmill.org added the comment: Brett, yes, you are welcome to close this issue — Ned quite handily convinced me that coverage code belongs in the coverage distribution, not languishing about in the CPython source tree. That solution also quite beautifully solves

[issue12906] Slight error in logging module's yaml config

2011-09-06 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 299ea19c3197 by Vinay Sajip in branch '2.7': Closes #12906: Fixed bug in YAML configuration. http://hg.python.org/cpython/rev/299ea19c3197 New changeset cf811943046b by Vinay Sajip in branch '3.2': Closes #12906:

[issue12912] xmlrpclib.__version__ not bumped with updates

2011-09-06 Thread Rob Crittenden
New submission from Rob Crittenden rcrit...@redhat.com: xmlrpclib.__version__ reports 1.0.1 from Python 2.7 in Fedora 14 and Python 2.6 in Fedora 12. I discovered this while trying to find a way to identify the version of xmlrpclib. The 2.7 xmlrpclib is not completely backward compatible with

[issue12909] Inconsistent exception usage in PyLong_As* C functions

2011-09-06 Thread Nadeem Vawda
Nadeem Vawda nadeem.va...@gmail.com added the comment: Do you have a patch handy? See attached. -- keywords: +patch Added file: http://bugs.python.org/file23106/pylong-exceptions.diff ___ Python tracker rep...@bugs.python.org

[issue12909] Inconsistent exception usage in PyLong_As* C functions

2011-09-06 Thread Nadeem Vawda
Nadeem Vawda nadeem.va...@gmail.com added the comment: This probably shouldn't be backported to 3.2; it could break 3rd-party extension modules (though I would hope that nothing depends on this behaviour...). Also, it's worth noting that the error handling between conversion functions still

[issue12906] Slight error in logging module's yaml config

2011-09-06 Thread Derrick Petzold
Derrick Petzold dpetz...@gmail.com added the comment: I know this is without etiquette but I must say holy shit that was quick and I can only hope that I do can do the same some day. Not with logging but maybe with something else. I think maybe I am already working on it. Hopefully maybe. Its

[issue5845] rlcompleter should be enabled automatically

2011-09-06 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: It's more useful to have a hook called when entering interactive mode, rather than a flag that's set from the beginning: We already have such a hook: $PYTHONSTARTUP $PYTHONSTARTUP doesn't work with -i --

[issue5845] rlcompleter should be enabled automatically

2011-09-06 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Easily detecting interactive mode is of general interest for customization. Thanks for the feedback. We could open a feature request for that, and/or ask python-ideas. What if C also set sys.flags.interactive in python mode, or exposed

[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-09-06 Thread Thomas Wouters
Thomas Wouters tho...@python.org added the comment: For what it's worth, the need for a bootstrap-module has also come up within Google, where we have... somewhat different requirements than most. In order to fix import paths in a way that works even when using python -S, I had a need to

[issue9561] distutils: set encoding to utf-8 for input and output files

2011-09-06 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: I applied pkginfo_utf8.patch to Python 3.2 and 3.3. If you apply patches to distutils, please add tests for the fixed behavior. (Sorry if I wasn’t reactive on this one.) -- ___ Python tracker

[issue12895] In MSI/EXE installer, allow installing Python modules in free path

2011-09-06 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Martin, what do you think about this request? -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12895 ___

[issue12909] Inconsistent exception usage in PyLong_As* C functions

2011-09-06 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: This probably shouldn't be backported to 3.2 Agreed; I don't see this as a bugfix (especially since AFAIK it's not documented that TypeError should be raised here); rather, as a design improvement. Also, it's worth noting that the

[issue12909] Inconsistent exception usage in PyLong_As* C functions

2011-09-06 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: The patch still needs tests (e.g., in test_capi). I'm not sure whether it would be good to add information about the TypeError to the docs. -- ___ Python tracker rep...@bugs.python.org

[issue12913] Add a debugging howto

2011-09-06 Thread Éric Araujo
New submission from Éric Araujo mer...@netwok.org: I found a few blogs posts that explained how to use pdb. It appears from the comments that such introductory material is very useful to a lot of users. Instead of just expanding the pdb module docs, I propose to add a debugging howto

[issue12902] help(modules) executes module code

2011-09-06 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Thanks for the report. This comes from the fact that pydoc imports the modules in order to get their documentation. Your message makes me think that the KWallet Python modules have a problem: they should not pop GUIs at import time! Please

[issue12910] urrlib.quote quotes too many chars, e.g., '()'

2011-09-06 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12910 ___ ___ Python-bugs-list

  1   2   >