Re: running python 2 vs 3

2014-03-21 Thread Chris Angelico
On Fri, Mar 21, 2014 at 4:49 PM, Marko Rauhamaa ma...@pacujo.net wrote: Chris Angelico ros...@gmail.com: go for the lowest common denominator: print(some single string) which works happily in all versions of Python. Whenever I have used print in my code, it has been with a redirection.

Re: Question about Source Control

2014-03-21 Thread Cameron Simpson
On 21Mar2014 07:40, Frank Millman fr...@chagford.com wrote: Cameron Simpson c...@zip.com.au wrote in message news:20140321013313.ga58...@cskk.homeip.net... Someone intending to clone the project and develop will probably want the whole repository; as Gregory says - they can then easily

Re: running python 2 vs 3

2014-03-21 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: Then you're probably not using sys.stdout.write but some other file object's write method. Correct, sys.stderr.write would have been a more accurate choice. Also, I find it highly unusual that you never use print in its most basic and intended form.

Re: running python 2 vs 3

2014-03-21 Thread Rustom Mody
On Friday, March 21, 2014 11:38:42 AM UTC+5:30, Marko Rauhamaa wrote: Chris Angelico : Then you're probably not using sys.stdout.write but some other file object's write method. Correct, sys.stderr.write would have been a more accurate choice. Also, I find it highly unusual that you

Need help in Python automation

2014-03-21 Thread Anil Kumar A
- Hi All, I work for an ISP. Currently we bought few switches and routers. Python is available in that switches. So I would like to write some scipts which I can run inside switch. I tried module 'os, system', but It is not executing

Re: running python 2 vs 3

2014-03-21 Thread Mark Lawrence
On 21/03/2014 02:18, Chris Angelico wrote: On Fri, Mar 21, 2014 at 12:06 PM, Roy Smith r...@panix.com wrote: In article 532b8f0d$0$29994$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: The rule of three applies here: anything you do in three

Re: Python - Caeser Cipher Not Giving Right Output

2014-03-21 Thread Mark Lawrence
On 21/03/2014 04:23, dtran...@gmail.com wrote: Would you please access this list via https://mail.python.org/mailman/listinfo/python-list or read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing double line spacing and single line paragraphs, thanks. --

Re: Need help in Python automation

2014-03-21 Thread Adnan Sadzak
Hi, there should be manufacturer documentation or API. What switch do You use? Any other info? Cheers, Adnan On Fri, Mar 21, 2014 at 9:14 AM, Anil Kumar A 401a...@gmail.com wrote: - Hi All, I work for an ISP. Currently we bought

Re: CallBack function in C Libraries.

2014-03-21 Thread fiensproto
I'm afraid it doesn't help that GoogleGroups has badly mangled the formatting of your code. I'm not quite sure what to suggest since it isn't one of the usual problems, but you might find reading https://wiki.python.org/moin/GoogleGroupsPython helpful. It will certainly help

Re: running python 2 vs 3

2014-03-21 Thread alister
On Fri, 21 Mar 2014 09:40:40 +, Mark Lawrence wrote: On 21/03/2014 02:18, Chris Angelico wrote: On Fri, Mar 21, 2014 at 12:06 PM, Roy Smith r...@panix.com wrote: In article 532b8f0d$0$29994$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:

Re: Question about Source Control

2014-03-21 Thread Roy Smith
In article mailman.8348.1395381664.18130.python-l...@python.org, Cameron Simpson c...@zip.com.au wrote: hg blame bin/set-x and the output goes: [hg/css]fleet* hg blame bin/set-x 2186: #!/bin/sh 11359: # 11359: # Trace execution of a command. There's two things hg

Github down?

2014-03-21 Thread Skip Montanaro
Anybody else having trouble getting to Github? I'm trying to get to the pythondotorg issue tracker: https://github.com/python/pythondotorg/issues Thx, Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: Github down?

2014-03-21 Thread Larry Martell
On Fri, Mar 21, 2014 at 9:22 AM, Skip Montanaro s...@pobox.com wrote: Anybody else having trouble getting to Github? I'm trying to get to the pythondotorg issue tracker: https://github.com/python/pythondotorg/issues They post the status at: https://twitter.com/githubstatus As of 10 minutes

csv read _csv.Error: line contains NULL byte

2014-03-21 Thread chip9munk
Hi all! I am reading from a huge csv file ( 20 Gb), so I have to read line by line: for i, row in enumerate(input_reader): # and I do something on each row Everything works fine until i get to a row with some strange symbols 0I`00�^ at that point I get an error: _csv.Error: line contains

Re: csv read _csv.Error: line contains NULL byte

2014-03-21 Thread Tim Golden
On 21/03/2014 13:29, chip9m...@gmail.com wrote: Hi all! I am reading from a huge csv file ( 20 Gb), so I have to read line by line: for i, row in enumerate(input_reader): # and I do something on each row Everything works fine until i get to a row with some strange symbols 0I`00�^

Re: Github down?

2014-03-21 Thread Skip Montanaro
On Fri, Mar 21, 2014 at 8:24 AM, Larry Martell larry.mart...@gmail.com wrote: https://twitter.com/githubstatus Thanks for the pointer. I'm an old fart and don't use social media much (in fact, just closed my FB account a couple days ago). Does that mean I'm a curmudgeon? :-) Skip --

Re: Github down?

2014-03-21 Thread Chris “Kwpolska” Warrick
On Fri, Mar 21, 2014 at 2:48 PM, Skip Montanaro s...@pobox.com wrote: On Fri, Mar 21, 2014 at 8:24 AM, Larry Martell larry.mart...@gmail.com wrote: https://twitter.com/githubstatus Thanks for the pointer. I'm an old fart and don't use social media much (in fact, just closed my FB account a

Re: Github down?

2014-03-21 Thread Larry Martell
On Fri, Mar 21, 2014 at 9:48 AM, Skip Montanaro s...@pobox.com wrote: On Fri, Mar 21, 2014 at 8:24 AM, Larry Martell larry.mart...@gmail.com wrote: https://twitter.com/githubstatus Thanks for the pointer. I'm an old fart and don't use social media much (in fact, just closed my FB account a

ANN: Wing IDE 5.0.4 released

2014-03-21 Thread Wingware
Hi, Wingware has released version 5.0.4 of Wing IDE, our cross-platform integrated development environment for the Python programming language. Wing IDE includes a professional quality code editor with vi, emacs, visual studio, and other key bindings, auto-completion, call tips,

Re: Github down?

2014-03-21 Thread Mark Lawrence
On 21/03/2014 13:22, Skip Montanaro wrote: Anybody else having trouble getting to Github? I'm trying to get to the pythondotorg issue tracker: https://github.com/python/pythondotorg/issues Thx, Skip http://www.downforeveryoneorjustme.com/ -- My fellow Pythonistas, ask not what our

Re: csv read _csv.Error: line contains NULL byte

2014-03-21 Thread chip9munk
On Friday, March 21, 2014 2:39:37 PM UTC+1, Tim Golden wrote: Without disturbing your existing code too much, you could wrap the input_reader in a generator which skips malformed lines. That would look something like this: def unfussy_reader(reader): while True:

Re: csv read _csv.Error: line contains NULL byte

2014-03-21 Thread chip9munk
Ok, I have figured it out: for i, row in enumerate(unfussy_reader(input_reader): # and I do something on each row Sorry, it is my first face to face with generators! Thank you very much! Best, Chip Munk -- https://mail.python.org/mailman/listinfo/python-list

Re: csv read _csv.Error: line contains NULL byte

2014-03-21 Thread Tim Golden
On 21/03/2014 14:46, chip9m...@gmail.com wrote: I am sorry I do not understand how to get to each row in this way. Please could you explain also this: If I define this function, how do I change my for loop to get each row? Does this help? code #!python3 import csv def

Re: csv read _csv.Error: line contains NULL byte

2014-03-21 Thread Mark Lawrence
On 21/03/2014 14:46, chip9m...@gmail.com wrote: On Friday, March 21, 2014 2:39:37 PM UTC+1, Tim Golden wrote: Without disturbing your existing code too much, you could wrap the input_reader in a generator which skips malformed lines. That would look something like this: def

Implement multiprocessing without inheriting parent file handle

2014-03-21 Thread Antony Joseph
Hi all, How can i implement multiprocessing without inherit file descriptors from my parent process? Please help me. regards, Antony -- https://mail.python.org/mailman/listinfo/python-list

Re: CallBack function in C Libraries.

2014-03-21 Thread Mark H Harris
On 3/21/14 7:02 AM, fienspr...@gmail.com wrote: Yep, Many thanks for help Hum, i have find the solution, it was in CallBack function in help-doc. No, it was not in the CallBack function in help-doc ... def TheProc(): == you moved c_int from here ...

Re: Question about Source Control

2014-03-21 Thread Chris Angelico
On Fri, Mar 21, 2014 at 11:23 PM, Roy Smith r...@panix.com wrote: There's two things hg blame doesn't do which would be useful. First, the trivial one. I don't want lines annotated by change number, I want them annotated by the name of the person who checked it in. But, I'm sure that can be

Re: Implement multiprocessing without inheriting parent file handle

2014-03-21 Thread Mark H Harris
On 3/21/14 10:28 AM, Antony Joseph wrote: How can i implement multiprocessing without inherit file descriptors from my parent process? I'll bite... If what you mean by 'multiprocessing' is forking a process, to get a child process, which will then do some parallel processing for some

Re: Implement multiprocessing without inheriting parent file handle

2014-03-21 Thread Grant Edwards
On 2014-03-21, Antony Joseph antonyjosep...@gmail.com wrote: How can i implement multiprocessing without inherit file descriptors from my parent process? What one typically does if that is desired is to call fork() and then in the child process close all open file descriptors before doing any

Re: Implement multiprocessing without inheriting parent file handle

2014-03-21 Thread Marko Rauhamaa
Antony Joseph antonyjosep...@gmail.com: How can i implement multiprocessing without inherit file descriptors from my parent process? Take a look at the subprocess module: URL: http://docs.python.org/3/library/subprocess.html#popen-constructor It's got the optional close_fds parameter,

Python3 - temporarily change the file encoding

2014-03-21 Thread Helmut Jarausch
Hi, my locale is en_US.iso88591 But now I'd like to process a restructuredtext file which is encoded in utf-8. rst2html has #!/usr/bin/python3.3 # $Id: rst2html.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: David Goodger good...@python.org # Copyright: This module has been placed in the

Re: Question about Source Control

2014-03-21 Thread Tim Chase
On 2014-03-22 04:23, Chris Angelico wrote: The hard thing is I don't really want to know which change most recently touched the line of text. I want to know who really wrote it. It would be wonderful if hg were smart enough to be able to back-track through the change history and ignore

Re: Question about Source Control

2014-03-21 Thread Tim Chase
On 2014-03-21 12:54, Tim Chase wrote: A quick hg -help blame Sigh. Accidentally hit enter when I meant to hit backspace with control down. That is, of course hg help blame, formerly written there as hg -v help blame and accidentally sent mid-edit. -tkc --

Re: Implement multiprocessing without inheriting parent file handle

2014-03-21 Thread Mark H Harris
On 3/21/14 12:42 PM, Marko Rauhamaa wrote: http://docs.python.org/3/library/subprocess.html#popen-constructor It's got the optional close_fds parameter, which is True by default. IOW, you don't need to do anything if you use subprocess.Popen() to start your child process. Incidentally,

Re: Python3 - temporarily change the file encoding

2014-03-21 Thread Peter Otten
Helmut Jarausch wrote: Hi, my locale is en_US.iso88591 But now I'd like to process a restructuredtext file which is encoded in utf-8. rst2html has #!/usr/bin/python3.3 # $Id: rst2html.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: David Goodger good...@python.org # Copyright:

Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread vasudevram
Hi list, Can anyone - maybe one of the Python language core team, or someone with knowledge of the internals of Python - can explain why this code works, and whether the different occurrences of the name x in the expression, are in different scopes or not? : x = [[1,2], [3,4], [5,6]] [x

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Rustom Mody
On Saturday, March 22, 2014 2:12:53 AM UTC+5:30, vasudevram wrote: Hi list, Can anyone - maybe one of the Python language core team, or someone with knowledge of the internals of Python - can explain why this code works, and whether the different occurrences of the name x in the expression,

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread vasudevram
On Saturday, March 22, 2014 2:24:00 AM UTC+5:30, Rustom Mody wrote: Lets try without comprehending comprehensions :-) x=[[1,2],[3,4]] for x in x: ... for x in x: ... print x ... 1 2 3 4 Nice and all, thanks, but doesn't answer the question. --

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Rustom Mody
On Saturday, March 22, 2014 2:26:09 AM UTC+5:30, vasudevram wrote: On Saturday, March 22, 2014 2:24:00 AM UTC+5:30, Rustom Mody wrote: Lets try without comprehending comprehensions :-) x=[[1,2],[3,4]] for x in x: ... for x in x: ... print x ... 1 2 3 4 Nice and

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Ian Kelly
On Fri, Mar 21, 2014 at 3:09 PM, Rustom Mody rustompm...@gmail.com wrote: A 'for' introduces a scope: This is false. x = 42 for x in [1,2,3]: ... print x ... 1 2 3 No sign of the 42 --v ie the outer x -- inside because of scope Try printing x again *after* the for loop: x = 42

Re: Question about Source Control

2014-03-21 Thread Cameron Simpson
On 21Mar2014 08:23, Roy Smith r...@panix.com wrote: In article mailman.8348.1395381664.18130.python-l...@python.org, Cameron Simpson c...@zip.com.au wrote: hg blame bin/set-x and the output goes: [hg/css]fleet* hg blame bin/set-x 2186: #!/bin/sh 11359: #

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Gregory Ewing
Rustom Mody wrote: A 'for' introduces a scope: No, it doesn't! x = 42 for x in [1,2,3]: ... print x ... 1 2 3 No sign of the 42 --v ie the outer x -- inside because of scope You're right that there's no sign of the 42, but it's *not* because of scope, as you'll see if you do one

Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread cool-RR
Hi everybody, I need to install Python 3.4 final urgently, because my IDE stopped supporting Python 3.4 beta2, and I need it urgently to work. I downloaded it, but the MSI won't install. It didn't work on both of my computers (Windows 7 64bit). I managed to have the MSI dump data to log, file

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread cool-RR
Sorry, couldn't attach the file, here's the log file: https://gist.github.com/anonymous/9697505 On Saturday, March 22, 2014 12:05:59 AM UTC+2, cool-RR wrote: Hi everybody, I need to install Python 3.4 final urgently, because my IDE stopped supporting Python 3.4 beta2, and I need it

Re: Question about Source Control

2014-03-21 Thread Chris Angelico
On Sat, Mar 22, 2014 at 8:32 AM, Cameron Simpson c...@zip.com.au wrote: Basicly, run hg log for the file, and examine each of the diffs WRT to your target line. Refactoring raises the bar somewhat. Here's one where git and hg are a lot more different. When I'm trying to find the origin of

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread Chris Angelico
On Sat, Mar 22, 2014 at 9:05 AM, cool-RR ram.rac...@gmail.com wrote: I downloaded it, but the MSI won't install. It didn't work on both of my computers (Windows 7 64bit). What the hell. Was python.org hacked by communists? First question: Where did you download from? What file did you get?

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread cool-RR
I did download from python.org. I checked the md5, it was incorrect, then I downloaded again by using a proxy in Austria. (Which hopefully the communists haven't be able to infiltrate? ;) Now it worked! Woohoo! I'm still curious about the bad installation file... And what Ho Chi Minh is doing

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread cool-RR
Here's the offending MSI, if anyone wants to investigate: https://dl.dropboxusercontent.com/u/1927707/python-3.4.0.amd64.msi On Saturday, March 22, 2014 12:34:06 AM UTC+2, cool-RR wrote: I did download from python.org. I checked the md5, it was incorrect, then I downloaded again by using a

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread Chris Angelico
On Sat, Mar 22, 2014 at 9:34 AM, cool-RR ram.rac...@gmail.com wrote: I did download from python.org. I checked the md5, it was incorrect, then I downloaded again by using a proxy in Austria. (Which hopefully the communists haven't be able to infiltrate? ;) I think you should follow the

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread Mark Lawrence
On 21/03/2014 22:34, cool-RR wrote: I'm pleased to see that you have answers. In return would you either use the mailing list https://mail.python.org/mailman/listinfo/python-list or read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing double line spacing

Re: Implement multiprocessing without inheriting parent file handle

2014-03-21 Thread Chris Angelico
On Sat, Mar 22, 2014 at 5:16 AM, Mark H Harris harrismh...@gmail.com wrote: On 3/21/14 12:42 PM, Marko Rauhamaa wrote: http://docs.python.org/3/library/subprocess.html#popen-constructor It's got the optional close_fds parameter, which is True by default. IOW, you don't need to do

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread cool-RR
On Saturday, March 22, 2014 12:42:56 AM UTC+2, Chris Angelico wrote: I think you should follow the internet version of Hanlon's Razor here: Damaged transmission before deliberate tampering. :) It's far more likely something simply got misdownloaded, and your guess about timezones is the most

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread cool-RR
On Saturday, March 22, 2014 12:25:03 AM UTC+2, Chris Angelico wrote: (First and a halfth question: When you say won't install, exactly what do you mean? For completeness, I'll answer this question I forgot to answer, in case someone still wants to investigate: It just showed the first dialog

Re: CallBack function in C Libraries.

2014-03-21 Thread fiensproto
Le vendredi 21 mars 2014 16:50:18 UTC, Mark H. Harris a écrit : def TheProc(): == you moved c_int from here ... fpgui.fpgFormWindowTitle(0, 'Boum') return 0 CMPFUNC = CFUNCTYPE(c_int) and placed it here ... ... it wasn't expecting

Re: Github down?

2014-03-21 Thread Dan Sommers
On Fri, 21 Mar 2014 14:51:54 +0100, Chris “Kwpolska” Warrick wrote: (though GitHub could qualify as social media for some…) +1 QOTW -- https://mail.python.org/mailman/listinfo/python-list

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread Terry Reedy
On 3/21/2014 6:55 PM, cool-RR wrote: On Saturday, March 22, 2014 12:25:03 AM UTC+2, Chris Angelico wrote: (First and a halfth question: When you say won't install, exactly what do you mean? For completeness, I'll answer this question I forgot to answer, in case someone still wants to

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Rustom Mody
On Saturday, March 22, 2014 3:00:10 AM UTC+5:30, Ian wrote: On Fri, Mar 21, 2014 at 3:09 PM, Rustom Mody wrote: A 'for' introduces a scope: This is false. And On Saturday, March 22, 2014 3:04:48 AM UTC+5:30, Gregory Ewing wrote: A 'for' introduces a scope: No, it doesn't! Ha --

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Chris Angelico
On Sat, Mar 22, 2014 at 1:06 PM, Rustom Mody rustompm...@gmail.com wrote: Two: A comprehension variable is not bound but reassigned across the comprehension. This problem remains in python3 and causes weird behavior when lambdas are put in a comprehension fl = [lambda y : x+y for x in

Re: Question about Source Control

2014-03-21 Thread Cameron Simpson
On 22Mar2014 09:17, Chris Angelico ros...@gmail.com wrote: On Sat, Mar 22, 2014 at 8:32 AM, Cameron Simpson c...@zip.com.au wrote: Basicly, run hg log for the file, and examine each of the diffs WRT to your target line. Refactoring raises the bar somewhat. Here's one where git and hg

Re: Installing ssdeep on Portable Python /advice

2014-03-21 Thread Mark H Harris
On 3/20/14 7:16 PM, laguna...@mail.com wrote: $ tar -zxvf ssdeep-2.10.tar.gz $ cd ssdeep-2.10 ./configure make sudo make install I need install it on PortablePython for Windows, so it's not clear how to make this: where should be placed ssdeep Windows binary files, that Python

Re: Question about Source Control

2014-03-21 Thread Chris Angelico
On Sat, Mar 22, 2014 at 1:49 PM, Cameron Simpson c...@zip.com.au wrote: You might do better to ask this kind of question on the mercurial list: http://selenic.com/mailman/listinfo/mercurial Someone there is bound to have wanted to do this kind of thing, and may know if there's a tool or

Re: Installing ssdeep on Portable Python /advice

2014-03-21 Thread Mark H Harris
On 3/21/14 9:51 PM, Mark H Harris wrote: On 3/20/14 7:16 PM, laguna...@mail.com wrote: $ tar -zxvf ssdeep-2.10.tar.gz $ cd ssdeep-2.10 ./configure make sudo make install I need install it on PortablePython for Windows, so it's not clear how to make this: where should be placed ssdeep

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread Mark H Harris
On 3/21/14 5:44 PM, Mark Lawrence wrote: I'm pleased to see that you have answers. In return would you either use the mailing list https://mail.python.org/mailman/listinfo/python-list or read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing double line spacing

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread Chris Angelico
On Sat, Mar 22, 2014 at 2:58 PM, Mark H Harris harrismh...@gmail.com wrote: On 3/21/14 5:44 PM, Mark Lawrence wrote: I'm pleased to see that you have answers. In return would you either use the mailing list https://mail.python.org/mailman/listinfo/python-list or read and action this

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread Mark H Harris
On 3/21/14 11:15 PM, Chris Angelico wrote: It compounds. One reply makes for double spacing... two makes quadruple, three means we have seven wasted lines between every pair of real lines. That gets pretty annoying. And considering that most people who reply without cleaning up the lines also

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread Mark H Harris
On 3/21/14 11:30 PM, Mark H Harris wrote: All OS's should comply with the standard... for instance, there should not be a windows x'0a' x'0d' line ending, and a unix x'0d' line ending. whoops... I meant unix x'0a' line ending...;-) '\n' :-)) --

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Rustom Mody
On Saturday, March 22, 2014 8:11:27 AM UTC+5:30, Chris Angelico wrote: On Sat, Mar 22, 2014 at 1:06 PM, Rustom Mody wrote: Two: A comprehension variable is not bound but reassigned across the comprehension. This problem remains in python3 and causes weird behavior when lambdas are put in

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread Chris Angelico
On Sat, Mar 22, 2014 at 3:30 PM, Mark H Harris harrismh...@gmail.com wrote: All files should have standard delimiters. What I used to call flat-text files should have standard line-end delimiters, and standard file-end EOF markers. All OS's should comply with the standard... for instance,

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Steven D'Aprano
On Fri, 21 Mar 2014 19:06:06 -0700, Rustom Mody wrote: Two: A comprehension variable is not bound but reassigned across the comprehension. This problem remains in python3 and causes weird behavior when lambdas are put in a comprehension I don't know why you say the behaviour in Python is a

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Chris Angelico
On Sat, Mar 22, 2014 at 3:39 PM, Rustom Mody rustompm...@gmail.com wrote: So if that's not going to be broken, how is this fundamentally different? def func_loop(): for x in 1,2,3: yield (lambda: x) Thats using a for-loop A 'for' in a comprehension carries a different

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Mark H Harris
On 3/21/14 11:39 PM, Rustom Mody wrote: Given fl = [lambda y : x+y for x in [1,2,3]] It means: def rec(l): if not l: return [] else: x,ll = l[0],l[1:] return [lambda y: x + y] + rec(ll) followed by fl = rec([1,2,3]) Naturally a reasonable *implementation* would

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread Mark H Harris
On 3/21/14 11:46 PM, Chris Angelico wrote: (Side point: You have your 0d and your 0a backwards; the Unix line ending is U+000A, and the Windows default is U+000D U+000A.) Yeah, I know... smart apple. How are you going to make people change? What are you going to make them change to? Who

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Chris Angelico
On Sat, Mar 22, 2014 at 3:47 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Now I'm not sure precisely how Haskell implements this trick, but it suggests to me that it creates a different closure each time around the loop of the comprehension. That could end up being very

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread Terry Reedy
On 3/22/2014 12:30 AM, Mark H Harris wrote: On 3/21/14 11:15 PM, Chris Angelico wrote: It compounds. One reply makes for double spacing... two makes quadruple, three means we have seven wasted lines between every pair of real lines. That gets pretty annoying. And considering that most people

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Rustom Mody
On Saturday, March 22, 2014 10:21:13 AM UTC+5:30, Chris Angelico wrote: On Sat, Mar 22, 2014 at 3:39 PM, Rustom Mody wrote: So if that's not going to be broken, how is this fundamentally different? def func_loop(): for x in 1,2,3: yield (lambda: x) Thats using a for-loop A

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread Chris Angelico
On Sat, Mar 22, 2014 at 4:24 PM, Terry Reedy tjre...@udel.edu wrote: If I were in charge of the software used for this list, I would replace Mark with a custom addition to return mis-formated posts (more blank lines than not) with instructions on how to fix them. But I am not. I love how this

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Rustom Mody
On Saturday, March 22, 2014 10:21:13 AM UTC+5:30, Chris Angelico wrote: On Sat, Mar 22, 2014 at 3:39 PM, Rustom Mody wrote: So if that's not going to be broken, how is this fundamentally different? def func_loop(): for x in 1,2,3: yield (lambda: x) Thats using a for-loop

[issue10141] SocketCan support

2014-03-21 Thread Charles-François Natali
Charles-François Natali added the comment: Are you saying that an additional clause for CAN_RAW being defined should be added around where it is used? Would that sort things out? Yes. I'd rather not just revert my change, as that would mean I couldn't compile the SSL module. I don't get it:

[issue20999] setlocale, getlocale succession -- ValueError or (None, None)

2014-03-21 Thread Ned Deily
Ned Deily added the comment: It's hard to be absolutely sure what is going on here since you show several different interpreters and appear to be running on a non-standard, unsupported platform but, as David noted, the primary issue is that the process locale has almost certainly not been set

[issue21000] json.tool ought to have a help flag

2014-03-21 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21000 ___ ___

[issue20844] coding bug remains in 3.3.5rc2

2014-03-21 Thread Marc Schlaich
Marc Schlaich added the comment: I can reproduce this one. There are a few conditions which needs to be met: - Linux line endings - File needs to have at least x lines (empty lines are fine). I guess this is the point why no one could reproduce it. The attached file has 19 lines but probably

[issue20999] setlocale, getlocale succession -- ValueError or (None, None)

2014-03-21 Thread Ronald Oussoren
Ronald Oussoren added the comment: The locale issue is that on a default (us english) install of 10.9 the following locale related environment variables are set: $ set | grep UTF LANG=en_US.UTF-8 LC_CTYPE=UTF-8 The locale module doesn't understand the LC_CTYPE setting, and this appears to be

[issue20344] subprocess.check_output() docs misrepresent what shell=True does

2014-03-21 Thread Tuomas Savolainen
Tuomas Savolainen added the comment: Made a patch that throws exception as suggested: 3- Make check_output() throw an Exception if the first argument is a list and shell=True -- keywords: +patch nosy: +Tuomas.Savolainen Added file: http://bugs.python.org/file34543/issue20344.patch

[issue17128] OS X system openssl deprecated - installer should build local libssl

2014-03-21 Thread Ronald Oussoren
Ronald Oussoren added the comment: The link below contains a script for building fat binaries for openssl. There's nothing surprising in the script, just building multiple times and then merging the result using lipo. https://gist.github.com/foozmeat/5154962 BTW. I'm not proposing to use

[issue21003] how to do batch processing using python

2014-03-21 Thread Eric V. Smith
Eric V. Smith added the comment: This bug tracker is for reporting bugs in python. For questions on using python, please use the python-list mailing list: https://mail.python.org/mailman/listinfo/python-list -- nosy: +eric.smith resolution: - invalid stage: - committed/rejected

[issue21004] how to store json data into postgresql using python script

2014-03-21 Thread Eric V. Smith
New submission from Eric V. Smith: This bug tracker is for reporting bugs in python. For questions on using python, please use the python-list mailing list: https://mail.python.org/mailman/listinfo/python-list -- nosy: +eric.smith resolution: - rejected stage: - committed/rejected

[issue20927] Different behaviour on Posix and Windows when using subprocess.Popen(..., cwd=path)

2014-03-21 Thread Jovik
Jovik added the comment: I appreciate your suggestion regarding cygwin, but in the new code base we want to avoid this dependency. Thanks for your time on this issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20927

[issue21002] _sre.SRE_Scanner object should have a fullmatch() method

2014-03-21 Thread Gareth Gouldstone
Gareth Gouldstone added the comment: Scanner may not be a public interface but it is widely documented, not least on page 67 of the O'reilly Python Cookbook. Even if Scanner is not made public, then surely it should maintain consistency with the public interfaces? -- versions:

[issue10240] dict.update.__doc__ is misleading

2014-03-21 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- assignee: - docs@python components: +Documentation -Interpreter Core nosy: +berker.peksag, docs@python versions: +Python 3.4, Python 3.5 -Python 3.1, Python 3.2 ___ Python tracker

[issue21005] asyncio.docs : asyncio.subprocess.DEVNULL doc inadequate

2014-03-21 Thread Alexandre JABORSKA
New submission from Alexandre JABORSKA: asyncio.subprocess.DEVNULL documentation is the same as asyncio.subprocess.STDOUT one and (I guess) inadequate (cut paste error ?). -- assignee: docs@python components: Documentation messages: 214338 nosy: ajaborsk, docs@python priority: normal

[issue21005] asyncio.docs : asyncio.subprocess.DEVNULL doc inadequate

2014-03-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 70c77ff64df1 by Victor Stinner in branch 'default': Close #21005: Fix documentation of asyncio.subprocess.DEVNULL http://hg.python.org/cpython/rev/70c77ff64df1 -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status:

[issue21005] asyncio.docs : asyncio.subprocess.DEVNULL doc inadequate

2014-03-21 Thread STINNER Victor
STINNER Victor added the comment: and (I guess) inadequate (cut paste error ?). Correct, my bad. It's now fixed. Thanks for the report. -- nosy: +haypo resolution: fixed - stage: committed/rejected - status: closed - open ___ Python tracker

[issue21006] asyncio.docs : create_subprocess_exec example does not work on windows

2014-03-21 Thread Alexandre JABORSKA
New submission from Alexandre JABORSKA: The documentation example (getstatusoutput) does not work on windows because it use the default loop (based on select). The whole asyncio.ProactorEventLoop stuff is not really explained anywhere. Maybe a How to use asyncio on Windows could be useful.

[issue21006] asyncio.docs : create_subprocess_exec example does not work on windows

2014-03-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7cca663a72eb by Victor Stinner in branch 'default': Issue #21006: Fix subprocess example on Windows in asyncio doc http://hg.python.org/cpython/rev/7cca663a72eb -- nosy: +python-dev ___ Python tracker

[issue10141] SocketCan support

2014-03-21 Thread Vinay Sajip
Vinay Sajip added the comment: What error were you getting? That AF_CAN was undefined (even though HAVE_LINUX_CAN_H is). This is on Ubuntu Jaunty, which I use for my Python core development. Note the change you made in d4ce850b06b7 to fix this problem when it occurred before - it's the same

[issue21006] asyncio.docs : create_subprocess_exec example does not work on windows

2014-03-21 Thread STINNER Victor
STINNER Victor added the comment: Oh, the limit parameter StreamReader is not documented! Here is a patch to document it. -- nosy: +gvanrossum, haypo, yselivanov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21006

[issue21006] asyncio.docs : create_subprocess_exec example does not work on windows

2014-03-21 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file34544/streamreader_limit.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21006

[issue21006] asyncio.docs : create_subprocess_exec example does not work on windows

2014-03-21 Thread STINNER Victor
STINNER Victor added the comment: The whole asyncio.ProactorEventLoop stuff is not really explained anywhere. Maybe a How to use asyncio on Windows could be useful. It is explained in the subprocess methods of the event loop. Well, I expected this reaction: the subprocess documentation is

[issue21001] Python 3.4 MSI installer doesn't work

2014-03-21 Thread Ram Rachum
Ram Rachum added the comment: David: It's failing on both of my computers, laptop and desktop, not just one. Don't you guys have a simple command to create an .exe installer? This has a good chance of solving my problem. -- ___ Python tracker

[issue20995] Use Better Default Ciphers for the SSL Module

2014-03-21 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 21.03.2014 00:10, Donald Stufft wrote: We shouldn't do this in Python for the same reason we're not including a predefined set of CA root certificates with the distribution. The difference here is that there are properly maintained alternatives to

  1   2   3   >