NorthwestPythonDay, 31 Jan 2009

2009-01-10 Thread James Thiele
Posted for Brian Dorsey Hello everyone, On behalf of the Seattle Python Interest Group, I'd like to invite you to join us for an informal day of Python talks socializing. When: January, 31st 9am - 5pm Where: University of Washington campus, Seattle, Washington Price: Free! Details and updated

Re: Force exception on attribute write access only one object

2009-01-10 Thread Peter Otten
Thomas Guettler wrote: Peter Otten schrieb: Thomas Guettler wrote: for debugging I want to raise an exception if an attribute is changed on an object. Since it is only for debugging I don't want to change the integer attribute to a property. class A(object): def __init__(self):

Re: Detecting open files and forcing closure

2009-01-10 Thread Steven D'Aprano
On Fri, 09 Jan 2009 22:06:03 -0500, Andrew Robert wrote: Is there a way to detect the open files and close them out? You can detect open files by trying to move them and catching the exception when you can't. You may wish to distinguish permission errors. As far as forcing the file to close,

Re: why cannot assign to function call

2009-01-10 Thread Steven D'Aprano
On Fri, 09 Jan 2009 20:23:11 +, Mark Wooding wrote: Steven D'Aprano st...@remove-this-cybersource.com.au wrote: I'm pretty sure that no other pure-Python coder has manipulated references either. They've manipulated objects. No: not directly. The Python program deals solely with

Re: why cannot assign to function call

2009-01-10 Thread Aaron Brady
On Jan 9, 9:30 am, Joe Strout j...@strout.net wrote: Aaron Brady wrote: Possible compromise.  You can think of functions as mutation-only. You pass the object, and it gets a new (additional) name.  The old name doesn't go in.  /compromise That's correct.  The reference itself is passed

if-else statement

2009-01-10 Thread Gandalf
other languages like PHP or javascript as this if-else operator like this myVar = checking == 1? 'string': 'other string' is this stuff exist in python? thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: if-else statement

2009-01-10 Thread Duncan Booth
Gandalf goldn...@gmail.com wrote: other languages like PHP or javascript as this if-else operator like this myVar = checking == 1? 'string': 'other string' is this stuff exist in python? See http://docs.python.org/reference/expressions.html#boolean-operations conditional_expression

Re: Mocking `from foo import *` functions

2009-01-10 Thread Rob Williscroft
wrote in news:a9ed10ff-d907-46f0-8c6a- c3d95579a...@k1g2000prb.googlegroups.com in comp.lang.python: To answer to Rob: yeah, sure that would work, but I always thought Just to note: you're answering a question about testing, but I answered how to alter the alerter module *for* testing. given

are there some special about '\x1a' symbol

2009-01-10 Thread sim.sim
Hi all! I had touch with some different python behavior: I was tried to write into a file a string with the '\x1a' symbol, and for FreeBSD system, it gives expected result: open(test, w).write('before\x1aafter') open('test').read() 'before\x1aafter' but for my WinXP box, it gives some

Re: Mocking `from foo import *` functions

2009-01-10 Thread hsoft
On Jan 10, 4:19 pm, Rob Williscroft r...@freenet.co.uk wrote: Note that doing the above *before* any other module imports from sender, will be sufficient in *any* case, though it won't help if the tested code calls reload( sender ). Yeah, of course, but most of the time, you want to mock at

NorthwestPythonDay, 31 Jan 2009

2009-01-10 Thread James Thiele
Posted for Brian Dorsey Hello everyone, On behalf of the Seattle Python Interest Group, I'd like to invite you to join us for an informal day of Python talks socializing. When: January, 31st 9am - 5pm Where: University of Washington campus, Seattle, Washington Price: Free! Details and updated

Re: why cannot assign to function call

2009-01-10 Thread Mark Wooding
[Another tome. I hope this contains sufficient new material to continue to be of interest to other readers.] Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Fri, 09 Jan 2009 20:23:11 +, Mark Wooding wrote: No: not directly. The Python program deals solely with references;

Re: why cannot assign to function call

2009-01-10 Thread Mark Wooding
ru...@yahoo.com ru...@yahoo.com wrote: Agreed. I think the docs, especially those that develop the conceptual model of how Python work at runtime, could use some major attention. If we can achieve consensus in this (still remarkably civil) discussion, we might be able to amend the docs. I

Re: why cannot assign to function call

2009-01-10 Thread Mel
Aaron Brady wrote: Lastly, I don't see any reason why we couldn't make both explanations available. 'For those coming from Java/etc; for those coming from C++/etc.' They would both get read. That's what I was just thinking .. there are lots of others, too: for those coming from

Re: are there some special about '\x1a' symbol

2009-01-10 Thread Marc 'BlackJack' Rintsch
On Sat, 10 Jan 2009 07:45:53 -0800, sim.sim wrote: I had touch with some different python behavior: I was tried to write into a file a string with the '\x1a' symbol, and for FreeBSD system, it gives expected result: open(test, w).write('before\x1aafter') open('test').read()

Re: are there some special about '\x1a' symbol

2009-01-10 Thread Mel
sim.sim wrote: Hi all! I had touch with some different python behavior: I was tried to write into a file a string with the '\x1a' symbol, and for FreeBSD system, it gives expected result: open(test, w).write('before\x1aafter') open('test').read() 'before\x1aafter' but for my WinXP

Re: State of the art: Tkinter, Tk 8.5, Tix?

2009-01-10 Thread r
We need TK 8.5's themes. This will bring Tkinter out of the dark ages and into the 21st Century! And improve the shine of the Python base distro. Python could use a good boost right now! -- http://mail.python.org/mailman/listinfo/python-list

Looking for an efficient Python script to download and save a .zip file programmatically

2009-01-10 Thread David Shi
I am looking for an efficient Python script to download and save a .zip file programmatically (from http or https call).   Regards.   David -- http://mail.python.org/mailman/listinfo/python-list

Re: Implementing file reading in C/Python

2009-01-10 Thread Francesco Bochicchio
On Fri, 09 Jan 2009 15:34:17 +, MRAB wrote: Marc 'BlackJack' Rintsch wrote: On Fri, 09 Jan 2009 04:04:41 +0100, Johannes Bauer wrote: As this was horribly slow (20 Minutes for a 2GB file) I coded the whole thing in C also: Yours took ~37 minutes for 2 GiB here. This just ~15

Re: Looking for an efficient Python script to download and save a .zip file programmatically

2009-01-10 Thread Albert Hopkins
On Sat, 2009-01-10 at 17:12 +, David Shi wrote: I am looking for an efficient Python script to download and save a .zip file programmatically (from http or https call). Regards. David urllib? -a -- http://mail.python.org/mailman/listinfo/python-list

Re: if-else statement

2009-01-10 Thread Philip Semanchuk
On Jan 10, 2009, at 9:26 AM, Duncan Booth wrote: Gandalf goldn...@gmail.com wrote: other languages like PHP or javascript as this if-else operator like this myVar = checking == 1? 'string': 'other string' is this stuff exist in python? See

Re: why cannot assign to function call

2009-01-10 Thread rurpy
On Jan 9, 6:47 am, Mark Wooding m...@distorted.org.uk wrote: ru...@yahoo.com ru...@yahoo.com wrote: As a side comment (because it always bugs me when I read this, even though I read it in very authoritative sources), ISTM that C passes everything by value except arrays; they are passed by

Re: distinction between unzipping bytes and unzipping a file

2009-01-10 Thread webcomm
On Jan 9, 6:07 pm, John Machin sjmac...@lexicon.net wrote: Yup, it looks like it's encoded in utf_16_le, i.e. no BOM as God^H^H^HGates intended: buff = open('data', 'rb').read() buff[:100] '\x00R\x00e\x00g\x00i\x00s\x00t\x00r\x00a\x00t\x00i\x00o\x00n\x00 \x00\x00B\x0

Re: BadZipfile file is not a zip file

2009-01-10 Thread webcomm
On Jan 9, 7:33 pm, John Machin sjmac...@lexicon.net wrote: It is not impossible for a file with dummy data to have been handcrafted or otherwise produced by a process different to that used for a real-data file. I knew it was produced by the same process, or I wouldn't have shared it. : ) But

Re: download timeout vs. socket timeout

2009-01-10 Thread Giampaolo Rodola'
On 10 Gen, 03:07, p. ppetr...@gmail.com wrote: i'm using urllib2 in python 2.4 wondering how people typically deal with the case in which a download is too slow. setting the socket timeout only covers those cases where there is no response in the socket for whatever the timeout period is.

Re: why cannot assign to function call

2009-01-10 Thread Mark Wooding
ru...@yahoo.com ru...@yahoo.com wrote: What is the observable difference between converting an array to a reference (pointer) to that array and passing the reference by value, and passing the array by reference? For one: #include stdio.h static size_t foo(char v[]) { return sizeof v; } int

Re: why cannot assign to function call

2009-01-10 Thread Joe Strout
ru...@yahoo.com wrote: What is the observable difference between converting an array to a reference (pointer) to that array and passing the reference by value, and passing the array by reference? The difference is whether an assignment to the formal parameter (within the function) affects

Re: why cannot assign to function call

2009-01-10 Thread Joe Strout
Aaron Brady wrote: Aaron Brady wrote: Possible compromise. You can think of functions as mutation-only. You pass the object, and it gets a new (additional) name. The old name doesn't go in. /compromise That's correct. The reference itself is passed in, not the variable (or expression)

Re: if-else statement

2009-01-10 Thread Scott David Daniels
Duncan Booth wrote: Gandalf goldn...@gmail.com wrote: other languages ... [have an] if-else operator like... myVar = checking == 1? 'string': 'other string' See http://docs.python.org/reference/expressions.html#boolean-operations ... The expression x if C else y first evaluates C (not

Re: download timeout vs. socket timeout

2009-01-10 Thread Giampaolo Rodola'
I'm sorry. I realized they had already replied when it was too late. --- Giampaolo http://code.google.com/p/pyftpdlib -- http://mail.python.org/mailman/listinfo/python-list

Re: if-else statement

2009-01-10 Thread bearophileHUGS
Scott David Daniels:       if checking:           my_var = 'string'       else:           my_var = 'other string' remember, vertical space only kills trees if printed. I value clarity a lot. But this is more DRY, sometimes it's almost equally clear, and you reduce vertical space, packing

Re: urlopen exception

2009-01-10 Thread Steve Holden
asit wrote: site=www.bput.org payloads=scriptalert('xss')/script attack= urllib2.urlopen(site+payloads,80).readlines() according to my best knowledge, the above code is correct. but why it throws exceptio what exception it throw? -- Steve Holden+1 571 484 6266 +1 800 494

Re: State of the art: Tkinter, Tk 8.5, Tix?

2009-01-10 Thread excord80
On Jan 10, 11:45 am, r rt8...@gmail.com wrote: We need TK 8.5's themes. This will bring Tkinter out of the dark ages and into the 21st Century! And improve the shine of the Python base distro. Python could use a good boost right now! Could someone please explain what Tix provides compared to

Re: distinction between unzipping bytes and unzipping a file

2009-01-10 Thread John Machin
On Jan 11, 6:15 am, webcomm rya...@gmail.com wrote: On Jan 9, 6:07 pm, John Machin sjmac...@lexicon.net wrote: Yup, it looks like it's encoded in utf_16_le, i.e. no BOM as God^H^H^HGates intended: buff = open('data', 'rb').read() buff[:100]

Python 2.6.1 @executable_path

2009-01-10 Thread googler . 1 . webmaster
Hi! I asked something similar a few days ago. Is it possible to compile Python 2.6.1 with a dynamic path? I don't know how the configure command would look like. This is my current configure command for the default /Library/ Frameworks/ path: ./configure --with-framework-name=Python

Python 2.6.1 @executable_path

2009-01-10 Thread googler . 1 . webmaster
Hi! I asked something similar a few days ago. Is it possible to compile Python 2.6.1 with a dynamic path on MacOSX? I don't know how the configure command would look like. This is my current configure command for the default /Library/ Frameworks/ path: ./configure --with-framework-name=Python

Python 2.6.1 @executable_path

2009-01-10 Thread googler . 1 . webmaster
Hi! I asked something similar a few days ago. Is it possible to compile Python 2.6.1 with a dynamic path on Mac OSX Leopard 10.5.x. I found out that I could use @executable_path but I don't know how the configure command would look like. This is my current configure command for the default

Re: are there some special about '\x1a' symbol

2009-01-10 Thread John Machin
On Jan 11, 2:45 am, sim.sim maksim.kasi...@gmail.com wrote: Hi all! I had touch with some different python behavior: I was tried to write into a file a string with the '\x1a' symbol, and for FreeBSD system, it gives expected result: open(test, w).write('before\x1aafter')

Re: Python 2.6.1 @executable_path

2009-01-10 Thread Martin v. Löwis
I asked something similar a few days ago. Is it possible to compile Python 2.6.1 with a dynamic path? What is a dynamic path? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6.1 @executable_path

2009-01-10 Thread googler . 1 . webmaster
I want to embedd it into another app so on the 'customers'-mac I want to put python into a subdirectory of my app. bye -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6.1 @executable_path

2009-01-10 Thread googler . 1 . webmaster
I want to embedd it into my app so on the 'customers'-mac I want to put python into a subdirectory of my app. and with the configure command above, that will not work because the library has to be on every system in /Library/Framework/ so I found out that @executable_path is replaced by the path

Re: Python 2.6.1 @executable_path

2009-01-10 Thread Ned Deily
In article e9238c96-932a-40d1-9950-f93bb4c06...@s1g2000prg.googlegroups.com, googler.1.webmas...@spamgourmet.com wrote: I want to embedd it into my app so on the 'customers'-mac I want to put python into a subdirectory of my app. and with the configure command above, that will not work

Re: Looking for an efficient Python script to download and save a .zip file programmatically

2009-01-10 Thread Chris Rebert
On Sat, Jan 10, 2009 at 9:12 AM, David Shi davidg...@yahoo.co.uk wrote: I am looking for an efficient Python script to download and save a .zip file programmatically (from http or https call). You want urllib.urlretrieve(): http://docs.python.org/library/urllib.html#urllib.urlretrieve Cheers,

Re: Python 2.6.1 @executable_path

2009-01-10 Thread googler . 1 . webmaster
Thanks for the link but I don't want to do a make a python script as an applicatin, I want to embedd python into a C++ app so thats the reason why I have to compile Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: State of the art: Tkinter, Tk 8.5, Tix?

2009-01-10 Thread r
On Jan 10, 3:05 pm, excord80 excor...@gmail.com wrote: On Jan 10, 11:45 am, r rt8...@gmail.com wrote: We need TK 8.5's themes. This will bring Tkinter out of the dark ages and into the 21st Century! And improve the shine of the Python base distro. Python could use a good boost right now!

Re: urlopen exception

2009-01-10 Thread Chris Rebert
On Sat, Jan 10, 2009 at 9:56 AM, asit lipu...@gmail.com wrote: site=www.bput.org payloads=scriptalert('xss')/script attack= urllib2.urlopen(site+payloads,80).readlines() according to my best knowledge, the above code is correct. but why it throws exceptio Because it's not correct. It's

Re: State of the art: Tkinter, Tk 8.5, Tix?

2009-01-10 Thread Kevin Walzer
excord80 wrote: Could someone please explain what Tix provides compared to what the new stuff in Tk 8.5 provides? Is there much overlap? Tix is a compiled Tk extension that adds a good number of widgets to the base set, such as a notebook tab, treeview, combobox, and others; Python

Re: State of the art: Tkinter, Tk 8.5, Tix?

2009-01-10 Thread Kevin Walzer
excord80 wrote: On Jan 10, 11:45 am, r rt8...@gmail.com wrote: We need TK 8.5's themes. This will bring Tkinter out of the dark ages and into the 21st Century! And improve the shine of the Python base distro. Python could use a good boost right now! Could someone please explain what Tix

Re: type conversion

2009-01-10 Thread Lie
On Jan 3, 10:23 am, r rt8...@gmail.com wrote: On Jan 2, 7:46 pm, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: ...incessant rambling about a news reader , 101 excuses for butting into a thread [snip] ... public display of ignorance of newsgroup ethics, 101 excuses for not

Re: why cannot assign to function call

2009-01-10 Thread Steven D'Aprano
On Sat, 10 Jan 2009 12:52:47 -0700, Joe Strout wrote: What is the observable difference between converting an array to a reference (pointer) to that array and passing the reference by value, and passing the array by reference? The difference is whether an assignment to the formal parameter

Re: urlopen exception

2009-01-10 Thread Paul Rubin
asit lipu...@gmail.com writes: site=www.bput.org payloads=scriptalert('xss')/script attack= urllib2.urlopen(site+payloads,80).readlines() according to my best knowledge, the above code is correct. but why it throws exceptio The code is incorrect. Look at the string ou are sending

Re: Looking for an efficient Python script to download and save a .zip file programmatically

2009-01-10 Thread MrJean1
Here are some examples using urllib.urlretrieve(): http://code.activestate.com/recipes/576530/ http://mail.python.org/pipermail/tutor/2005-May/038797.html /Jean Brouwers On Jan 10, 2:23 pm, Chris Rebert c...@rebertia.com wrote: On Sat, Jan 10, 2009 at 9:12 AM, David Shi davidg...@yahoo.co.uk

Pickling classes (not class instances)

2009-01-10 Thread Nicolas M . Thiéry
Dear python developers, Purpose of this e-mail: --- How to customize how a class (not an instance of a class!!!) is pickled? Example: == class metaclass(type): def __new__(mcs, name,

Re: why cannot assign to function call

2009-01-10 Thread Rhodri James
On Sat, 10 Jan 2009 18:44:37 -, ru...@yahoo.com wrote: What is the observable difference between converting an array to a reference (pointer) to that array and passing the reference by value, and passing the array by reference? This is a red herring, though. From either viewpoint, C

Regex for unicode letter characters

2009-01-10 Thread schickb
I need a regex that will match strings containing only unicode letter characters (not including numeric or the _ character). I was surprised to find the 're' module does not include a special character class for this already (python 2.6). Or did I miss something? It seems like this would be a

import relative (with a directory)

2009-01-10 Thread rocky
Import relative? Recently for fun I've been working on a large Python program. It has many files/modules spread over several directories/submodules. Each module has some demo code at the end that I can use to run or experiment with that module. Of course, modules often refer to others; depending

Re: import relative (with a directory)

2009-01-10 Thread Chris Rebert
On Sat, Jan 10, 2009 at 6:11 PM, rocky rocky.bernst...@gmail.com wrote: Import relative? Recently for fun I've been working on a large Python program. It has many files/modules spread over several directories/submodules. Each module has some demo code at the end that I can use to run or

Re: Regex for unicode letter characters

2009-01-10 Thread MRAB
schickb wrote: I need a regex that will match strings containing only unicode letter characters (not including numeric or the _ character). I was surprised to find the 're' module does not include a special character class for this already (python 2.6). Or did I miss something? It seems like

Re: Python 2.6.1 @executable_path

2009-01-10 Thread googler . 1 . webmaster
hmm.. very strange. Is it so complicated to compile python that I can move the framework to the app folder? hmm. thats really strange :-( /myapp.app /subfolder/Python.framework any suggestions? Thank you very muc. -- http://mail.python.org/mailman/listinfo/python-list

Re: why cannot assign to function call

2009-01-10 Thread Mark Wooding
Steven D'Aprano st...@remove-this-cybersource.com.au wrote: There are actually three fundamental characteristics of pass-by-reference: * passing a value by reference does not lead to the value being copied, in contrast with pass-by-value where it does; * modifications to the value passed

Re: why cannot assign to function call

2009-01-10 Thread Steven D'Aprano
On Sun, 11 Jan 2009 01:22:48 +, Rhodri James wrote: On Sat, 10 Jan 2009 18:44:37 -, ru...@yahoo.com wrote: What is the observable difference between converting an array to a reference (pointer) to that array and passing the reference by value, and passing the array by reference?

Re: urlopen exception

2009-01-10 Thread Steve Holden
Paul Rubin wrote: asit lipu...@gmail.com writes: site=www.bput.org payloads=scriptalert('xss')/script attack= urllib2.urlopen(site+payloads,80).readlines() according to my best knowledge, the above code is correct. but why it throws exceptio The code is incorrect. Look at the

Re: Regex for unicode letter characters

2009-01-10 Thread Steve Holden
MRAB wrote: schickb wrote: I need a regex that will match strings containing only unicode letter characters (not including numeric or the _ character). I was surprised to find the 're' module does not include a special character class for this already (python 2.6). Or did I miss something?

Re: why cannot assign to function call

2009-01-10 Thread Mark Wooding
Steven D'Aprano st...@remove-this-cybersource.com.au wrote: I don't believe it is a red-herring. As I understand it, Mark and Joe insist that C is pass-by-value *even in the case of arrays*, despite the semantics of array passing being identical to the semantics of pass-by- reference in

Re: State of the art: Tkinter, Tk 8.5, Tix?

2009-01-10 Thread Дамјан Георгиевски
The themed Tk widgets (ttk) that come with Tk 8.5 add a lot of the same things that Tix does, but they do so in a more modern way, hooking into platform-specific themes and API's wherever possible (XP, Vista, Mac) and updating the generic X11 look as well. As such, they are more appropriate

Re: Regex for unicode letter characters

2009-01-10 Thread MRAB
Steve Holden wrote: MRAB wrote: schickb wrote: I need a regex that will match strings containing only unicode letter characters (not including numeric or the _ character). I was surprised to find the 're' module does not include a special character class for this already (python 2.6). Or did I

Re: why cannot assign to function call

2009-01-10 Thread rurpy
Mark Wooding wrote: ru...@yahoo.com ru...@yahoo.com wrote: What is the observable difference between converting an array to a reference (pointer) to that array and passing the reference by value, and passing the array by reference? For one: #include stdio.h static size_t foo(char v[]) {

Re: python -3 not working as expected

2009-01-10 Thread Benjamin
On Jan 9, 10:19 pm, John Machin sjmac...@lexicon.net wrote: On Jan 10, 2:55 pm, Benjamin benja...@python.org wrote: We'll need good documentation. Unfortunately, as you note below, this isn't exactly the case yet. So is there a plot to remedy this? Where do we sign up? Feel free to

Python strings and coding conventions

2009-01-10 Thread koranthala
Hi, Python Coding Convention (PEP 8) suggests : Maximum Line Length Limit all lines to a maximum of 79 characters. I have a string which is ~110 char long. It is a string which I am going to print in a text file as a single string. i.e. in that text file, each line is taken as a

Re: Python strings and coding conventions

2009-01-10 Thread Robert Kern
koranth...@gmail.com wrote: Hi, Python Coding Convention (PEP 8) suggests : Maximum Line Length Limit all lines to a maximum of 79 characters. I have a string which is ~110 char long. It is a string which I am going to print in a text file as a single string. i.e. in that text

Re: Python strings and coding conventions

2009-01-10 Thread Mensanator
On Jan 10, 10:26�pm, Robert Kern robert.k...@gmail.com wrote: koranth...@gmail.com wrote: Hi, � �Python Coding Convention (PEP 8) suggests : � Maximum Line Length � � Limit all lines to a maximum of 79 characters. � I have a string which is ~110 char long. It is a string which I am

Re: import relative (with a directory)

2009-01-10 Thread Kay Schluehr
On 11 Jan., 03:27, Chris Rebert c...@rebertia.com wrote: You should probably check out the relative import syntax introduced in PEP 328:http://www.python.org/dev/peps/pep-0328/ It should be able to do exactly what you want. This should exactly lead to exceptions in all of his demo code

Re: Python 2.6.1 @executable_path

2009-01-10 Thread Michael Torrie
googler.1.webmas...@spamgourmet.com wrote: Thanks for the link but I don't want to do a make a python script as an applicatin, I want to embedd python into a C++ app so thats the reason why I have to compile Python. If you are embedding python, then all you have to do is stick the python

Re: urlopen exception

2009-01-10 Thread alex goretoy
I would try: site=http://www.bput.org/; payloads=scriptalert('xss')/script attack= urllib2.urlopen(site+payloads,80).readlines() -Alex Goretoy http://www.alexgoretoy.com somebodywhoca...@gmail.com On Sun, Jan 11, 2009 at 2:49 AM, Steve Holden st...@holdenweb.com wrote: Paul Rubin wrote:

Re: urlopen exception

2009-01-10 Thread alex goretoy
oops, remove the ,80 since port is not needed. Well, in my case it wasn't working with port. notice it gives me 404, but this with my domain att=urllib2.urlopen(site+payload,80).readlines() Traceback (most recent call last): File stdin, line 1, in module File

parsing javascript generated files...

2009-01-10 Thread bruce
Hi. Looking to parse some web pages that have javascript (jquery) embedded/used in the pages. I'm trying to get a better understanding of exactly how the page is generated, and displayed in the browser. I've seen various references to python-spidermonkey, as well as watir/firewatir. Is there a

Re: Python strings and coding conventions

2009-01-10 Thread koranthala
On Jan 11, 9:26 am, Robert Kern robert.k...@gmail.com wrote: koranth...@gmail.com wrote: Hi,    Python Coding Convention (PEP 8) suggests :   Maximum Line Length     Limit all lines to a maximum of 79 characters.   I have a string which is ~110 char long. It is a string which I am

[issue4753] Faster opcode dispatch on gcc

2009-01-10 Thread Paolo 'Blaisorblade' Giarrusso
Paolo 'Blaisorblade' Giarrusso p.giarru...@gmail.com added the comment: The standing question is still: can we get ICC to produce the expected output? It looks like we still didn't manage, and since ICC is the best compiler out there, this matters. Some problems with SunCC, even if it doesn't

[issue4893] Use separate thread support code under MS Windows CE

2009-01-10 Thread Ulrich Eckhardt
Ulrich Eckhardt eckha...@satorlaser.com added the comment: The thread code is unaffected by the Unicode/ANSI issues, but CE doesn't have _beginthread[ex], which are mandatory for the desktop variants. I have checkin 68455 and I will try to compile the new NT code under CE to estimate how

[issue4903] binascii.crc32()

2009-01-10 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: What is this that you want to get documented? Can you propose a specific wording? -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4903

[issue4905] Use INVALID_FILE_ATTRIBUTES instead of magic numbers

2009-01-10 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt eckha...@satorlaser.com: GetFileAttributes[W|A] returns a DWORD with this value when it couldn't determine the file's attributes. In the Python codebase, there are basically three values this is compared with, the above macro, 0x and (DWORD)-1, it

[issue4753] Faster opcode dispatch on gcc

2009-01-10 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: @pitrou: The machine I got the 15% speedup on is in 64-bit mode with gcc 4.3.2. Which is the processor? I guess the bigger speedups should be on Pentium4, since it has the bigger mispredict penalties. Athlon X2 3600+.

[issue4753] Faster opcode dispatch on gcc

2009-01-10 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: It looks like we still didn't manage, and since ICC is the best compiler out there, this matters. Well, from the perspective of Python, what matters mostly is the commonly used compilers (that is, gcc and MSVC). I doubt many people compile

[issue4753] Faster opcode dispatch on gcc

2009-01-10 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: On 2009-01-10 10:55, Antoine Pitrou wrote: Antoine Pitrou pit...@free.fr added the comment: It looks like we still didn't manage, and since ICC is the best compiler out there, this matters. Well, from the perspective of Python, what

[issue4906] os.listdir fails on debug build (windows)

2009-01-10 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I see, so it was I that caused this :) I will owe up to it and submit a fix. -- nosy: +krisvale ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4906

[issue4753] Faster opcode dispatch on gcc

2009-01-10 Thread Paolo 'Blaisorblade' Giarrusso
Paolo 'Blaisorblade' Giarrusso p.giarru...@gmail.com added the comment: Same for CPU-specific tuning: I don't think we want to ship Python with compiler flags which depend on the particular CPU being used. I wasn't suggesting this - but since different CPUs have different optimization rules,

[issue4903] binascii.crc32()

2009-01-10 Thread David M. Beazley
David M. Beazley beaz...@users.sourceforge.net added the comment: Placing a note in the standard library documentation would be a start. Just say in Python 3.0 it always returns the result as an unsigned integer whereas in Python 2.6 a 32-bit signed integer is returned. Although the

[issue4906] os.listdir fails on debug build (windows)

2009-01-10 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Checked in: Completed: At revision: 68476 -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4906

[issue4905] Use INVALID_FILE_ATTRIBUTES instead of magic numbers

2009-01-10 Thread Ulrich Eckhardt
Ulrich Eckhardt eckha...@satorlaser.com added the comment: The patch replaces remaining magic numbers with INVALID_FILE_ATTRIBUTES. -- keywords: +patch Added file: http://bugs.python.org/file12673/python-2.7-fileattrib-magic.0.patch ___ Python

[issue4753] Faster opcode dispatch on gcc

2009-01-10 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: (First culprit might be license/compatibility problems I guess, but the speedup would be worth the time to fix the troubles IMHO). That would be the obvious reason IMO. And Intel is the only one who can fix the troubles.

[issue4884] Work around gethostbyaddr_r bug

2009-01-10 Thread Roumen Petrov
Roumen Petrov bugtr...@roumenpetrov.info added the comment: What about socket_gethostbyname_ex() ? -- nosy: +rpetrov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4884 ___

[issue1767370] Make xmlrpc use HTTP/1.1 and keepalive

2009-01-10 Thread williambr
williambr willia...@gmail.com added the comment: Hi. I am very intereasted about this patch... specially about the keep-alive part... I have a proposition... wouldn't be fair enough to have a separated Transport just for keep-alive connections? I could wirte one if no one is against it...

[issue4907] ast.literal_eval does not properly handled complex numbers

2009-01-10 Thread Armin Ronacher
New submission from Armin Ronacher armin.ronac...@active-4.com: ast.literal_eval does not properly handle complex numbers: ast.literal_eval(1j) 1j ast.literal_eval(2+1j) Traceback (most recent call last): ... ValueError: malformed string ast.literal_eval((2+1j)) Traceback (most recent call

[issue4868] Faster utf-8 decoding

2009-01-10 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I committed the patch with the last suggested change (word - data) in py3k (r68483). I don't intend to backport it to trunk, but I suppose it wouldn't be too much work to do. -- resolution: - fixed status: open - closed

[issue4907] ast.literal_eval does not properly handled complex numbers

2009-01-10 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: fixed patch :) Added file: http://bugs.python.org/file12675/literal-eval.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4907 ___

[issue3860] GzipFile and BZ2File should support context manager protocol

2009-01-10 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Committed in trunk and py3k. Thanks! -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3860 ___

[issue4879] Allow buffering for HTTPResponse

2009-01-10 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Why not name the parameter buffering=False rather than nobuffer=True? Sounds more natural to me. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4879

[issue4472] Is shared lib building broken on trunk for Mac OS X?

2009-01-10 Thread Skip Montanaro
Skip Montanaro s...@pobox.com added the comment: Works for me. Thanks Ronald. Closing... -- assignee: - ronaldoussoren status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4472

[issue4907] ast.literal_eval does not properly handled complex numbers

2009-01-10 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Looks good to me assuming you add a test. -- keywords: -needs review nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4907

[issue4904] Typo for PickingError in pickle.py

2009-01-10 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Thanks for the report! Fixed in r68488. -- nosy: +benjamin.peterson resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4904

  1   2   >