RE: Short-circuit Logic

2013-05-31 Thread Carlos Nepomuceno
From: steve+comp.lang.pyt...@pearwood.info Subject: Re: Short-circuit Logic Date: Fri, 31 May 2013 05:13:51 + To: python-list@python.org On Fri, 31 May 2013 00:03:13 +0300, Carlos Nepomuceno wrote: From:

Re: Short-circuit Logic

2013-05-31 Thread Chris Angelico
On Fri, May 31, 2013 at 3:13 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: What makes you think that the commutative law is relevant here? Equality should be commutative. If a == b, then b == a. Also, it's generally understood that if a == c and b == c, then a == b, though

Re: Can anyone please help me in understanding the following python code

2013-05-31 Thread Chris Angelico
On Fri, May 31, 2013 at 3:43 PM, Cameron Simpson c...@zip.com.au wrote: On 30May2013 21:54, bhk...@gmail.com bhk...@gmail.com wrote: | One final question, Is there a way to edit the message once it has been posted? Essentially, no. If there's some error in a post, reply to it yourself with

Re: python b'...' notation

2013-05-31 Thread jmfauth
On 31 mai, 00:19, alcyon st...@terrafirma.us wrote: On Wednesday, May 29, 2013 3:19:42 PM UTC-7, Cameron Simpson wrote: On 29May2013 13:14, Ian Kelly ian.g.ke...@gmail.com wrote: | On Wed, May 29, 2013 at 12:33 PM, alcyon st...@terrafirma.us wrote: | This notation displays hex values

Re: Short-circuit Logic

2013-05-31 Thread Steven D'Aprano
On Fri, 31 May 2013 09:42:38 +0300, Carlos Nepomuceno wrote: From: steve+comp.lang.pyt...@pearwood.info Subject: Re: Short-circuit Logic Date: Fri, 31 May 2013 05:13:51 + To: python-list@python.org On Fri, 31 May 2013 00:03:13 +0300, Carlos Nepomuceno wrote: From:

Re: Short-circuit Logic

2013-05-31 Thread Steven D'Aprano
On Fri, 31 May 2013 17:09:01 +1000, Chris Angelico wrote: On Fri, May 31, 2013 at 3:13 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: What makes you think that the commutative law is relevant here? Equality should be commutative. If a == b, then b == a. Also, it's

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread Alister
On Thu, 30 May 2013 20:38:40 +0100, MRAB wrote: On 30/05/2013 19:44, Chris Angelico wrote: On Fri, May 31, 2013 at 4:36 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Wed, May 29, 2013 at 8:49 PM, rusi rustompm...@gmail.com wrote: On May 30, 6:14 am, Ma Xiaojun damage3...@gmail.com wrote:

Create a file in /etc/ as a non-root user

2013-05-31 Thread BIBHU DAS
I am a python novice;request all to kindly bear with me. fd = open('/etc/file','w') fd.write('jpdas') fd.close() The above snippet fails with: Jagannath-MacBook-Pro:~ jpdas$ python testUmask.py Traceback (most recent call last): File testUmask.py, line 3, in module fd =

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread Luca Cerone
fd = open('/etc/file','w') fd.write('jpdas') fd.close() Hi Bibhu, that is not a Python problem, but a permission one. You should configure the permissions so that you have write access to the folder. However unless you know what you are doing it is discouraged to save your file in the

Re: Piping processes works with 'shell = True' but not otherwise.

2013-05-31 Thread Luca Cerone
That's because stdin/stdout/stderr take file descriptors or file objects, not path strings. Thanks Chris, how do I set the file descriptor to /dev/null then? -- http://mail.python.org/mailman/listinfo/python-list

Re: Surprising difference between StringIO.StringIO and io.StringIO

2013-05-31 Thread Serhiy Storchaka
30.05.13 23:46, Skip Montanaro написав(ла): Am I missing something about how io.StringIO works? I thought it was a more-or-less drop-in replacement for StringIO.StringIO. io.StringIO was backported from Python 3. It is a text (unicode) stream. cStringIO.StringIO is a binary stream and

Finding Relative Maxima in Python3

2013-05-31 Thread Lourens-Jan Ugen
Hi all, The last few days I've been working on a script to manipulate some scientific data. One thing I would like to be able to do is find relative maxima in a data set. I'm using numpy in python3 (which I think I can't do without because of utf16 encoding of my data source) and a series of

Re: Piping processes works with 'shell = True' but not otherwise.

2013-05-31 Thread Peter Otten
Luca Cerone wrote: That's because stdin/stdout/stderr take file descriptors or file objects, not path strings. Thanks Chris, how do I set the file descriptor to /dev/null then? For example: with open(os.devnull, wb) as stderr: p = subprocess.Popen(..., stderr=stderr) ... In

Re: Finding Relative Maxima in Python3

2013-05-31 Thread Chris Rebert
On May 31, 2013 2:46 AM, Lourens-Jan Ugen lourensjan.u...@gmail.com wrote: Hi all, The last few days I've been working on a script to manipulate some scientific data. One thing I would like to be able to do is find relative maxima in a data set. I'm using numpy in python3 (which I think I

Re: Surprising difference between StringIO.StringIO and io.StringIO

2013-05-31 Thread Peter Otten
Serhiy Storchaka wrote: 30.05.13 23:46, Skip Montanaro написав(ла): Am I missing something about how io.StringIO works? I thought it was a more-or-less drop-in replacement for StringIO.StringIO. io.StringIO was backported from Python 3. It is a text (unicode) stream. cStringIO.StringIO is

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread Fábio Santos
On Fri, May 31, 2013 at 10:08 AM, Alister alister.w...@ntlworld.com wrote: I think that is the winning argument. Next question is what should be the default (, or',')? join, comma_join, whitejoin, linejoin variants, with different defaults? -- Fábio Santos --

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread rusi
On May 31, 2:08 pm, Alister alister.w...@ntlworld.com wrote: On Thu, 30 May 2013 20:38:40 +0100, MRAB wrote: And additional argument (pun not intended) for putting sep second is that you can give it a default value:     def join(iterable, sep=): return sep.join(iterable) I think that is

Re: Surprising difference between StringIO.StringIO and io.StringIO

2013-05-31 Thread Serhiy Storchaka
31.05.13 12:55, Peter Otten написав(ла): Serhiy Storchaka wrote: 30.05.13 23:46, Skip Montanaro написав(ла): Am I missing something about how io.StringIO works? I thought it was a more-or-less drop-in replacement for StringIO.StringIO. io.StringIO was backported from Python 3. It is a text

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread Dave Angel
On 05/31/2013 05:27 AM, Luca Cerone wrote: fd = open('/etc/file','w') fd.write('jpdas') fd.close() Hi Bibhu, that is not a Python problem, but a permission one. You should configure the permissions so that you have write access to the folder. However unless you know what you are doing it

Re: Python Magazine

2013-05-31 Thread DRJ Reddy
Hello all, Was busy with work. Finally finished the job of registering the domain name. Will be live soon. The url is http://pythonmagazine.org. Hope we will be live soon. Regards, DRJ. -- http://mail.python.org/mailman/listinfo/python-list

Re: serialize a class to XML and back

2013-05-31 Thread Schneider
On 26.05.2013 22:48, Roy Smith wrote: In article mailman.2197.1369600623.3114.python-l...@python.org, Chris Rebert c...@rebertia.com wrote: On May 23, 2013 3:42 AM, Schneider j...@globe.de wrote: Hi list, how can I serialize a python class to XML? Plus a way to get the class back from the

Re: serialize a class to XML and back

2013-05-31 Thread Schneider
On 25.05.2013 07:54, dieter wrote: Schneider j...@globe.de writes: how can I serialize a python class to XML? Plus a way to get the class back from the XML? My aim is to store instances of this class in a database. In case you want to describe the XML data via an XML-schema (e.g. to exchange

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread Alister
On Fri, 31 May 2013 03:27:52 -0700, rusi wrote: On May 31, 2:08 pm, Alister alister.w...@ntlworld.com wrote: On Thu, 30 May 2013 20:38:40 +0100, MRAB wrote: And additional argument (pun not intended) for putting sep second is that you can give it a default value:     def join(iterable,

Re: Cutting a deck of cards

2013-05-31 Thread Lee Crocker
Why on Earth would you want to? Cutting a deck makes no sense in software. Randomize the deck properly (Google Fisher-Yates) and start dealing. Cutting the deck will not make it any more random, and in fact will probably make it worse depending on how you choose the cutpoint. The purpose of

Re: Short-circuit Logic

2013-05-31 Thread Roy Smith
In article 51a86319$0$29966$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: In an early talk Ken was explaining the advantages of tolerant comparison. A member of the audience asked incredulously, “Surely you don’t mean that

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread Alister
On Fri, 31 May 2013 07:11:58 -0400, Dave Angel wrote: On 05/31/2013 05:27 AM, Luca Cerone wrote: fd = open('/etc/file','w') fd.write('jpdas') fd.close() Hi Bibhu, that is not a Python problem, but a permission one. You should configure the permissions so that you have write access to

Re: Fatal Python error

2013-05-31 Thread nn
On May 29, 10:05 am, Joshua Landau joshua.landau...@gmail.com wrote: On 29 May 2013 14:02, Dave Angel da...@davea.name wrote: On 05/29/2013 08:45 AM, Oscar Benjamin wrote: Joshua:  Avoid doing anything complex inside an exception handler. Unfortunately, Ranger (the file manager in

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread Chris Angelico
On Sat, Jun 1, 2013 at 12:02 AM, Alister alister.w...@ntlworld.com wrote: /etc is used to store configuration files for the operating system if you inadvertently corrupt the wrong one then you could kill the system. Expanding on this: http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-31 Thread Νικόλαος Κούρας
Τη Πέμπτη, 30 Μαΐου 2013 8:28:56 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: Wonder how much less exciting this mailing list would be if he switched to decaf... decaf is like tasting coffee without coffee! Caffeine gives the coffee a nice taste and make me sweaty and panik too if when i

Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
I'am using CentOS v6.4 on my VPS and hence 'yum' install manager and i just tried: Code: root@nikos [~]# which python /usr/bin/python root@nikos [~]# which python3 /root/.local/lib/python2.7/bin/python3 root@nikos [~]# which python3.3 /root/.local/lib/python2.7/bin/python3.3 root@nikos [~]# Why

Re: Short-circuit Logic

2013-05-31 Thread Stefan Drees
On 2013-05-30 08:29:41 +, Steven D'Aprano said: On Thu, 30 May 2013 10:22:02 +0300, Jussi Piitulainen wrote: I wonder why floating-point errors are not routinely discussed in terms of ulps (units in last position). ... That is an excellent question! ... I have a module that works with

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Fábio Santos
On 31 May 2013 16:28, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: I'am using CentOS v6.4 on my VPS and hence 'yum' install manager and i just tried: Code: root@nikos [~]# which python /usr/bin/python root@nikos [~]# which python3 /root/.local/lib/python2.7/bin/python3 root@nikos [~]#

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread Ian Kelly
On Thu, May 30, 2013 at 1:38 PM, MRAB pyt...@mrabarnett.plus.com wrote: And additional argument (pun not intended) for putting sep second is that you can give it a default value: def join(iterable, sep=): return sep.join(iterable) One argument against the default is that it is specific to

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread Ian Kelly
On Fri, May 31, 2013 at 4:16 AM, Fábio Santos fabiosantos...@gmail.com wrote: On Fri, May 31, 2013 at 10:08 AM, Alister alister.w...@ntlworld.com wrote: I think that is the winning argument. Next question is what should be the default (, or',')? join, comma_join, whitejoin, linejoin

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
Τη Παρασκευή, 31 Μαΐου 2013 6:37:06 μ.μ. UTC+3, ο χρήστης Fábio Santos έγραψε: Check if python3 and python3.3 aren't the same. Run them and look at the intro lines. root@nikos [~]# python -V Python 2.6.6 root@nikos [~]# python3 -V Python 3.3.0 root@nikos [~]# python3.3 -V Python 3.3.0

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Michael Torrie
On 05/31/2013 09:20 AM, Νικόλαος Κούρας wrote: Why so many pythons in my system. Now in the case of my Python3 installation, it looks like i have two parallel installations of Python3, but i don't. One is almost certainly a symlink to the other and not an actual installation. Well is it a

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Ian Kelly
On Fri, May 31, 2013 at 9:41 AM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: Τη Παρασκευή, 31 Μαΐου 2013 6:37:06 μ.μ. UTC+3, ο χρήστης Fábio Santos έγραψε: Check if python3 and python3.3 aren't the same. Run them and look at the intro lines. root@nikos [~]# python -V Python 2.6.6

Re: sendmail smtplib.SMTP('localhost') Where is the email?

2013-05-31 Thread inq1ltd
Your responses helped. The mailg for linux gave me information I didn't expect. regards, jol On Friday, May 31, 2013 08:55:12 AM Cameron Simpson wrote: On 30May2013 15:48, inq1ltd inq1...@inqvista.com wrote: | python help, Please do not make new discussions by replying to an old

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
Τη Παρασκευή, 31 Μαΐου 2013 6:55:03 μ.μ. UTC+3, ο χρήστης Michael Torrie έγραψε: On 05/31/2013 09:20 AM, Νικόλαος Κούρας wrote: Why so many pythons in my system. Now in the case of my Python3 installation, it looks like i have two parallel installations of Python3, but i don't. One is

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
root@nikos [~]# yum remove python3 Loaded plugins: fastestmirror Setting up Remove Process No Match for argument: python3 Loading mirror speeds from cached hostfile * base: ftp.plusline.de * extras: ftp.plusline.de * updates: ftp.plusline.de base

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
root@nikos [~]# which python /usr/bin/python root@nikos [~]# which python2 /usr/bin/python2 root@nikos [~]# which python3 /root/.local/lib/python2.7/bin/python3 root@nikos [~]# which python3.3 /root/.local/lib/python2.7/bin/python3.3 root@nikos [~]# So i have 2.6 2.7 3 3.3 4 installations? --

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Alister
On Fri, 31 May 2013 08:20:54 -0700, Νικόλαος Κούρας wrote: I'am using CentOS v6.4 on my VPS and hence 'yum' install manager and i just tried: Code: root@nikos [~]# which python /usr/bin/python root@nikos [~]# which python3 /root/.local/lib/python2.7/bin/python3 root@nikos [~]# which

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Ian Kelly
On Fri, May 31, 2013 at 11:10 AM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: root@nikos [~]# ls -al /usr/bin/python* -rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python* lrwxrwxrwx 1 root root6 Apr 5 20:34 /usr/bin/python2 - python* -rwxr-xr-x 3 root root 4864 Feb 22 02:00

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Ian Kelly
On Fri, May 31, 2013 at 11:16 AM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: root@nikos [~]# which python /usr/bin/python root@nikos [~]# which python2 /usr/bin/python2 root@nikos [~]# which python3 /root/.local/lib/python2.7/bin/python3 root@nikos [~]# which python3.3

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
Τη Παρασκευή, 31 Μαΐου 2013 8:24:26 μ.μ. UTC+3, ο χρήστης Ian έγραψε: On the other hand, there's really not much harm in leaving it. Python 2.6 is already your default Python. Is this the same system where you recently spent a lot of time upgrading your web scripts to Python 3? Yes, its

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
OMG i gave by mistake root@nikos [/]# rm -rf /root/.local/ did i screwed up my remote VPS which i host 10 peoples webpages? -- http://mail.python.org/mailman/listinfo/python-list

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Ian Kelly
On Fri, May 31, 2013 at 11:42 AM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: OMG i gave by mistake root@nikos [/]# rm -rf /root/.local/ did i screwed up my remote VPS which i host 10 peoples webpages? I don't know, is that where you were keeping the data? The website still appears to be

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
Τη Παρασκευή, 31 Μαΐου 2013 8:55:51 μ.μ. UTC+3, ο χρήστης Ian έγραψε: On Fri, May 31, 2013 at 11:42 AM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: OMG i gave by mistake root@nikos [/]# rm -rf /root/.local/ did i screwed up my remote VPS which i host 10 peoples webpages?

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread Chris Angelico
On Sat, Jun 1, 2013 at 1:43 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Thu, May 30, 2013 at 1:38 PM, MRAB pyt...@mrabarnett.plus.com wrote: And additional argument (pun not intended) for putting sep second is that you can give it a default value: def join(iterable, sep=): return

Re: Cutting a deck of cards

2013-05-31 Thread Modulok
Why on Earth would you want to? Cutting a deck makes no sense in software. Randomize the deck properly (Google Fisher-Yates) and start dealing. Cutting the deck will not make it any more random, and in fact will probably make it worse depending on how you choose the cutpoint. The purpose of

Re: How to Begin Web Development with Python ?

2013-05-31 Thread Modulok
I have learnt python and used it for various purposes for scietific computing using sage and GUI development using Tkinter and lots more. I want to start web development using python My goal is to learn the web development in python from the basic level and understand the big web development

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Fábio Santos
On 31 May 2013 19:09, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: On Fri, May 31, 2013 at 11:42 AM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: OMG i gave by mistake root@nikos [/]# rm -rf /root/.local/ did i screwed up my remote VPS which i host 10 peoples webpages? Couldn't you

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread David
On 01/06/2013, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: Why so many pythons in my system. Explained below, underneath each pertinent info you provided. First, let's discuss Python 2.6: On 01/06/2013, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: I'am using CentOS v6.4 on my VPS and hence

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
Indeed i have comiled python 2.7 and 3.3 form source after wget and ./configure an make install but i belive somehting is mixed up althouh python works ok. root@nikos [/opt/python3/bin]# ls -al total 15180 drwxr-xr-x 2 root root4096 Apr 7 22:09 ./ drwxr-xr-x 6 root root4096 Apr 7

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Chris Angelico
On Sat, Jun 1, 2013 at 9:30 AM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: Still i feel my system is a bit messed p and i just want to leave the 2.6 installed and remove all the rest python and then yum install the_latest_one. It's not half as messed up as... uhh, scratch that. It's not half

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Chris Angelico
On Sat, Jun 1, 2013 at 8:50 AM, David bouncingc...@gmail.com wrote: On 01/06/2013, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: root@nikos [/]# ls -l /usr/bin/python* -rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python* lrwxrwxrwx 1 root root6 Apr 5 20:34 /usr/bin/python2 - python*

Re: Is this code correct?

2013-05-31 Thread Cameron Simpson
On 30May2013 06:45, Nikos as SuperHost Support supp...@superhost.gr wrote: | Τη Πέμπτη, 30 Μαΐου 2013 4:36:11 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: | Lemme guess, he's next going to ask on the PostgreSQL mailing list. I | mean, that's unrelated to Python, right? | | Well Chris, i'am not

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Ian Kelly
On Fri, May 31, 2013 at 5:30 PM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: Indeed i have comiled python 2.7 and 3.3 form source after wget and ./configure an make install but i belive somehting is mixed up althouh python works ok. root@nikos [/opt/python3/bin]# ls -al ... root@nikos

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
Τη Σάββατο, 1 Ιουνίου 2013 2:55:38 π.μ. UTC+3, ο χρήστης Ian έγραψε: On Fri, May 31, 2013 at 5:30 PM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: Indeed i have comiled python 2.7 and 3.3 form source after wget and ./configure an make install but i belive somehting is mixed up

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread David
On 01/06/2013, Chris Angelico ros...@gmail.com wrote: On Sat, Jun 1, 2013 at 8:50 AM, David bouncingc...@gmail.com wrote: Apart from the bizarre trailing '*' characters which for which I have no sane explanation... I believe that indicates that his 'ls' is aliased to 'ls --classify', which

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Chris Angelico
On Sat, Jun 1, 2013 at 10:08 AM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: Τη Σάββατο, 1 Ιουνίου 2013 2:55:38 π.μ. UTC+3, ο χρήστης Ian έγραψε: [ snip lots of double-spaced quoted text ] Do you think that i should have my VPS copmany to install ubuntu for me and use apt-get install

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Chris Angelico
On Sat, Jun 1, 2013 at 10:18 AM, David bouncingc...@gmail.com wrote: On 01/06/2013, Chris Angelico ros...@gmail.com wrote: On Sat, Jun 1, 2013 at 8:50 AM, David bouncingc...@gmail.com wrote: Apart from the bizarre trailing '*' characters which for which I have no sane explanation... I

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread Nobody
On Fri, 31 May 2013 02:12:58 -0700, BIBHU DAS wrote: I am a python novice;request all to kindly bear with me. fd = open('/etc/file','w') fd.write('jpdas') fd.close() The above snippet fails with: IOError: [Errno 13] Permission denied: '/etc/file' As it should. Any Idea how to

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Mark Lawrence
On 01/06/2013 01:18, David wrote: I knew I didn't have all the answers, but felt that I'd try some pig wrestling anyway. To carry on with the animal analogy, the OP appears to me a very dangerous combination of headless chicken and bull in a china shop. -- Steve is going for the pink ball

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread Tim Chase
On 2013-06-01 01:20, Nobody wrote: On Fri, 31 May 2013 02:12:58 -0700, BIBHU DAS wrote: Any Idea how to create a file in /etc as non-root user? This should not be possible. The language used is irrelevant. It's theoretically possible to pre-create the file (or a subdirectory) in /etc as

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Michael Torrie
On 05/31/2013 12:02 PM, Νικόλαος Κούρας wrote: please tell me how to unistall python 2.6 and just keep 2.7 and install 3.3.2 please uisng yum. Python 2.6 is required for CentOS to function. You simply cannot remove it. You can't replace it with 2.7 either. You can install 2.7 alongside it if

netcdF4 variables

2013-05-31 Thread Sudheer Joseph
Dear members, I have been using python NetcdF for some time. I understand that we can get variables from a netcdf one by one by using temp=ncf.variable['temp'][:] but is there a way to get a list of variables with out the rest of the stuff as seen below? some hing like a

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread rusi
On May 31, 7:42 pm, Chris Angelico ros...@gmail.com wrote: On Sat, Jun 1, 2013 at 12:02 AM, Alister alister.w...@ntlworld.com wrote: /etc is used to store configuration files for the operating system if you inadvertently corrupt the wrong one then you could kill the system. Expanding on

Apache and suexec issue that wont let me run my python script

2013-05-31 Thread Νικόλαος Κούρας
I have asked this in alt.apache.configuration but received no response at all, so i was thinking of you guys as a last resort to this. Sorry about that but koukos.py need to set a cookies that other scripts depend upon for identification. 'python3 koukos.py' runs properly. chown nikos:nikos

Re: Apache and suexec issue that wont let me run my python script

2013-05-31 Thread Chris Angelico
On Sat, Jun 1, 2013 at 3:30 PM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: I have asked this in alt.apache.configuration but received no response at all You posted it FIFTEEN HOURS AGO on a low-traffic forum. Sheesh! Learn a little patience. ChrisA --

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
Τη Σάββατο, 1 Ιουνίου 2013 3:15:22 π.μ. UTC+3, ο χρήστης Dennis Lee Bieber έγραψε: On Fri, 31 May 2013 08:20:54 -0700 (PDT), �������� ������ nikos.gr...@gmail.com declaimed the following in gmane.comp.python.general: I'am using CentOS v6.4 on my VPS

[issue18078] threading.Condition to allow notify on a specific waiter

2013-05-31 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18078 ___ ___

[issue18105] ElementTree writes invalid files when UTF-16 encoding is specified

2013-05-31 Thread Adam Urban
New submission from Adam Urban: import xml.etree.ElementTree as ET tree = ET.parse(myinput.xml) tree.write(myoutput.xml, encoding=utf-16) ...Output is a garbled mess, often a mix of UTF-8 and UTF-16 bytes... UTF-8 output works fine, but when UTF-16, UTF-16LE, or UTF-16BE are specified the

[issue12425] gettext breaks on empty plural-forms value

2013-05-31 Thread Bohuslav Slavek Kabrda
Changes by Bohuslav Slavek Kabrda bkab...@redhat.com: -- nosy: +bkabrda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12425 ___ ___

[issue18106] There are unused variables in Lib/test/test_collections.py

2013-05-31 Thread Vajrasky Kok
New submission from Vajrasky Kok: In two test_copying methods in Lib/test/test_collections.py, variable i is never used. My guess is the original test writer forgot to utilize the variable i. For example, in test_copying method in TestOrderedDict class: def test_copying(self): #

[issue18106] There are unused variables in Lib/test/test_collections.py

2013-05-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Perhaps it will be even better to extract loop body as a local function and then call it with different arguments. def check(dup): self.assertTrue(dup is not od) self.assertEqual(dup, od) ... check(od.copy())

[issue18105] ElementTree writes invalid files when UTF-16 encoding is specified

2013-05-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For 3.3+ it was fixed in issue1767933. -- nosy: +eli.bendersky, serhiy.storchaka versions: -3rd party, Python 2.6, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker

[issue10224] Build 3.x documentation using python3.x

2013-05-31 Thread Cherniavsky Beni
Cherniavsky Beni added the comment: I was only thinking of 3.4, which will have venv and a pip bootstrapper. Is changing the doc build / doctest in scope for minor releases of 3.3 (or even earlier)? The commands I listed (using setup_distribute.py) also work with 3.3. (But they're unsecure --

[issue18107] 'str(long)' can be made faster

2013-05-31 Thread Armin Rigo
New submission from Armin Rigo: If you have in x some very large number, like 3**20, then the computation for 'str(x)' is sub-efficient. Nathan Hurst posted to the pypy-dev mailing list a pure Python algo that gives the same result in 2/3rd of the time (in either CPython or PyPy). We

[issue18107] 'str(long)' can be made faster

2013-05-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue3451. -- nosy: +mark.dickinson, serhiy.storchaka versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18107 ___

[issue18106] There are unused variables in Lib/test/test_collections.py

2013-05-31 Thread Vajrasky Kok
Vajrasky Kok added the comment: According to R. David Murray in Python core-mentorship mailing list addressing me: It could be that the bug is that the i is not used...it may have been intended to be used in an extended error message in the asserts, so that it would be clear which input

[issue18106] There are unused variables in Lib/test/test_collections.py

2013-05-31 Thread Vajrasky Kok
Vajrasky Kok added the comment: Anyway to make it complete, I upload the patch according to Storchaka's advice too. May the best patch wins! -- Added file: http://bugs.python.org/file30434/test_copying_with_def.patch ___ Python tracker

[issue18039] dbm.open(..., flag=n) does not work and does not give a warning

2013-05-31 Thread Berker Peksag
Berker Peksag added the comment: I can't reproduce it on Windows 7 with Python 3.3.2. Attaching my test script. Here's the output: C:\Python33python.exe -V Python 3.3.2 C:\Python33python.exe dbmopen.py dbm.dumb._Database object at 0x027C15B0 bzdew.dat exists? True bzdew.dir exists? True

[issue744841] Python-Profiler bug: Bad call

2013-05-31 Thread Terje Wiesener
Terje Wiesener added the comment: This bug seems to have resurfaced in newer python versions. I have tested the file attached in the original report (prof2.py) in python 2.6.6 and 2.7 (x86 versions) under Windows 7, and both give the same output: c:\tempc:\Python27\python.exe prof2.py type

[issue18039] dbm.open(..., flag=n) does not work and does not give a warning

2013-05-31 Thread Sashko Kopyl
Sashko Kopyl added the comment: Here is the output. *** Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit (Intel)] on win32. *** *** Remote Python engine is active *** *** Remote Interpreter Reinitialized *** dbm.dumb._Database object at 0x02B95210 yoqaA.dat

[issue18108] shutil.chown should support dir_fd and follow_symlinks keyword arguments

2013-05-31 Thread Colin Watson
New submission from Colin Watson: Python 3.3 added the dir_fd and follow_symlinks keyword arguments to os.chown; it also added the shutil.chown function. Unfortunately the latter, while useful, does not support these new keyword arguments. It would be helpful if it did. --

[issue15239] Abandoned Tools/unicode/mkstringprep.py

2013-05-31 Thread Martin v . Löwis
Martin v. Löwis added the comment: Ok, these patches all look fine. Thanks for your effort. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15239 ___

[issue18107] 'str(long)' can be made faster

2013-05-31 Thread Armin Rigo
Armin Rigo added the comment: Thanks, I missed it. Sorry for the noise. -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18107 ___

[issue3451] Asymptotically faster divmod and str(long)

2013-05-31 Thread Eric V. Smith
Eric V. Smith added the comment: See also issue18107, in particular http://mail.python.org/pipermail/pypy-dev/2013-May/011433.html. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3451

[issue18093] Move main functions to a separate Programs directory

2013-05-31 Thread Zachary Ware
Zachary Ware added the comment: I can confirm that the patch doesn't break building on Windows. Would it make any sense to move Windows-specific sources for things like kill_python.exe (PCbuild/kill_python.c), make_buildinfo.exe, make_versioninfo.exe, py.exe (PC/launcher.c) into Programs? Or

[issue18094] Skip tests in test_uuid not silently

2013-05-31 Thread Zachary Ware
Changes by Zachary Ware zachary.w...@gmail.com: -- nosy: +zach.ware ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18094 ___ ___ Python-bugs-list

[issue18103] Create a GUI test framework for Idle

2013-05-31 Thread Todd Rovito
Changes by Todd Rovito rovit...@gmail.com: -- nosy: +Todd.Rovito ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18103 ___ ___ Python-bugs-list

[issue18104] Idle: make human-mediated GUI tests usable

2013-05-31 Thread Todd Rovito
Changes by Todd Rovito rovit...@gmail.com: -- nosy: +Todd.Rovito ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18104 ___ ___ Python-bugs-list

[issue18108] shutil.chown should support dir_fd and follow_symlinks keyword arguments

2013-05-31 Thread Hynek Schlawack
Changes by Hynek Schlawack h...@ox.cx: -- nosy: +hynek versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18108 ___

[issue18066] Remove SGI-specific code from pty.py

2013-05-31 Thread Éric Araujo
Éric Araujo added the comment: LGTM. -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18066 ___ ___ Python-bugs-list mailing

[issue18094] Skip tests in test_uuid not silently

2013-05-31 Thread Éric Araujo
Éric Araujo added the comment: +1 -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18094 ___ ___ Python-bugs-list mailing list

[issue18094] Skip tests in test_uuid not silently

2013-05-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 81c02d2c830d by Serhiy Storchaka in branch '3.3': Issue #18094: test_uuid no more reports skipped tests as passed. http://hg.python.org/cpython/rev/81c02d2c830d New changeset ebd11a19d830 by Serhiy Storchaka in branch 'default': Issue #18094:

[issue18094] Skip tests in test_uuid not silently

2013-05-31 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka resolution: - fixed stage: patch review - committed/rejected status: open - closed versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org

[issue15239] Abandoned Tools/unicode/mkstringprep.py

2013-05-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for review. Should we regenerate Lib/stringprep.py now? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15239 ___

[issue18109] os.uname() crashes if hostname contains non-ascii characters

2013-05-31 Thread Dominik Richter
New submission from Dominik Richter: To reproduce (tested on Arch Linux, python 3.3.2): sudo hostname hât python -c import os; os.uname() produces: Traceback (most recent call last): File string, line 1, in module UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in

  1   2   >