Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread rusi
On Jul 19, 6:34 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Wed, 18 Jul 2012 15:40:00 +0100, Lipska the Kat wrote: Object Oriented programming is all about encapsulating human concepts in a way that makes sense to human beings. Make no mistake, it is NEVER the case

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Terry Reedy
On 7/18/2012 10:40 AM, Lipska the Kat wrote: fact ... and I have never been forced to admit that I don't know what I wrote six months ago. That is an explicit objective of Python's design. Python looks like an interesting language and I will certainly spend time getting to know it but at

Re: my email

2012-07-19 Thread MRAB
On 18/07/2012 02:44, Maria Hanna Carmela Dionisio wrote: mmdionisio1...@yahoo.com.ph Just a newbhie here : ...who has just revealed her password! [remainder snipped] -- http://mail.python.org/mailman/listinfo/python-list

Python Programming expert - adding user

2012-07-19 Thread Maria Hanna Carmela Dionisio
Im just a student :) Our prof gave as a task that we need to make a program using python (for redhat) and c++(for windows) Our objective is to make a program file and we will said it remotely to another computer via network ( its easy and i could do it lolz).. the hard part is the

Re: my email

2012-07-19 Thread Karim
Le 18/07/2012 04:34, Simon Cropper a écrit : On 18/07/12 11:44, Maria Hanna Carmela Dionisio wrote: mmdionisio1...@yahoo.com.ph Just a newbhie here : [snip] You must know your password to change your options (including changing the password, itself) or to unsubscribe. It is:

Re: Foxpro goto command and deleted records

2012-07-19 Thread Ian Kelly
On Wed, Jul 18, 2012 at 8:40 AM, Grant Edwards invalid@invalid.invalid wrote: On 2012-07-17, Ethan Furman et...@stoneleaf.us wrote: In Foxpro if you do a Foxpro? http://en.wikipedia.org/wiki/Visual_FoxPro -- http://mail.python.org/mailman/listinfo/python-list

Re: A thread import problem

2012-07-19 Thread Dieter Maurer
Bruce Sherwood bruce.sherw...@gmail.com writes: I'm trying to do something rather tricky, in which a program imports a module that starts a thread that exec's a (possibly altered) copy of the source in the original program, and the module doesn't return. This has to do with an attempt to run

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Lipska the Kat
On 19/07/12 07:09, rusi wrote: On Jul 19, 6:34 am, Steven D'Apranosteve +comp.lang.pyt...@pearwood.info wrote: On Wed, 18 Jul 2012 15:40:00 +0100, Lipska the Kat wrote: Object Oriented programming is all about encapsulating human concepts in a way that makes sense to human beings. Make no

Incorrect detection of futimesns/futimes in 3.3.0b1

2012-07-19 Thread RICHARD MOSELEY
I have recently been compiling the source for 3.3.0 beta1 and have discovered that even though the functions futimens, futimes and lutimes are found by the configure script, since they exist as entry points in libc, their actually only stub functions that simply return ENOSYS (Not Implemented)

Re: Incorrect detection of futimesns/futimes in 3.3.0b1

2012-07-19 Thread Christian Heimes
Am 19.07.2012 11:03, schrieb RICHARD MOSELEY: I am now considering providing a general patch to the configure.ac http://configure.ac file which will more correctly detect all the various flavours of utimes (futimens, futimes, lutimes, futimesat, utimensat and utimes) using a different check

reloading code and multiprocessing

2012-07-19 Thread andrea crotti
We need to be able to reload code on a live system. This live system has a daemon process always running but it runs many subprocesses with multiprocessing, and the subprocesses might have a short life... Now I found a way to reload the code successfully, as you can see from this testcase: def

Odd csv column-name truncation with only one column

2012-07-19 Thread Tim Chase
tim@laptop:~/tmp$ python Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) [GCC 4.4.5] on linux2 Type help, copyright, credits or license for more information. import csv from cStringIO import StringIO s = StringIO('Email\n...@example.com\n...@example.org\n') s.seek(0) d =

Re: Odd csv column-name truncation with only one column

2012-07-19 Thread Peter Otten
Tim Chase wrote: tim@laptop:~/tmp$ python Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) [GCC 4.4.5] on linux2 Type help, copyright, credits or license for more information. import csv from cStringIO import StringIO s = StringIO('Email\n...@example.com\n...@example.org\n') s.seek(0) d

Re: Odd csv column-name truncation with only one column

2012-07-19 Thread Steven D'Aprano
On Thu, 19 Jul 2012 06:21:58 -0500, Tim Chase wrote: tim@laptop:~/tmp$ python Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) [GCC 4.4.5] on linux2 Type help, copyright, credits or license for more information. import csv from cStringIO import StringIO s =

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Steven D'Aprano
On Wed, 18 Jul 2012 23:09:13 -0700, rusi wrote: Its not so much a question of language as in programming as language as in layman-speak. One characteristic with our field is that we take ordinary words and then distort them so much the original meaning is completely lost. All technical

Re: Odd csv column-name truncation with only one column

2012-07-19 Thread Tim Chase
On 07/19/12 06:21, Tim Chase wrote: tim@laptop:~/tmp$ python Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) [GCC 4.4.5] on linux2 Type help, copyright, credits or license for more information. import csv from cStringIO import StringIO s =

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Roy Smith
In article 500804cc$0$29978$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 18 Jul 2012 23:09:13 -0700, rusi wrote: Its not so much a question of language as in programming as language as in layman-speak. One characteristic with

Re: Python Programming expert - adding user

2012-07-19 Thread William R. Wing (Bill Wing)
On Jul 17, 2012, at 9:58 PM, Maria Hanna Carmela Dionisio wrote: Im just a student :) Our prof gave as a task that we need to make a program using python (for redhat) and c++(for windows) Our objective is to make a program file and we will said it remotely to another computer via

Re: Odd csv column-name truncation with only one column

2012-07-19 Thread Hans Mulder
On 19/07/12 13:21:58, Tim Chase wrote: tim@laptop:~/tmp$ python Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) [GCC 4.4.5] on linux2 Type help, copyright, credits or license for more information. import csv from cStringIO import StringIO s =

Re: Google the video 9/11 Missing Links. 9/11 was a Jew Job!

2012-07-19 Thread Neal Becker
Google the video Go fuck yourself -- http://mail.python.org/mailman/listinfo/python-list

Use of compile flags in regular expressions.

2012-07-19 Thread Steven W. Orr
I have a problem that I'm solving using a regex. (Yeah, I know, now I have two problems...) ;-) Anyways, the regex is about a couple of pages long and it works just peachy. There's just one thing I'd like to do to make it more elegant. I need to compile the regex with MULTILINE and DOTALL.

Re: Google the video 9/11 Missing Links. 9/11 was a Jew Job!

2012-07-19 Thread Matty Sarro
I must be a Jew or a traitor as I keep deleting this email. Seriously guys, don't reply to it, it's not worth the time. On Thu, Jul 19, 2012 at 10:22 AM, Neal Becker ndbeck...@gmail.com wrote: Google the video Go fuck yourself -- http://mail.python.org/mailman/listinfo/python-list --

Re: reloading code and multiprocessing

2012-07-19 Thread 88888 Dihedral
andrea crotti於 2012年7月19日星期四UTC+8下午6時15分11秒寫道: We need to be able to reload code on a live system. This live system has a daemon process always running but it runs many subprocesses with multiprocessing, and the subprocesses might have a short life... Now I found a way to reload the code

Re: Use of compile flags in regular expressions.

2012-07-19 Thread MRAB
On 19/07/2012 15:22, Steven W. Orr wrote: I have a problem that I'm solving using a regex. (Yeah, I know, now I have two problems...) ;-) Anyways, the regex is about a couple of pages long and it works just peachy. There's just one thing I'd like to do to make it more elegant. I need to

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread rusi
On Jul 19, 1:56 pm, Lipska the Kat lip...@lipskathekat.com wrote: Academic twiddling with the distorted meaning of words spun by vested interests is all very interesting I'm sure but doesn't really advance the discussion does it? Well lets back up the discussion a bit. You coming from a Java

shutil ignore fails on passing a tuple?

2012-07-19 Thread Alex van der Spek
This beats me: ipatterns ('*.txt', '*.hdf', '*.pdf', '*.png') igf = shutil.ignore_patterns(ipatterns) ignorethis = igf(ddftopdir,os.listdir(ddftopdir)) Traceback (most recent call last): File pyshell#60, line 1, in module ignorethis =

RE: shutil ignore fails on passing a tuple?

2012-07-19 Thread Prasad, Ramit
ipatterns ('*.txt', '*.hdf', '*.pdf', '*.png') igf = shutil.ignore_patterns(ipatterns) ignorethis = igf(ddftopdir,os.listdir(ddftopdir)) Traceback (most recent call last): File pyshell#60, line 1, in module ignorethis = igf(ddftopdir,os.listdir(ddftopdir)) File

Re: shutil ignore fails on passing a tuple?

2012-07-19 Thread Joel Goldstick
On Thu, Jul 19, 2012 at 12:43 PM, Alex van der Spek zd...@xs4all.nl wrote: This beats me: ipatterns ('*.txt', '*.hdf', '*.pdf', '*.png') igf = shutil.ignore_patterns(ipatterns) ignorethis = igf(ddftopdir,os.listdir(ddftopdir)) Traceback (most recent call last):

Re: Odd csv column-name truncation with only one column

2012-07-19 Thread Tim Chase
On 07/19/12 08:52, Hans Mulder wrote: Perhaps it should be documented that the Sniffer doesn't work on single-column data. I think this would involve the least change in existing code, and go a long way towards removing my surprise. :-) If you really need to read a one-column csv file,

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Paul Rudin
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: For example, both ML and Haskell can, under some circumstances, report a type-error for an infinite loop, *at compile time*. ... and in Charity all programs are guaranteed to terminate. Of course it's not Turing complete.

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Tim Chase
If you think that people can routinely detect infinite loops, then perhaps you would care to tell me whether this is an infinite loop or not: i = 1 while not is_perfect(i): i += 2 print odd perfect number discovered where is_perfect() returns True if the integer argument is

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Chris Angelico
On Fri, Jul 20, 2012 at 4:20 AM, Tim Chase python.l...@tim.thechases.com wrote: Sure it terminates...If you don't run out of RAM to represent the number i in question, there's also this heat death of the universe limit I keep hearing about ;-) I'd be more worried about the heat death of your

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Tim Chase
On 07/19/12 13:28, Chris Angelico wrote: On Fri, Jul 20, 2012 at 4:20 AM, Tim Chase python.l...@tim.thechases.com wrote: Sure it terminates...If you don't run out of RAM to represent the number i in question, there's also this heat death of the universe limit I keep hearing about ;-) I'd

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread larry.mart...@gmail.com
On Jul 18, 6:36 pm, Simon Cropper simoncrop...@fossworkflowguides.com wrote: On 19/07/12 08:20, larry.mart...@gmail.com wrote: I have an interesting problem I'm trying to solve. I have a solution almost working, but it's super ugly, and know there has to be a better, cleaner way to

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread larry.mart...@gmail.com
On Jul 18, 4:49 pm, Paul Rubin no.em...@nospam.invalid wrote: larry.mart...@gmail.com larry.mart...@gmail.com writes: I have an interesting problem I'm trying to solve. I have a solution almost working, but it's super ugly, and know there has to be a better, cleaner way to do it. ... My

RE: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread Prasad, Ramit
I am making the assumption that you intend to collapse the directory tree and store each file in the same directory, otherwise I can't think of why you need to do this. Hi Simon, thanks for the reply. It's not quite this - what I am doing is creating a zip file with relative path names,

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread larry.mart...@gmail.com
On Jul 19, 1:02 pm, Prasad, Ramit ramit.pra...@jpmorgan.com wrote: I am making the assumption that you intend to collapse the directory tree and store each file in the same directory, otherwise I can't think of why you need to do this. Hi Simon, thanks for the reply. It's not quite

Re: shutil ignore fails on passing a tuple?

2012-07-19 Thread Dave Angel
On 07/19/2012 12:43 PM, Alex van der Spek wrote: This beats me: ipatterns ('*.txt', '*.hdf', '*.pdf', '*.png') igf = shutil.ignore_patterns(ipatterns) ignorethis = igf(ddftopdir,os.listdir(ddftopdir)) SNIP Why does it fail on passing in a tuple of ignore strings? I

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread larry.mart...@gmail.com
On Jul 18, 4:49 pm, Paul Rubin no.em...@nospam.invalid wrote: larry.mart...@gmail.com larry.mart...@gmail.com writes: I have an interesting problem I'm trying to solve. I have a solution almost working, but it's super ugly, and know there has to be a better, cleaner way to do it. ... My

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread Paul Rubin
larry.mart...@gmail.com larry.mart...@gmail.com writes: Thanks for the reply Paul. I had not heard of itertools. It sounds like just what I need for this. But I am having 1 issue - how do you know how many items are in each group? Simplest is: for key, group in groupby(xs, lambda

properly catch SIGTERM

2012-07-19 Thread Eric Frederich
So I wrote a script which acts like a daemon. And it starts with something like this ### Begin Code import signal STOPIT = False def my_SIGTERM_handler(signum, frame): global STOPIT print '\n--- Caught SIGTERM; Attempting to quit gracefully ---' STOPIT = True

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread Paul Rubin
larry.mart...@gmail.com larry.mart...@gmail.com writes: You can't do a len on the iterator that is returned from groupby, and I've tried to do something with imap or defaultdict, but I'm not getting anywhere. I guess I can just make 2 passes through the data, the first time getting

logging time format millisecond precision

2012-07-19 Thread Alex van der Spek
I use this formatter in logging: formatter = logging.Formatter(fmt='%(asctime)s \t %(name)s \t %(levelname)s \t %(message)s') Sample output: 2012-07-19 21:34:58,382 root INFO Removed - C:\Users\ZDoor\Documents The time stamp has millisecond precision but the decimal separator is a

Let child process to run while parent is out (multiprocessing)

2012-07-19 Thread John Wong
def main(...): build_id = create_build_id(...) build_stuff return build_id Suppose build_stuff compiles a C program. It could take days to finish, and notify users their builds are ready. I was thinking about using mutliprocessing to handle the build_stuff. So here is a sample:

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread John Gordon
In mailman.2317.1342730879.4697.python-l...@python.org Dennis Lee Bieber wlfr...@ix.netcom.com writes: Sure it terminates...If you don't run out of RAM to represent the number i in question, there's also this heat death of the universe limit I keep hearing about ;-) Since the

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread MRAB
On 19/07/2012 20:06, larry.mart...@gmail.com wrote: On Jul 19, 1:02 pm, Prasad, Ramit ramit.pra...@jpmorgan.com wrote: I am making the assumption that you intend to collapse the directory tree and store each file in the same directory, otherwise I can't think of why you need to do this.

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread OKB (not okblacke)
MRAB wrote: Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Chris Angelico
On Fri, Jul 20, 2012 at 7:01 AM, John Gordon gor...@panix.com wrote: In mailman.2317.1342730879.4697.python-l...@python.org Dennis Lee Bieber wlfr...@ix.netcom.com writes: Sure it terminates...If you don't run out of RAM to represent the number i in question, there's also this heat death

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread John Gordon
In mailman.2320.1342736459.4697.python-l...@python.org Chris Angelico ros...@gmail.com writes: The second law of thermodynamics states that energy tends to go from higher states to lower, with heat being the very lowest. It's possible to do work using (say) kinetic energy, and in the process,

help

2012-07-19 Thread Miriam Gomez Rios
Hello, sorry for bothering you, but I have a doubt, Is there a way to turn this string into a tuplelist??, I need it for gurobi

Re: Let child process to run while parent is out (multiprocessing)

2012-07-19 Thread Chris Angelico
On Fri, Jul 20, 2012 at 6:34 AM, John Wong gokoproj...@gmail.com wrote: Here is output: yeukhon@fermat:~$ python c2.py abcd12345 done [now hangs for 10 seconds] I build things Side point: I just tried your code on Python 2.6 on Windows, and it produced all three lines of output before

Re: help

2012-07-19 Thread Benjamin Kaplan
On Jul 19, 2012 4:04 PM, Miriam Gomez Rios miriam.gome...@udlap.mx wrote: Hello, sorry for bothering you, but I have a doubt, Is there a way to turn this string into a tuplelist??, I need it for gurobi

Re: help

2012-07-19 Thread Tim Chase
On 07/19/12 17:31, Miriam Gomez Rios wrote: Hello, sorry for bothering you, but I have a doubt, Is there a way to turn this string into a tuplelist??, I need it for gurobi

RE: help

2012-07-19 Thread Prasad, Ramit

Re: help

2012-07-19 Thread Tim Chase
On 07/19/12 18:26, Prasad, Ramit wrote:

best way to handle this in Python

2012-07-19 Thread Rita
Hello, I have data in many files (/data/year/month/day/) which are named like YearMonthDayHourMinute.gz. I would like to build a data structure which can easily handle querying the data. So for example, if I want to query data from 3 weeks ago till today, i can do it rather quickly. each

Re: Which lib can diff two dict tree?

2012-07-19 Thread alex23
On Jul 19, 7:51 pm, esbat...@gmail.com wrote: Q1: which lib can diff two dict tree? Q2 How can I diff two json file?How can I get struct_diff and value_diff? Q3 How can I diff two xml file? How can I get struct_diff and value_diff? Rather than trying to come up with a method for finding the

Re: help

2012-07-19 Thread Tim Chase
On 07/19/12 19:32, Miriam Gomez Rios wrote: s = ('per1','persona1.1','pro1'),('per1','persona1.1','pro2') resulting_tuple_of_tuples = ast.literal_eval(s) Traceback (most recent call last): File C:\Users\Miriam\scripts\prueba_datos, line 124, in module print

Re: best way to handle this in Python

2012-07-19 Thread Dave Angel
On 07/19/2012 07:51 PM, Rita wrote: Hello, I have data in many files (/data/year/month/day/) which are named like YearMonthDayHourMinute.gz. I would like to build a data structure which can easily handle querying the data. So for example, if I want to query data from 3 weeks ago till today,

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread larry.mart...@gmail.com
On Jul 19, 1:56 pm, Paul Rubin no.em...@nospam.invalid wrote: larry.mart...@gmail.com larry.mart...@gmail.com writes: You can't do a len on the iterator that is returned from groupby, and I've tried to do something with imap or      defaultdict, but I'm not getting anywhere. I guess I can

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread larry.mart...@gmail.com
On Jul 19, 3:32 pm, MRAB pyt...@mrabarnett.plus.com wrote: On 19/07/2012 20:06, larry.mart...@gmail.com wrote: On Jul 19, 1:02 pm, Prasad, Ramit ramit.pra...@jpmorgan.com wrote: I am making the assumption that you intend to collapse the directory tree and store each file in the

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread larry.mart...@gmail.com
On Jul 19, 1:43 pm, Paul Rubin no.em...@nospam.invalid wrote: larry.mart...@gmail.com larry.mart...@gmail.com writes: Thanks for the reply Paul. I had not heard of itertools. It sounds like just what I need for this. But I am having 1 issue - how do you know how many items are in each

Re: best way to handle this in Python

2012-07-19 Thread Rita
Using linux 2.6.31; Python 2.7.3. I am not necessary looking for code just a pythonic way of doing it. Eventually, I would like to graph the data using matplotlib On Thu, Jul 19, 2012 at 8:52 PM, Dave Angel d...@davea.name wrote: On 07/19/2012 07:51 PM, Rita wrote: Hello, I have data

Re: Need help connecting via a remote VPN

2012-07-19 Thread The Coca Cola Kid
Dave Angel wrote in message news:mailman.2284.1342663213.4697.python-l...@python.org... Starting a VPN simply makes it possible for IP packets to get to the specified machine. You still need to match some protocol that the particular remote machine can handle. SSH is probably the most

Re: Need help connecting via a remote VPN

2012-07-19 Thread Dave Angel
On 07/19/2012 09:41 PM, The Coca Cola Kid wrote: Dave Angel wrote in message news:mailman.2284.1342663213.4697.python-l...@python.org... Starting a VPN simply makes it possible for IP packets to get to the specified machine. You still need to match some protocol that the particular remote

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread larry.mart...@gmail.com
On Jul 19, 7:01 pm, larry.mart...@gmail.com larry.mart...@gmail.com wrote: On Jul 19, 3:32 pm, MRAB pyt...@mrabarnett.plus.com wrote: On 19/07/2012 20:06, larry.mart...@gmail.com wrote: On Jul 19, 1:02 pm, Prasad, Ramit ramit.pra...@jpmorgan.com wrote: I am making the

[issue15389] PEP 3121, 384 refactoring applied to curses module

2012-07-19 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Definitely. -- versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15389 ___

[issue9998] ctypes find_library should search LD_LIBRARY_PATH on linux

2012-07-19 Thread Vinay Sajip
Changes by Vinay Sajip vinay_sa...@yahoo.co.uk: -- versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9998 ___ ___

[issue15389] PEP 3121, 384 refactoring applied to curses module

2012-07-19 Thread Robin Schreiber
Changes by Robin Schreiber robin.schrei...@me.com: -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15389 ___ ___ Python-bugs-list

[issue12834] PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-07-19 Thread Christian Heimes
Christian Heimes li...@cheimes.de added the comment: It looks like Stefan has fixed the issue in Python 3.3 a while ago. tobytes() returns the correct values with a fresh build of Python 3.3. $ PYTHONPATH=. /home/heimes/dev/python/py3k/python smc/freeimage/tests/test_image.py test_newbuffer

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-19 Thread Antti Laine
New submission from Antti Laine antti.a.la...@iki.fi: raw_decode on json.JSONDecoder does not handle leading whitespace. According to RFC 4627, section 2, whitespace can precede an object. With json.loads leading whitespace is handled just fine. d = json.JSONDecoder() d.raw_decode(' {}')

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-19 Thread Antti Laine
Antti Laine antti.a.la...@iki.fi added the comment: My coworker just submitted a pull request for a possible fix to simplejson on github. https://github.com/simplejson/simplejson/pull/38 -- ___ Python tracker rep...@bugs.python.org

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-19 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti versions: +Python 3.3, Python 3.4 -Python 2.6, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15393 ___

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-19 Thread Jesús Cea Avión
Jesús Cea Avión j...@jcea.es added the comment: Please, post a patch for 2.7 and 3.2/3.3, with a test. Seems quite easy. If you hurry, this could go in 3.3.0. -- keywords: +easy nosy: +jcea stage: - needs patch ___ Python tracker

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-19 Thread Antti Laine
Antti Laine antti.a.la...@iki.fi added the comment: Suggestion for a patch for 3.3.0. I wasn't quite sure how the testcases were supposed to be loaded. Sorry if I made a mess ;) -- keywords: +patch Added file: http://bugs.python.org/file26434/json-raw-decoder-fix-whitespace.diff

[issue15392] Create a unittest framework for IDLE

2012-07-19 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: All the tests should run from the standard test runner tool (currently regrtest), with the GUI tests guarded by the GUI resource, which is how it works for TK. I always run the test suite with -uall before non-trivial commits, so I do

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-19 Thread Jesús Cea Avión
Jesús Cea Avión j...@jcea.es added the comment: Antti, you are changing the signature of decode() and that would be a compatibility problem. Can you rewrite the patch to be more compatible? In your test, please, use a bit more complicated object than {} :-) --

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-19 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: IMO this is not a bug, according to the current documentation it is working as designed. raw_decode says it decodes a string that *starts with* a json document. To my understanding, raw_decode is designed to be used when parsing a

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-19 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Ah, I see, you are thinking that json document includes the possibility of leading whitespace. That is a reasonable interpretation...just make sure that we don't break backward compatibility. --

[issue13907] test_pprint relies on set/dictionary repr() ordering

2012-07-19 Thread Anton Barkovsky
Anton Barkovsky swarmer...@gmail.com added the comment: This test breaks now even in CPython. Remove it and be done with it? -- nosy: +anton.barkovsky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13907

[issue15394] memory leak in PyModule_Create2

2012-07-19 Thread Julia Lawall
New submission from Julia Lawall julia.law...@lip6.fr: In objects/moduleobject.c, in the function PyModule_Create2, it appears that m should be decrefed on all of the failure paths between its allocation and the return from the function. -- files: moduleobject.patch keywords: patch

[issue12834] PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-07-19 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: In Python 3.3 memoryobject.c is a complete rewrite. Porting the fix separately would be quite a bit of work. PyBuffer_ToContiguous(), which causes the problem in 2.7/3.2 and is still broken in 3.3, could be fixed by using the recursive

[issue15395] memory leaks in selectmodule.c

2012-07-19 Thread Julia Lawall
New submission from Julia Lawall julia.law...@lip6.fr: In Modules/selectmodule.c, in the function seq2set, fast_seq should be decrefd on failure of the initialization of o. This will make a useless call to DECREF on o, but XDECREF is already used, so it is safe in the NULL case. In the same

[issue14811] decoding_fgets() truncates long lines and fails with a SyntaxError(Non-UTF-8 code starting with...)

2012-07-19 Thread Hynek Schlawack
Hynek Schlawack h...@ox.cx added the comment: Are we going to fix this before 3.3? Any objections to Victor's patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14811 ___

[issue15396] memory leak in tkinter

2012-07-19 Thread Julia Lawall
New submission from Julia Lawall julia.law...@lip6.fr: In the file Modules/_tkinter.c, in the function PyInit__tkinter, m should be decrefed on the PyType_Ready error path. -- files: tkinter.patch keywords: patch messages: 165842 nosy: jll priority: normal severity: normal status: open

[issue15394] memory leak in PyModule_Create2

2012-07-19 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: This looks OK to me (I don't see a way to write a test case to cover the leak). I will commit later today unless I hear some objections. -- assignee: - meador.inge nosy: +meador.inge stage: - commit review versions: +Python 3.3

[issue15364] sysconfig confused by relative paths

2012-07-19 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: I'd make get_config_var('srcdir') to be None for installed systems, because the source tree is not available there. While playing with a version of the patch which returns None for non-source builds, I found that

[issue15397] Unbinding of methods

2012-07-19 Thread Stefan Mihaila
Changes by Stefan Mihaila mstefa...@gmail.com: -- nosy: +alexandre.vassalotti, ncoghlan, rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15397 ___

[issue15397] Unbinding of methods

2012-07-19 Thread Stefan Mihaila
New submission from Stefan Mihaila mstefa...@gmail.com: In order to implement pickling of instance methods, a means of separating the object and the unbound method is necessary. This is easily done for Python methods (f.__self__ and f.__func__), but not all of builtins support __func__.

[issue15397] Unbinding of methods

2012-07-19 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +meador.inge stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15397 ___ ___

[issue15397] Unbinding of methods

2012-07-19 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15397 ___ ___

[issue15397] Unbinding of methods

2012-07-19 Thread Andrew Svetlov
Andrew Svetlov andrew.svet...@gmail.com added the comment: Can you push patch in form available for review via Rietveld? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15397 ___

[issue15397] Unbinding of methods

2012-07-19 Thread Yury Selivanov
Changes by Yury Selivanov yselivanov...@gmail.com: -- nosy: +yselivanov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15397 ___ ___

[issue1492704] distinct error type if shutil.copyfile() fails because of src and dst are the same file

2012-07-19 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 9e94eb39aaad by Hynek Schlawack in branch 'default': #1492704: Make shutil.copyfile() raise a distinct SameFileError http://hg.python.org/cpython/rev/9e94eb39aaad -- nosy: +python-dev

[issue1492704] distinct error type if shutil.copyfile() fails because of src and dst are the same file

2012-07-19 Thread Hynek Schlawack
Hynek Schlawack h...@ox.cx added the comment: As beta2 has been postponed I have already committed it with some slight modifications. Re: deriving from Error: It doesn't make any sense to do so but this way we're mostly backward compatible. Changing it to EnvironmentError uncovered the two

[issue15038] Optimize python Locks on Windows

2012-07-19 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: I see dead code here: Py_LOCAL_INLINE(int) PyCOND_BROADCAST(PyCOND_T *cv) { if (cv-waiting 0) { return ReleaseSemaphore(cv-sem, cv-waiting, NULL) ? 0 : -1; cv-waiting = 0; } return 0; } --

[issue15398] intermittence on UnicodeFileTests.test_rename at test_pep277 on MacOS X

2012-07-19 Thread Flávio Ribeiro
New submission from Flávio Ribeiro em...@flavioribeiro.com: Found a intermittent test on UnicodeFileTests.test_rename method. Python Version: Python 3.3.0b1 Hg commit hash: 3fbfa61634de MacOS X version 10.6.8 How can be reproduced: bumblebee:~/dev/cpython[] $ for i in {1..10}; do

[issue15398] intermittence on UnicodeFileTests.test_rename at test_pep277 on MacOS X

2012-07-19 Thread Tatiana Al-Chueyr
Tatiana Al-Chueyr tatiana.alchu...@gmail.com added the comment: I had the same problem here, after running several times... $ for i in {1..10}; do ./python.exe -m test test_pep277; done [1/1] test_pep277 test test_pep277 failed -- Traceback (most recent call last): File

[issue15399] processName key is un-/mis-documented in 2.6 and up

2012-07-19 Thread Gunnlaugur Thor Briem
New submission from Gunnlaugur Thor Briem gunnlau...@gmail.com: The ``processName`` format mapping key in logging formats works in versions 2.6.*, 2.7.* and 3.1.* onwards; in 2.5 and down and in 3.0.1, ``format`` fails when this key is present in the format. But in 2.6.8 docs, this mapping

[issue15394] memory leak in PyModule_Create2

2012-07-19 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 7140d97d36fd by Meador Inge in branch '3.2': Issue #15394: Fix ref leaks in PyModule_Create. http://hg.python.org/cpython/rev/7140d97d36fd New changeset 571777bf5527 by Meador Inge in branch 'default': Issue #15394:

  1   2   >