Re: Can't get sqlite3.Row working: keyword lookup doesn't work

2014-01-26 Thread Peter Otten
lgabiot wrote: using Python 2.7.6 I try to access a sqlite database using keyword lookup instead of position (much more easy to maintain code), but it always fail, with the error: Index must be int or string I have created the database, populated it, and here is the code that tries to

Re: Python declarative

2014-01-26 Thread Rustom Mody
On Sunday, January 26, 2014 10:53:32 AM UTC+5:30, Chris Angelico wrote: On Sun, Jan 26, 2014 at 3:47 PM, Rustom Mody wrote: On Sunday, January 26, 2014 9:36:15 AM UTC+5:30, Chris Angelico wrote: Code isn't something to be afraid of. It's just text files like any other. After all, Python

Re: Python declarative

2014-01-26 Thread Frank Millman
Rustom Mody rustompm...@gmail.com wrote in message news:3683cd10-592b-4a3d-ba77-b963a1aa2...@googlegroups.com... Xml, originally a document format, is nowadays used as a data-format. This conduces to humongous messing, first for the xml-library writers, and thence to the users of those

Python with 3d cartoon

2014-01-26 Thread ngangsia akumbo
Is it possible to write cartoon with 3D images using python? If yes , please locate me some resources. thank -- https://mail.python.org/mailman/listinfo/python-list

Re: Python with 3d cartoon

2014-01-26 Thread Mark Lawrence
On 26/01/2014 10:46, ngangsia akumbo wrote: Is it possible to write cartoon with 3D images using python? If yes , please locate me some resources. thank What have you done to locate resources for yourself? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can

Re: Python with 3d cartoon

2014-01-26 Thread ngangsia akumbo
On Sunday, January 26, 2014 11:55:34 AM UTC+1, Mark Lawrence wrote: On 26/01/2014 10:46, ngangsia akumbo wrote: What have you done to locate resources for yourself? I have searched but not found something very clear. That is why i asked. --

Re: Python declarative

2014-01-26 Thread Steven D'Aprano
On Sun, 26 Jan 2014 15:06:15 +1100, Chris Angelico wrote: Code isn't something to be afraid of. Not according to the Laundry series by Charles Stross. The protagonist of the series was recruited to the Laundry after the computer program he was working on almost summoned Nyarlathotep the

Re: Python declarative

2014-01-26 Thread Steven D'Aprano
On Sun, 26 Jan 2014 08:03:18 +0200, Frank Millman wrote: I do not expect anyone to read or edit the XML - it is just a storage format. I am sure it could be done in JSON or YAML as well. But that's not what you originally said. You stated: here is how I would write your simple 'About' box

Re: Python with 3d cartoon

2014-01-26 Thread Tim Chase
On 2014-01-26 02:46, ngangsia akumbo wrote: Is it possible to write cartoon with 3D images using python? If yes , please locate me some resources. thank Check out Blender which can be scripted using Python. -tkc -- https://mail.python.org/mailman/listinfo/python-list

Re: Can't get sqlite3.Row working: keyword lookup doesn't work

2014-01-26 Thread lgabiot
Le 26/01/14 09:05, Peter Otten a écrit : Please remember to cut and past the traceback next time. What is wrong? My crystal ball says that you have a from __future__ import unicode_literals statement at the beginning of the module. If I'm right try row[bfilename] Thanks a lot for your

Re: Python declarative

2014-01-26 Thread Rustom Mody
On Sunday, January 26, 2014 2:42:57 PM UTC+5:30, Frank Millman wrote: Rustom Mody wrote: Xml, originally a document format, is nowadays used as a data-format. This conduces to humongous messing, first for the xml-library writers, and thence to the users of those libraries because library

SiafOO?

2014-01-26 Thread Martin Schöön
Today I stumbled upon www.siafoo.net when looking for tutorials on reStructured Text today. It looks like it could be good place to hang out to pick up programming skills (I am not in the positions help others, yet), is it? /Martin -- https://mail.python.org/mailman/listinfo/python-list

re Questions

2014-01-26 Thread Blake Adams
Im pretty new to Python and understand most of the basics of Python re but am stumped by a unexpected matching dynamics. If I want to set up a match replicating the '\w' pattern I would assume that would be done with '[A-z0-9_]'. However, when I run the following: re.findall('[A-z0-9_]','^;z

Re: SiafOO?

2014-01-26 Thread Mark Lawrence
On 26/01/2014 16:35, Martin Schöön wrote: Today I stumbled upon www.siafoo.net when looking for tutorials on reStructured Text today. It looks like it could be good place to hang out to pick up programming skills (I am not in the positions help others, yet), is it? /Martin Have an

Re: re Questions

2014-01-26 Thread Larry Martell
On Sun, Jan 26, 2014 at 9:59 AM, Blake Adams blakesad...@gmail.com wrote: Im pretty new to Python and understand most of the basics of Python re but am stumped by a unexpected matching dynamics. If I want to set up a match replicating the '\w' pattern I would assume that would be done with

Re: re Questions

2014-01-26 Thread Chris Angelico
On Mon, Jan 27, 2014 at 3:59 AM, Blake Adams blakesad...@gmail.com wrote: If I want to set up a match replicating the '\w' pattern I would assume that would be done with '[A-z0-9_]'. However, when I run the following: re.findall('[A-z0-9_]','^;z %C\@0~_') it matches ['^', 'z', 'C', '\\',

Re: re Questions

2014-01-26 Thread Roy Smith
In article mailman.5996.1390756093.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: The set [A-z] is equivalent to [ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz] I'm inclined to suggest the regex compiler should issue a warning for this. I've never seen a

Re: re Questions

2014-01-26 Thread Blake Adams
On Sunday, January 26, 2014 12:06:59 PM UTC-5, larry@gmail.com wrote: On Sun, Jan 26, 2014 at 9:59 AM, Blake Adams blakesad...@gmail.com wrote: Im pretty new to Python and understand most of the basics of Python re but am stumped by a unexpected matching dynamics. If I want to

Re: re Questions

2014-01-26 Thread Blake Adams
On Sunday, January 26, 2014 12:08:01 PM UTC-5, Chris Angelico wrote: On Mon, Jan 27, 2014 at 3:59 AM, Blake Adams blakesad...@gmail.com wrote: If I want to set up a match replicating the '\w' pattern I would assume that would be done with '[A-z0-9_]'. However, when I run the following:

Re: re Questions

2014-01-26 Thread Chris Angelico
On Mon, Jan 27, 2014 at 4:15 AM, Roy Smith r...@panix.com wrote: In article mailman.5996.1390756093.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: The set [A-z] is equivalent to [ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz] I'm inclined to suggest the

Re: re Questions

2014-01-26 Thread Mark Lawrence
On 26/01/2014 17:15, Blake Adams wrote: On Sunday, January 26, 2014 12:08:01 PM UTC-5, Chris Angelico wrote: On Mon, Jan 27, 2014 at 3:59 AM, Blake Adams blakesad...@gmail.com wrote: If I want to set up a match replicating the '\w' pattern I would assume that would be done with '[A-z0-9_]'.

Re: re Questions

2014-01-26 Thread Mark Lawrence
On 26/01/2014 17:25, Chris Angelico wrote: On Mon, Jan 27, 2014 at 4:15 AM, Roy Smith r...@panix.com wrote: In article mailman.5996.1390756093.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: The set [A-z] is equivalent to

Lists inside dictionary and how to look for particular value

2014-01-26 Thread mick verdu
z={ 'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200'], 'PC3': ['03:03:03:03:03:03', '192.168.0.3', '200'], 'PC1': ['01:01:01:01:01:01', '192.168.0.1', '200'] } My solution: z=raw_input(Enter Host, Mac, ip and time) t=z.split() t[0]=z[1:] for key in dic: if t[2] in dic[key]:

Re: re Questions

2014-01-26 Thread Tim Chase
On 2014-01-26 12:15, Roy Smith wrote: The set [A-z] is equivalent to [ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz] I'm inclined to suggest the regex compiler should issue a warning for this. I've never seen a character range other than A-Z, a-z, or 0-9. Well, I

Re: Lists inside dictionary and how to look for particular value

2014-01-26 Thread Peter Otten
mick verdu wrote: z={ 'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200'], 'PC3': ['03:03:03:03:03:03', '192.168.0.3', '200'], 'PC1': ['01:01:01:01:01:01', '192.168.0.1', '200'] } My solution: z=raw_input(Enter Host, Mac, ip and time) t=z.split() t[0]=z[1:] for key in dic:

Re: Lists inside dictionary and how to look for particular value

2014-01-26 Thread Tim Chase
On 2014-01-26 10:47, mick verdu wrote: z={ 'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200'], 'PC3': ['03:03:03:03:03:03', '192.168.0.3', '200'], 'PC1': ['01:01:01:01:01:01', '192.168.0.1', '200'] } My solution: z=raw_input(Enter Host, Mac, ip and time) t=z.split() t[0]=z[1:]

Re: Lists inside dictionary and how to look for particular value

2014-01-26 Thread mick verdu
@Peter Otten: I have lists for keys. What I want is if host already exists it would overwrite otherwise add to database. And if host doesn't exist it will first add this host to database and then compare its IP with IPs of rest of hosts. If ip matches with any of the other hosts, it will

Re: Lists inside dictionary and how to look for particular value

2014-01-26 Thread mick verdu
I have programming course and trying to learn things. This is of no human use. I am just following exercises. Just have to do steps as asked. -- https://mail.python.org/mailman/listinfo/python-list

Re: Lists inside dictionary and how to look for particular value

2014-01-26 Thread Denis McMahon
On Sun, 26 Jan 2014 10:47:11 -0800, mick verdu wrote: z={ 'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200'], 'PC3': ['03:03:03:03:03:03', '192.168.0.3', '200'], 'PC1': ['01:01:01:01:01:01', '192.168.0.1', '200'] } My solution: z=raw_input(Enter Host, Mac, ip and time)

Re: Lists inside dictionary and how to look for particular value

2014-01-26 Thread mm0fmf
On 26/01/2014 20:28, mick verdu wrote: I have programming course and trying to learn things. This is of no human use. I am just following exercises. Just have to do steps as asked. A slightly OT observation... Mick, consider using more meaningful names than t,z etc. You know what they stand

Unwanted Spaces and Iterative Loop

2014-01-26 Thread matt . s . marotta
I have been working on a python script that separates mailing addresses into different components. Here is my code: inFile = directory outFile = directory inHandler = open(inFile, 'r') outHandler = open(outFile, 'w')

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread Mark Lawrence
On 26/01/2014 21:46, matt.s.maro...@gmail.com wrote: I have been working on a python script that separates mailing addresses into different components. Here is my code: inFile = directory outFile = directory inHandler = open(inFile, 'r') outHandler = open(outFile, 'w')

Help: python 3.3.3 (AMD64) scripts fail as non-admin user on Windows Server 2012 R2

2014-01-26 Thread Luis Marsano
I've installed python for all users with full permissions to all users (see picture). Python runs for all users. However, scripts only work when I run as Administrator. Running a script always results in an ImportError: cannot import name error. Here, for example, is the output of pip -h run as an

Re: Lists inside dictionary and how to look for particular value

2014-01-26 Thread Gregory Ewing
mick verdu wrote: What I want is if host already exists it would overwrite otherwise add to database. And if host doesn't exist it will first add this host to database and then compare its IP with IPs of rest of hosts. If ip matches with any of the other hosts, it will delete the host that it

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread MRAB
On 2014-01-26 21:46, matt.s.maro...@gmail.com wrote: I have been working on a python script that separates mailing addresses into different components. Here is my code: inFile = directory outFile = directory inHandler = open(inFile, 'r') outHandler = open(outFile, 'w') Shouldn't you be

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread Jason Friedman
outHandler.write(FarmID\tAddress\tStreetNum\tStreetName\tSufType\tDir\tCity\tProvince\tPostalCode) ... FarmID Address 1 1067 Niagara Stone Rd, Niagara-On-The-Lake, ON L0S 1J0 2 4260 Mountainview Rd, Lincoln, ON L0R 1B2 3 25 Hunter Rd, Grimsby, ON L3M 4A3 4 1091

Re: Help: python 3.3.3 (AMD64) scripts fail as non-admin user on Windows Server 2012 R2

2014-01-26 Thread Steven D'Aprano
On Sun, 26 Jan 2014 17:30:21 -0500, Luis Marsano wrote: I've installed python for all users with full permissions to all users (see picture). Python runs for all users. However, scripts only work when I run as Administrator. Running a script always results in an ImportError: cannot import

Re: Lists inside dictionary and how to look for particular value

2014-01-26 Thread mick verdu
ThanK you. It solved my problem. Can someone tell me how can i print particular value inside list of key. I know how to print J['PC2'][1] means will print IP. but I want the user to input some element and I will print element just before that element. e.g. if user inputs 192.168.0.2, program

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread matt . s . marotta
On Sunday, 26 January 2014 18:44:16 UTC-5, Jason Friedman wrote: outHandler.write(FarmID\tAddress\tStreetNum\tStreetName\tSufType\tDir\tCity\tProvince\tPostalCode) ...   FarmID  Address 1       1067 Niagara Stone Rd, Niagara-On-The-Lake, ON L0S 1J0 2       4260 Mountainview Rd,

Highlighting program variables instead of keywords?

2014-01-26 Thread Skip Montanaro
My son sent me a link to an essay about highlighting program data instead of keywords: https://medium.com/p/3a6db2743a1e/ I think this might have value, especially if to could bounce back and forth between both schemes. Is anyone aware of tools like this for Python? Bonus points for pointers to

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread Steven D'Aprano
On Sun, 26 Jan 2014 13:46:21 -0800, matt.s.marotta wrote: I have been working on a python script that separates mailing addresses into different components. Here is my code: inFile = directory outFile = directory inHandler = open(inFile, 'r') outHandler = open(outFile, 'w') Are you

Re: Highlighting program variables instead of keywords?

2014-01-26 Thread Terry Reedy
On 1/26/2014 7:31 PM, Skip Montanaro wrote: My son sent me a link to an essay about highlighting program data instead of keywords: https://medium.com/p/3a6db2743a1e/ What it is doing is color coding user-supplied identifiers, with different color for each one. I found that confusing to read.

Re: Highlighting program variables instead of keywords?

2014-01-26 Thread Chris Angelico
On Mon, Jan 27, 2014 at 11:46 AM, Terry Reedy tjre...@udel.edu wrote: The only use I can see for this is to track the usage of a particular name, but that would be better done by just highlighting one name at a time. In SciTE, I can put the cursor on a word and hit Ctrl-F3 to find other

Re: Highlighting program variables instead of keywords?

2014-01-26 Thread Chris Angelico
On Mon, Jan 27, 2014 at 11:51 AM, Chris Angelico ros...@gmail.com wrote: On Mon, Jan 27, 2014 at 11:46 AM, Terry Reedy tjre...@udel.edu wrote: The only use I can see for this is to track the usage of a particular name, but that would be better done by just highlighting one name at a time. In

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread matt . s . marotta
On Sunday, 26 January 2014 19:40:26 UTC-5, Steven D'Aprano wrote: On Sun, 26 Jan 2014 13:46:21 -0800, matt.s.marotta wrote: I have been working on a python script that separates mailing addresses into different components. Here is my code: inFile = directory

Re: Highlighting program variables instead of keywords?

2014-01-26 Thread Steven D'Aprano
On Sun, 26 Jan 2014 18:31:49 -0600, Skip Montanaro wrote: My son sent me a link to an essay about highlighting program data instead of keywords: https://medium.com/p/3a6db2743a1e/ I think this might have value, especially if to could bounce back and forth between both schemes. Hmmm, I'm

Re: Highlighting program variables instead of keywords?

2014-01-26 Thread Chris Angelico
On Mon, Jan 27, 2014 at 12:29 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Hmmm, I'm not convinced, but then I wasn't convinced by syntax highlighting either until I had used it for a while. (I still think it's a nice-to-have rather than a must-have.) It's definitely just a

Re: Highlighting program variables instead of keywords?

2014-01-26 Thread Skip Montanaro
What it is doing is color coding user-supplied identifiers, with different color for each one. I found that confusing to read. I think it would take some time to get used to, and I don't think it would be the only way I'd like to view my program. I think an interactive pylint (or pyflakes or

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread Chris Angelico
On Mon, Jan 27, 2014 at 12:15 PM, matt.s.maro...@gmail.com wrote: I`m not reading and writing to the same file, I just changed the actual paths to directory. For next time, say directory1 and directory2 to preserve the fact that they're different. Though if they're file names, I'd use file1

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread matt . s . marotta
On Sunday, 26 January 2014 20:56:01 UTC-5, Chris Angelico wrote: On Mon, Jan 27, 2014 at 12:15 PM, matt.s.maro...@gmail.com wrote: I`m not reading and writing to the same file, I just changed the actual paths to directory. For next time, say directory1 and directory2 to preserve

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread Jason Friedman
I`m not reading and writing to the same file, I just changed the actual paths to directory. This is for a school assignment, and we haven`t been taught any of the stuff you`re talking about. Although I appreciate your help, everything needs to stay as is and I just need to create the loop

Re: Highlighting program variables instead of keywords?

2014-01-26 Thread Ben Finney
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: Hmmm, I'm not convinced, but then I wasn't convinced by syntax highlighting either until I had used it for a while. (I still think it's a nice-to-have rather than a must-have.) I wouldn't rate syntax highlighting a must-have. But I

Re: Highlighting program variables instead of keywords?

2014-01-26 Thread Roy Smith
In article mailman.6011.1390783954.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: That said, though, I grew up without syntax highlighting of any sort, and didn't think it particularly important; but now that I have editors with all those sorts of features, I do find

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread matt . s . marotta
On Sunday, 26 January 2014 21:00:35 UTC-5, Jason Friedman wrote: I`m not reading and writing to the same file, I just changed the actual paths to directory. This is for a school assignment, and we haven`t been taught any of the stuff you`re talking about.  Although I appreciate your

buggy python interpretter or am I missing something here?

2014-01-26 Thread me
I'm writing a linux daemon in python 2.x to process batches of GPS/GIS data and I'm running into something that seems to break the expected program flow in a REALLY BAD WAY. Consider the attached template script and execute it with the -h option. It is falling through to the except: clause

Remove unwanted characters from column

2014-01-26 Thread matt . s . marotta
School assignment is to create a tab separated output with the original given addresses in one column and then the addresses split into other columns (ex, columns for city, postal code, street suffix). Here is my code: inHandler = open(inFile, 'r') outHandler = open(outFile, 'w')

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread Gary Herron
On 01/26/2014 07:42 PM, me wrote: I'm writing a linux daemon in python 2.x to process batches of GPS/GIS data and I'm running into something that seems to break the expected program flow in a REALLY BAD WAY. Consider the attached template script and execute it with the -h option. It is falling

Re:Remove unwanted characters from column

2014-01-26 Thread Dave Angel
matt.s.maro...@gmail.com Wrote in message: School assignment is to create a tab separated output with the original given addresses in one column and then the addresses split into other columns (ex, columns for city, postal code, street suffix). Here is my code: inHandler = open(inFile,

Re:buggy python interpretter or am I missing something here?

2014-01-26 Thread Dave Angel
me no...@all.net Wrote in message: I'm writing a linux daemon in python 2.x to process batches of GPS/GIS data and I'm running into something that seems to break the expected program flow in a REALLY BAD WAY. Consider the attached template script and execute it with the -h option. It

Re:buggy python interpretter or am I missing something here?

2014-01-26 Thread me
On Mon, 27 Jan 2014 00:36:20 -0500, Dave Angel wrote: sys.exit() raises an exception, and you're deliberately eating that exception. I can buy that sys.exit (may) be throwing an exception...My point of contention isn't that I may be throwing one, but why would a subsequent raise in the

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread me
On Sun, 26 Jan 2014 21:04:57 -0800, Gary Herron wrote: Never *ever* have a bare except like that. If it gets invoked, you have no idea why. A simple typo like ixd instead of idx or a(idx) instead of a[idx] would raise an exception but give you no idea why. Do try: ...

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread Terry Reedy
On 1/27/2014 12:04 AM, Gary Herron wrote: Do try: ... except Exception,e: print e at the absolute minimum. (Python 3 syntax would differ slightly, but the advice is the same.) The 'python 3' syntax except Exception as e: works in 2.7 and perhaps 2.6. So use it unless you

[RELEASED] Python 3.4.0b3

2014-01-26 Thread Larry Hastings
On behalf of the Python development team, I'm quite pleased to announce the third beta release of Python 3.4. This is a preview release, and its use is not recommended for production settings. Python 3.4 includes a range of improvements of the 3.x series, including hundreds of small

Re: Highlighting program variables instead of keywords?

2014-01-26 Thread Terry Reedy
On 1/26/2014 8:29 PM, Steven D'Aprano wrote: On Sun, 26 Jan 2014 18:31:49 -0600, Skip Montanaro wrote: My son sent me a link to an essay about highlighting program data instead of keywords: https://medium.com/p/3a6db2743a1e/ I think this might have value, especially if to could bounce back

Re: Highlighting program variables instead of keywords?

2014-01-26 Thread Terry Reedy
On 1/26/2014 8:46 PM, Skip Montanaro wrote: I think an interactive pylint (or pyflakes or frosty) type capability would be useful, highlighting a subset of the messages it produces, like variables which were assigned but never used, or using undefined variables. It might be best supported by

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread me
On Mon, 27 Jan 2014 01:21:41 -0500, Terry Reedy wrote: On 1/27/2014 12:04 AM, Gary Herron wrote: Do try: ... except Exception,e: print e at the absolute minimum. (Python 3 syntax would differ slightly, but the advice is the same.) The 'python 3' syntax except

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread Zachary Ware
On Mon, Jan 27, 2014 at 12:02 AM, me no...@all.net wrote: On Mon, 27 Jan 2014 00:36:20 -0500, Dave Angel wrote: sys.exit() raises an exception, and you're deliberately eating that exception. I can buy that sys.exit (may) be throwing an exception...My point of contention isn't that I may

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread me
In any case, thanks for the answers guys. I'm satisfied that the except: syntax yields undefined behavior, and in my mind it shouldn't be syntactically allowed then. Updating to Exception,e or Exception as e fixes the problem. -- https://mail.python.org/mailman/listinfo/python-list

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread Zachary Ware
On Mon, Jan 27, 2014 at 12:46 AM, me no...@all.net wrote: In any case, thanks for the answers guys. I'm satisfied that the except: syntax yields undefined behavior, and in my mind it shouldn't be syntactically allowed then. It's not undefined, though; it is explicitly defined. See my other

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread Gary Herron
On 01/26/2014 10:17 PM, me wrote: On Sun, 26 Jan 2014 21:04:57 -0800, Gary Herron wrote: Never *ever* have a bare except like that. If it gets invoked, you have no idea why. A simple typo like ixd instead of idx or a(idx) instead of a[idx] would raise an exception but give you no idea why.

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread Gary Herron
On 01/26/2014 10:46 PM, me wrote: In any case, thanks for the answers guys. I'm satisfied that the except: syntax yields undefined behavior, and in my mind it shouldn't be syntactically allowed then. Updating to Exception,e or Exception as e fixes the problem. That's an irksome habit you

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread me
On Mon, 27 Jan 2014 00:47:13 -0600, Zachary Ware wrote: You've missed the point here. sys.exit() *does* raise an exception: SystemExit, a subclass of BaseException. In fact, you can implement sys.exit in pure Python like so: def exit(status): raise SystemExit(status) Your bare

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread me
On Sun, 26 Jan 2014 23:03:51 -0800, Gary Herron wrote: found the part I was missing based on another response. Didn't realize that sys.exit() triggered an instance of BaseException and that explains the weird behavior. thx! -- https://mail.python.org/mailman/listinfo/python-list

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread Ethan Furman
On 01/26/2014 10:42 PM, me wrote: My point of contention isn't so much about what specific syntax I should be using as much as it is about being allowed to use a syntax that gives erroneous results without triggering a syntax violation. If the bare except: clause is syntactically legal then it

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread me
On Sun, 26 Jan 2014 23:12:18 -0800, Gary Herron wrote: On 01/26/2014 10:46 PM, me wrote: In any case, thanks for the answers guys. I'm satisfied that the except: syntax yields undefined behavior, and in my mind it shouldn't be syntactically allowed then. Updating to Exception,e or

[RELEASED] Python 3.3.4 release candidate 1

2014-01-26 Thread Georg Brandl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On behalf of the Python development team, I'm reasonably happy to announce the Python 3.3.4 release candidate 1. Python 3.3.4 includes several security fixes and over 120 bug fixes compared to the Python 3.3.3 release. This release fully supports OS

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread Ethan Furman
On 01/26/2014 10:46 PM, me wrote: [...] I'm satisfied that the except: syntax yields undefined behavior, and in my mind it shouldn't be syntactically allowed then. Two points: 1) Python is not C++ 2) You asked for help; you received it. Coming back with an attitude of Python

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread me
On Sun, 26 Jan 2014 23:17:29 -0800, Ethan Furman wrote: On 01/26/2014 10:46 PM, me wrote: [...] I'm satisfied that the except: syntax yields undefined behavior, and in my mind it shouldn't be syntactically allowed then. Two points: 1) Python is not C++ 2) You asked for help;

[issue20193] Derby: Convert the zlib, _bz2 and _lzma modules to use Argument Clinic

2014-01-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file33709/zlib_clinic_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20193 ___

[issue20193] Derby: Convert the zlib, _bz2 and _lzma modules to use Argument Clinic

2014-01-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Synchronized with recent Argument Clinic changes. -- Added file: http://bugs.python.org/file33719/zlib_clinic_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20193

[issue20338] Idle: increase max calltip width

2014-01-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: I removed the incorrect * comment. Attached is a 2.7 port of the 3.3 patch. It turns out that textwrap.TextWrap in 2.7 is an old-style class. Such did not work previously because they do not have .__call__ and failed the hasattr() check, now a try:except

[issue20283] Wrong keyword parameter name in regex pattern methods

2014-01-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The patch did not upload correctly. Oh, sorry. Here is correct patch. I propose to apply soft patch (which preserves support for old keyword parameter name) to 2.7 and 3.3, and apply hard patch (which just renames keyword parameter name) to 3.4. Or we

[issue20394] Coverity complains on audioop

2014-01-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: Coverity appears concerned about the division by q. It apparently knows inrate != 0. I do not see any division by len. If q is cleared up, I presume it will check bytes_per_frame. -- nosy: +terry.reedy ___ Python

[issue20283] Wrong keyword parameter name in regex pattern methods

2014-01-26 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: Removed file: http://bugs.python.org/file33705/sre_deprecate_pattern_keyword.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20283 ___

[issue20283] Wrong keyword parameter name in regex pattern methods

2014-01-26 Thread Georg Brandl
Georg Brandl added the comment: For 3.3 I prefer the soft patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20283 ___ ___ Python-bugs-list

[issue20338] Idle: increase max calltip width

2014-01-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. But I prefer larger indent. Perhaps we need explicit tests for constructors of old- and new-style classes, with __new__, with __init__, and without __new__ and __init__. -- ___ Python tracker

[issue8260] When I use codecs.open(...) and f.readline() follow up by f.read() return bad result

2014-01-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8260 ___ ___

[issue20395] Extract generated clinic code in Modules/_pickle.c to separate file

2014-01-26 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Argument Clinic had added about half-thousand lines of code to Modules/_pickle.c. This generated code is mixed with handwritten code. Last 8 changes of Modules/_pickle.c are caused by Argument Clinic evolution, and I afraid that many future Argument

[issue20193] Derby: Convert the zlib, _bz2 and _lzma modules to use Argument Clinic

2014-01-26 Thread Nadeem Vawda
Nadeem Vawda added the comment: The latest patch for zlib seems to be missing Modules/zlibmodule.clinic.c I suppose that zdict=b'' have same effect as not specifying zdict. Am I right? Probably, but to be on the safe side I'd prefer that we preserve the behavior of not calling

[issue20395] Extract generated clinic code in Modules/_pickle.c to separate file

2014-01-26 Thread Larry Hastings
Larry Hastings added the comment: Alexandre: We're still figuring out best practices with Argument Clinic. So, right now, there's no standard policy of where should we put all the generated code?, and we're leaving it up to the owners of the individual modules. Putting it in a second file

[issue20193] Derby: Convert the zlib, _bz2 and _lzma modules to use Argument Clinic

2014-01-26 Thread Larry Hastings
Larry Hastings added the comment: We're not allowing changes in semantics for Argument Clinic conversion for 3.4. If it doesn't currently accept None, we can't add it right now, and we'll have to save it for 3.5. -- ___ Python tracker

[issue15759] make suspicious doesn't display instructions in case of failure

2014-01-26 Thread Larry Hastings
Larry Hastings added the comment: I nominate this text: ** To make these errors go away, merge the contents of build/suspicious/suspicious.csv to tools/sphinxext/susp-ignored.csv.

[issue20193] Derby: Convert the zlib, _bz2 and _lzma modules to use Argument Clinic

2014-01-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ah, sorry, here is full patch. Generated file is now named Modules/clinic/zlibmodule.c.h. The behavior is preserved. This case is exact analogue of _sha1.sha1(). No one additional function called when the parameter is not specified, but if it is specified

[issue20193] Derby: Convert the zlib, _bz2 and _lzma modules to use Argument Clinic

2014-01-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file33719/zlib_clinic_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20193 ___

[issue15759] make suspicious doesn't display instructions in case of failure

2014-01-26 Thread Larry Hastings
Larry Hastings added the comment: Since Ezio asked me, I guess I wasn't clear: This message should be displayed at the bottom, after the errors, and only when there are alleged suspicious documentation activities. -- ___ Python tracker

[issue20319] concurrent.futures.wait() can block forever even if Futures have completed

2014-01-26 Thread Glenn Langford
Glenn Langford added the comment: @Brian - Ah, I see now what you are referring to. The patch has changes to _create_and_install_waiters() which should not be there. The only code that needs to change is waiter removal as I originally suggested. I am set up with a dev environment now and will

[issue20326] Argument Clinic should use a non-error-prone syntax to mark text signatures

2014-01-26 Thread Larry Hastings
Larry Hastings added the comment: Here's a first cut at a patch. All signatures now start with sig=(. I also added a special marker: if the first parameter starts with $, we know for certain it's a self (or module or type) parameter. This means we can lose the heuristics for do we have a

[issue20283] Wrong keyword parameter name in regex pattern methods

2014-01-26 Thread Larry Hastings
Larry Hastings added the comment: Georg: you're accepting this patch into 3.3? I'm surprised. I would only want the soft approach. But I haven't said yes yet. I want to discuss it a little more. (Hey, it's python core dev. Discussing things endlessly is our job.) --

[issue20283] Wrong keyword parameter name in regex pattern methods

2014-01-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If you want the soft approach, then you should revert your changes to _sre.SRE_Pattern.match. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20283 ___

[issue20283] Wrong keyword parameter name in regex pattern methods

2014-01-26 Thread Larry Hastings
Larry Hastings added the comment: You can do it, if I accept the patch for 3.4. There's no point in doing it in two stages. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20283 ___

  1   2   3   >