Re: re.NONE

2009-06-22 Thread MRAB
1x7y2z9 wrote: I am currently using python v2.5.2. Not sure if this is defined in a later version, but it would be nice to define re.NONE = 0 in the re module. This would be useful in cases such as: flags = re.DOTALL if dotall else re.NONE Also useful for building up flags by ORing with other

re.NONE

2009-06-22 Thread Xavier Ho
(arg, MRAB, sorry, wrong address!) Defining None to 0 is a bad idea. You'll have trouble debugging later on. Ching-Yun Xavier Ho, Technical Artist Contact Information Mobile: (+61) 04 3335 4748 Skype ID: SpaXe85 Email: cont...@xavierho.com Website: http://xavierho.com/ On Tue, Jun 23, 2009 at

Re: re.NONE

2009-06-22 Thread Rhodri James
Re-ordered to eliminate the top-posting. On Tue, 23 Jun 2009 00:47:49 +0100, Xavier Ho cont...@xavierho.com wrote: On Tue, Jun 23, 2009 at 9:43 AM, MRAB pyt...@mrabarnett.plus.com wrote: 1x7y2z9 wrote: I am currently using python v2.5.2. Not sure if this is defined in a later version,

Re: re.NONE

2009-06-22 Thread Xavier Ho
Rhodri wrote: They aren't talking about None, they're talking about a hypothetical re.NONE to use as a flag to re.match() and the like. There's no issue with defining that to be 0, since it is the correct value! Ah, I see. That makes more sense. Thanks. :] (... I fail at sending to mailing

Re: launch a .py file from a batch file

2009-06-22 Thread Dave Angel
CM wrote: I'd like to launch a number of programs, one of which is a Python GUI app, from a batch file launcher. I'd like to click the .bat file and have it open all the stuff and then not show the DOS console. I can launch an Excel and Word file fine using, e.g.: Start path/mydocument.doc

Re: re.NONE

2009-06-22 Thread Lawrence D'Oliveiro
In message e9213fb3- c77d-4a47-8cb4-7dd916d69...@s1g2000prd.googlegroups.com, 1x7y2z9 wrote: Not sure if this is defined in a later version, but it would be nice to define re.NONE = 0 in the re module. Do so: re.NONE = 0 Problem solved. --

Re: Re: How to output a complex List object to a file.

2009-06-22 Thread bluefisher80
Let me get my question more clear, I want like the structure object printed into another python source file, which i will use in other program. The pickled format or even JSONed format does not fullfil my requirement, does it? Do i make it clear, I still need your guides. Jim Detail

Re: Re: How to output a complex List object to a file.

2009-06-22 Thread bluefisher80
Actually I think i am just looking for print myFile.py, myListObj 2009-06-23 bluefisher80 发件人: J. Cliff Dyer 发送时间: 2009-06-22 22:17:12 收件人: Jim Qiu 抄送: python-list 主题: Re: How to output a complex List object to a file. Have you looked at the JSON module? On Mon, 2009-06-22 at

Re: Re: How to output a complex List object to a file.

2009-06-22 Thread Chris Rebert
2009/6/22 bluefisher80 bluefishe...@gmail.com: Actually I think i am just looking for print myFile.py, myListObj Well, that syntax is deprecated. And you'd have to create the actual file object. And put it in a variable. So it's more like: f = file(myFile.py, w) f.write(str(myListObj))

Re: launch a .py file from a batch file

2009-06-22 Thread C M
On Mon, Jun 22, 2009 at 8:04 PM, Dave Angel da...@ieee.org wrote: CM wrote: I'd like to launch a number of programs, one of which is a Python GUI app, from a batch file launcher. I'd like to click the .bat file and have it open all the stuff and then not show the DOS console. I can launch

Re: Open source python projects

2009-06-22 Thread John Fabiani
pyt...@bdurham.com wrote: Saurabh, 1. The Dabo crew is doing some exciting thing. Might be worth checking out. http://dabodev.com yes Dabo is doing a lot these days. Using wxPython for the GUI, a fast interface for data supporting SQLite, MySQL,Postgres, Firebird, MsSQL and Now a web like

Reading a large csv file

2009-06-22 Thread Mag Gam
Hello All, I have a very large csv file 14G and I am planning to move all of my data to hdf5. I am using h5py to load the data. The biggest problem I am having is, I am putting the entire file into memory and then creating a dataset from it. This is very inefficient and it takes over 4 hours to

Re: Reading a large csv file

2009-06-22 Thread Steven D'Aprano
On Mon, 22 Jun 2009 23:17:22 -0400, Mag Gam wrote: Hello All, I have a very large csv file 14G and I am planning to move all of my data to hdf5. [...] I was wondering if anyone knows of any techniques to load this file faster? Faster than what? What are you using to load the file? --

Re: Re: Re: How to output a complex List object to a file.

2009-06-22 Thread Chris Rebert
On Mon, Jun 22, 2009 at 7:31 PM, bluefisher80bluefishe...@gmail.com wrote: Hi Thanks for you tip, I am generating some code for another python application, so is there a better way for code generating? Actually i just need to generate some list objects to define EDI syntax using python.

Re: UnicodeDecodeError: problem when path contain folder start withcharacter 'u

2009-06-22 Thread Mark Tolonen
aberry abe...@aol.in wrote in message news:24146775.p...@talk.nabble.com... I am facing an error on Unicode decoding of path if it contain a folder/file name starting with character 'u' . Here is what I did in IDLE 1. fp = C:\\ab\\anil 2. unicode(fp, unicode_escape) 3. u'C:\x07b\x07nil'

Re: Reading a large csv file

2009-06-22 Thread Horace Blegg
Do you even HAVE 14 gigs of memory? I can imagine that if the OS needs to start writing to the page file, things are going to slow down. -- http://mail.python.org/mailman/listinfo/python-list

square box graph (?) API in python

2009-06-22 Thread Astan Chee
Hi, I'm trying to graph something that looks like the bottom half of this http://windirstat.info/images/windirstat.jpg I was wondering if there is any API in python or wxPython specifically to do this? I know it is possible to do calculation manually and use floatcanvas or something similar

square box graph (?) API in python

2009-06-22 Thread Astan Chee
Hi, I'm trying to graph something that looks like the bottom half of this http://windirstat.info/images/windirstat.jpg I was wondering if there is any API in python or wxPython specifically to do this? I know it is possible to do calculation manually and use floatcanvas or something similar

Re: Reading a large csv file

2009-06-22 Thread Mag Gam
Yes, the system has 64Gig of physical memory. What I meant was, is it possible to load to a hdf5 dataformat (basically NumPy array) without reading the entire file at first? I would like to splay to disk beforehand so it would be a bit faster instead of having 2 copies in memory. On Tue,

[issue1711603] syslog syscall support for SysLogLogger

2009-06-22 Thread Max Arnold
Max Arnold lwa...@gmail.com added the comment: Can I vote for this issue? Many systems with syslog aren't configured to listen on UDP socket and thus out of the box SysLogHandler does not work. -- nosy: +LwarX ___ Python tracker

[issue1711603] syslog syscall support for SysLogLogger

2009-06-22 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: As the docstring and documentation says, you can use SysLogHandler(/dev/log) or similar to connect to a local syslog using Unix domain sockets rather than UDP. Doesn't this work for you? -- ___

[issue5590] pyexpat defines global symbol template_string

2009-06-22 Thread Matthias Klose
Matthias Klose d...@debian.org added the comment: fixed in rev 73503 -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5590 ___

[issue4949] Constness in PyErr_NewException

2009-06-22 Thread Andreas Kloeckner
Changes by Andreas Kloeckner inf...@tiker.net: -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4949 ___ ___

[issue6322] Pdb breakpoints don't work on lines without bytecode

2009-06-22 Thread Andreas Kloeckner
New submission from Andreas Kloeckner inf...@tiker.net: Take this program: 8 --- print START a = [ 1 for i in range(10)] 8 --- as a.py, run python -m pdb a.py, say b 3 to set a breakpoint

[issue1711603] syslog syscall support for SysLogLogger

2009-06-22 Thread Max Arnold
Max Arnold lwa...@gmail.com added the comment: Is it safe to use single handler instance in multiple loggers or single stream in multiple handlers? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1711603

[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread Andreas Kloeckner
New submission from Andreas Kloeckner inf...@tiker.net: Steps to reprdocue: 1) Debug a program with a syntax error in pdb. 2) Get the SyntaxError traceback. 3) Hit q to quit. 4) Another SyntaxError traceback, and you're back at the Pdb prompt. -- components: Library (Lib) messages:

[issue1711603] syslog syscall support for SysLogLogger

2009-06-22 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Why would you want to use a single handler instance against multiple loggers? It's safe to do so, but you could get duplicated messages appearing. I presume you have reviewed the documentation and are aware that loggers are organised in a

[issue1711603] syslog syscall support for SysLogLogger

2009-06-22 Thread Max Arnold
Max Arnold lwa...@gmail.com added the comment: Sorry, I've read your first reply too fast and incorrectly interpreted it as recommendation to use stream handler with /dev/log. Anyway, thank you for clarification. -- ___ Python tracker

[issue6070] Python 2.6 makes .pyc/.pyo bytecode files executable

2009-06-22 Thread Oleg Broytmann
Oleg Broytmann p...@phd.pp.ru added the comment: import_patch2.patch doesn't work for me. I patched and compiled Python 2.6.2 and without installing it ran ./python -c import test in the build directory. It copied executable bits from test.py to test.pyc. --

[issue6070] Python 2.6 makes .pyc/.pyo bytecode files executable

2009-06-22 Thread Marco
Marco marcu...@gmail.com added the comment: hmm.. the problem is that Windows doesn't support well permissions as all the other POSIX compliant OSs ... I've searched for a solution on the web, and I've found a complete answer on:

[issue6070] Python 2.6 makes .pyc/.pyo bytecode files executable

2009-06-22 Thread Oleg Broytmann
Oleg Broytmann p...@phd.pp.ru added the comment: I am not on Windows. I am on Linux. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6070 ___ ___

[issue5910] kqueue for more than one event is broken.

2009-06-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The patch looks good, but I cannot test it. -- assignee: - christian.heimes nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5910

[issue6285] Silent abort on XP help document display

2009-06-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I reproduce the same problem: In IDLE, add a new entry in Options/Configure/General/Additional Help Sources, and browse to the C:\Python31\Docs\Python31*.chm file. This new entry appears in the Help menu. Now, if you un-install this

[issue6324] in expression falls back to __iter__ before __getitem__

2009-06-22 Thread Anthony Foglia
New submission from Anthony Foglia afog...@gmail.com: I was debugging a class where I defined __getitem__ and __iter__, but not __contains__. The documentation describing this case (at the end of section 5.9) is old and hasn't been updated for the iterator protocol. It should read something

[issue4490] xml/sax/expatreader.py raises AttributeError when run

2009-06-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: These functions are already tested, but I think that this kind of code also serves to show a basic usage of the module. Fixed with r73509. -- nosy: +amaury.forgeotdarc resolution: - fixed status: open - closed

[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I tried different combinations, and could not reproduce it (for example, the debugged function imports a bad module, or eval() a bad expression) How did you generate the SyntaxError? -- nosy: +amaury.forgeotdarc stage: - test

[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread nlopes
nlopes shelika.v...@gmail.com added the comment: I can reproduce it in my OpenBSD 4.5 box (only one I tried). This simple code: print(3 seems to break the pdb flow in python 3.1 the way Andreas described it. When I tried in 2.7, this is what I get: -bash-3.2$ ./python -m pdb test.py

[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-06-22 Thread Andrew Trick
Andrew Trick andrew.tr...@gmail.com added the comment: With this patch, I continued to get the following error SSL23_GET_SERVER_HELLO Until my coworker finally found a fix posted by Philippe Biondi: +++ b/mercurial/keepalive.py @@ -237,6 +237,8 @@ else: # no

[issue6324] in expression falls back to __iter__ before __getitem__

2009-06-22 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: georg.brandl - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6324 ___

[issue6290] cPickle can misread data type

2009-06-22 Thread Alex James
Alex James ac.ja...@shaw.ca added the comment: I have now pinpointed the error to a list of infinities (see attached). When using pickle.py to read the cPickle'd data we get a different, and more, informative error: ValueError: invalid literal for float(): 1.#INF -- Added file:

[issue1298813] sysmodule.c: realpath() is unsafe

2009-06-22 Thread jan matejek
Changes by jan matejek jmate...@suse.cz: -- nosy: +matejcik ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1298813 ___ ___ Python-bugs-list mailing

[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Thanks for the test case. It appears that 2.7 actually calls exec(execfile(filename)), when 3.1 directly calls exec(file_content). The indirection seems necessary: the SyntaxError is detected by the pdb trace function; but this

[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread nlopes
nlopes shelika.v...@gmail.com added the comment: That fixes it. It seems to be introduced when committing a fix for issue #1038. -bash-3.2$ svn diff -r 58126:58127 Lib/pdb.py Index: Lib/pdb.py === --- Lib/pdb.py (revision 58126)

[issue6070] Python 2.6 makes .pyc/.pyo bytecode files executable

2009-06-22 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: The patch did not apply for me. I modified the code by hand based on the patch file, and on Gentoo linux it worked for me. Patch that applies cleanly to trunk attached. -- nosy: +r.david.murray priority: - low stage: - test

[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Good point. So in the end, we just replaced exec('%s')# wrong when the text is x='a' with exec(%r) -- ___ Python tracker rep...@bugs.python.org

[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-06-22 Thread Senthil
Senthil orsent...@gmail.com added the comment: AndrewTrick: I am assuming your last comment is more relevant to mercurial's use of the set_tunnel, the facility provided by the patch, that is solving the issue for you. You had earlier pointed out mercurial's dependency upon this issue too. The

[issue5230] pydoc reports misleading failure if target module raises an ImportError

2009-06-22 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: OK, I finally had time to come back to this, and figured out what I think is a final fix. It passes all the tests we've come up with, at least. Let me know if you see any problems with it, and if not I'll apply it. -- assignee:

[issue5230] pydoc reports misleading failure if target module raises an ImportError

2009-06-22 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: Removed file: http://bugs.python.org/file14205/issue5230.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5230 ___

[issue6290] cPickle can misread data type

2009-06-22 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Thanks for the test case. I will take a look. -- assignee: georg.brandl - alexandre.vassalotti components: +Library (Lib) -Documentation, Extension Modules, Windows ___ Python tracker

[issue6290] cPickle can misread data type

2009-06-22 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Could you give me the output of this? import cPickle print repr(cPickle.dumps([float('+inf'), float('-inf'), float('nan')])) print [float('+inf'), float('-inf'), float('nan')] By the way, are you sure this bug occurs on Python

[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-06-22 Thread Andrew Trick
Andrew Trick andrew.tr...@gmail.com added the comment: I should have pointed out that my secondary problem was a mercurial dependency on the urllib patch. I just wanted Mercurial users to get a complete fix. I figure they will be looking for a fix in the python bug report, and need to be told

[issue6325] robotparser doesn't handle URL's with query strings

2009-06-22 Thread Brian Slesinsky
New submission from Brian Slesinsky br...@slesinsky.org: If a robots.txt file contains a rule of the form: Disallow: /some/path?name=value This pattern will never match a URL passed to can_fetch(), as far as I can tell. It's arguable whether this is a bug. The 1994 robots.txt protocol is

[issue6233] ElementTree (py3k) doesn't properly encode characters that can't be represented in the specified encoding

2009-06-22 Thread Jerry Chen
Jerry Chen je...@3rdengine.com added the comment: The attached patch includes Neil's original additions to test_xml_etree.py. I also noticed that _encode_entity wasn't being called in ElementTree in py3k, with the important bit being the nested function escape_entities(), in conjunction with

<    1   2