Problem pickling exceptions in Python 2.5/2.6

2008-06-08 Thread Irmen de Jong
I'm having troubles pickling classes that extend Exception. Given the following source: class Foo(object): def __init__(self, m): self.m=m class Bar(Exception): def __init__(self, m): self.m=m import pickle s=pickle.dumps(Foo(test)) pickle.loads(s) # normal object

[issue2871] store thread.get_ident() thread identifier inside threading.Thread objects

2008-05-24 Thread Irmen de Jong
Irmen de Jong [EMAIL PROTECTED] added the comment: Thanks Gregory, for taking the time to make a patch. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2871 __ ___ Python-bugs

[issue2871] store thread.get_ident() thread identifier inside threading.Thread objects

2008-05-23 Thread Irmen de Jong
Irmen de Jong [EMAIL PROTECTED] added the comment: Adding it in the run method would only work for threads that I create in my own code. The thing is: I need to be able to get the tread identification from threads created by third party code. So I cannot rely on that code putting

Re: TPCServer and xdrlib

2008-05-19 Thread Irmen de Jong
Laszlo Nagy wrote: It is possible to change the serialization used by Pyro http://pyro.sourceforge.net/manual/9-security.html#pickle to the the 'gnosis' XML Pickler. As I said earlier, I would not use XML. Just an example - I need to be able to transfer image files, word and excel

Re: Newbie: Keep TCP socket open

2008-05-19 Thread Irmen de Jong
Alan Wright wrote: while (num1=10) : s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(10.0) s.connect((10.1.1.69, 50008)) # SMTP print s.recv(1024) + '\n', num1=num1+1 #s.close() sys.exit(1) I think the following is happening: Reusing the 's' object for every new

Re: How do *you* use Python in non-GUI work?

2008-05-18 Thread Irmen de Jong
opening a Python prompt to just execute simple tasks that I see other people needing big tools or even online services for: - base-64 encoding/decoding - md5/sha hashing - simple string or regular expression operations - simple math - unicode decoding/encoding - etc etc. --irmen de jong -- http

[issue2871] store thread.get_ident() thread identifier inside threading.Thread objects

2008-05-15 Thread Irmen de Jong
New submission from Irmen de Jong [EMAIL PROTECTED]: I've ran into a problem where it would be very nice to be able to tell the tread.get_ident() of a given threading.Thread object. Currently, when creating a new Thread object, there is no good way of getting that thread's get_ident() value

Re: Best technology for agent/web server architecture

2008-05-12 Thread Irmen de Jong
things that could help you here: - you can define a connection authenticator that checks client IP and/or passphrases - you can switch to an XML based serialisation protocol (courtesy of gnosis tools) - you can run Pyro over SSL and let SSL deal with authentication/encryption/... Cheers Irmen de

Re: Import/Create module from buffer

2008-05-12 Thread Irmen de Jong
Gruik wrote: But before that 1 question: what if I'm in Python ? Following your solution, I did that in Python : def load_buffer(buffer) : compiled_buffer = compile(buffer, module_name, exec) exec(compiled_buffer) It works great except that I can't have a module object and

Re: what does int means for python ?

2008-05-11 Thread Irmen de Jong
alefajnie wrote: #!/usr/bin/env python arr = [[0 for c in range(0, 10)] for r in range(0, 10)] # 10x10 array arr[2,3] # throws TypeError: list indices must be integers arr[int(2), int(3)] # also throws TypeError: list indices must be integers !

Re: Simple question

2008-05-10 Thread Irmen de Jong
Gandalf wrote: On May 10, 2:36 pm, Bjoern Schliessmann usenet- [EMAIL PROTECTED] wrote: Gandalf wrote: how can i ran script with python It depends on your web server configuration. To get your web server execute Python code, there are several alternatives like * CGI * FastCGI * mod_python

Re: Receive data from socket stream

2008-04-26 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: Until now, I've been doing this little trick: data = client.recv(256) new = data while len(new) == 256: new = client.recv(256) data += new Are you aware that recv() will not always return the amount of bytes asked for? (send() is similar; it doesn't guarantee

Re: Using pickle for interprocess communication - some notes and things that ought to be documented.

2008-01-17 Thread Irmen de Jong
Christian Heimes wrote: John Nagle wrote: It's possible to use pickle for interprocess communication over pipes, but it's not straightforward. IIRC the processing module uses pickle for IPC. Maybe you can get some idea by reading its code? http://pypi.python.org/pypi/processing/0.40

Re: RMI with Pyro et al

2007-10-11 Thread Irmen de Jong
Sells, Fred wrote: Diez B. Roggisch wrote . Why do you want that (hot deploy) anyway? Does startuptime of a script really bother you? shouldn't take more than a few seconds. My primary need is development/debug. I'm a Pyro newbie and I add a feature and then test. The only way I've

Re: RMI with Pyro et al

2007-10-11 Thread Irmen de Jong
Diez B. Roggisch wrote: Go install cygwin (but not it's included python-interpreter, or at least make sure you have your python path properly under control) and then simply start the script from the command-line. And hit C-c if you need it to stop, and restart it. Only start it as service if

Re: ANN: Compyler 0.1

2007-08-13 Thread Irmen de Jong
Thanks Grant for the very informative response. -irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Compyler 0.1

2007-08-12 Thread Irmen de Jong
Grant Olson wrote: Compyler is a pre-alpha x86 native code compiler. In what ways is this similar or different to Shed Skin? http://mark.dufour.googlepages.com/ --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: question: howto transfer objects between server and client?

2007-08-11 Thread Irmen de Jong
OpenPavilion wrote: Since XMLRPC has limited features: Is there any other server/client technique to transfer objects (not strings, or dictionaries, but self defined object types) ? Take a look at Pyro; http://pyro.sourceforge.net --Irmen --

Re: distutils

2007-08-07 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: Hello again, Is there any patch for python distutils, for this from distutils import log,dir_util ImportError: cannot import name log Regards, Vedran Are you sure you haven't written a module yourself called distutils.py ? (that one will hide the standard

Re: Auto run/Timer

2007-08-04 Thread Irmen de Jong
Rohan wrote: Hello, I would like my script to run once a week with out any external interference. More like a timer. Can it be done in python or should some other shell scripting be used. If anyone knows anything please let me know. Have a look at my 'kronos' task scheduler, available

Re: (no) fast boolean evaluation ?

2007-08-03 Thread Irmen de Jong
John Machin wrote: (you_are_confused and/or function_returns_bool_but_has__side_effects()) That above expression should be written more explicitly like: function_result = function_returning_bool_but_with_side_effects() if you_are_confused or function_result: do_something_nice()

Re: Directory

2007-07-30 Thread Irmen de Jong
Rohan wrote: I would like to get a list of sub directories in a directory. If I use os.listdir i get a list of directories and files in that . i only want the list of directories in a directory and not the files in it. anyone has an idea regarding this. Look up os.walk (allows you to

Re: Pickled objects over the network

2007-07-19 Thread Irmen de Jong
Rustom Mody wrote: Sure pyro may be the solution but it may also be overkill Why not use safe_load from the yaml module? In what way would Pyro be overkill where Yaml (also a module that you need to install separately) wouldn't be? -irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: Best method for inter process communications

2007-07-17 Thread Irmen de Jong
JamesHoward wrote: I am looking for a way of performing inter process communication over XML between a python program and something else creating XML data. What is that something else? --irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: socket: connection reset by server before client gets response

2007-07-07 Thread Irmen de Jong
ahlongxp wrote: me again. Connection reset by peer happens about one in fifth. I'm using python 2.5.1 and ubuntu 7.04. -- ahlongxp Software College,Northeastern University,China [EMAIL PROTECTED]://www.herofit.cn Post the code. Without it we can only help when our magic

Re: Python and ARexx (was Re: Tiny/small/minimalist Python?)

2007-07-03 Thread Irmen de Jong
Dennis Lee Bieber wrote: On 3 Jul 2007 10:03:45 GMT, Jorgen Grahn [EMAIL PROTECTED] declaimed the following in comp.lang.python: How does Python combine with ARexx? Can you control applications which provide an ARexx interface? Irmen had supplied a Python module that had ARexx port

Re: Tiny/small/minimalist Python?

2007-07-02 Thread Irmen de Jong
Paul Rubin wrote: rtk [EMAIL PROTECTED] writes: FYI.. I wanted a simple version of Python to run on an ancient DEC Alpha box. I got VMS Python 2.5 up and running but it is too slow to use. It takes *minutes* to get the interpreter prompt after typing 'python'! Something is wrong. Maybe

Re: Periodic tasks.

2007-05-30 Thread Irmen de Jong
Ramashish Baranwal wrote: Hi, I am trying to execute some tasks periodically, those familiar with unix can think of it as equivalent to cron jobs. I have tried looking around, but couldn't find a way. Would appreciate any pointers or clues.. Thanks, -Ram Have a look at Kronos, a

Re: Shared Memory Space - Accross Apps Network

2007-05-25 Thread Irmen de Jong
Hendrik van Rooyen wrote: Just to get the ball rolling, I'd suggest two things: Pyro -http://pyro.sf.net This is good advice, if you have the power to run it. What do you mean exactly by the power to run it? --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: Components for a client/server architecture

2007-05-22 Thread Irmen de Jong
John Nagle wrote: You don't hear much about CORBA any more. It used to be derided as a bulky way to marshall data, but then came XML. CORBA is much more than just a way to marshall data. GIOP (or its more often used implementation IIOP) is the marshaling protocolused in CORBA. And it is

Pyro 3.7 (remote objects)

2007-05-20 Thread Irmen de Jong
to recent WxPython API, deprecation warning is gone Have fun, and thanks for your interest, support, and feedback! --Irmen de Jong --- What is Pyro? Pyro is an acronym for PYthon Remote Objects. Pyro is an advanced and powerful Distributed Object Technology system written entirely in Python

ANN: Pyro 3.7 (remote objects)

2007-05-19 Thread Irmen de Jong
to recent WxPython API, deprecation warning is gone Have fun, and thanks for your interest, support, and feedback! --Irmen de Jong --- What is Pyro? Pyro is an acronym for PYthon Remote Objects. Pyro is an advanced and powerful Distributed Object Technology system written entirely in Python

Re: Problem with socket.recv()

2007-05-17 Thread Irmen de Jong
xreload wrote: Hello ! So, lets do : sock.py http://forums.childrenwithdiabetes.com/showthread.php?t=5030; - it not ok , only some part of document. wget http://forums.childrenwithdiabetes.com/showthread.php?t=5030; - it ok ! sock.py http://www.google.com/; - it ok ! Why i got only

Re: Python Power Point Slides

2007-05-14 Thread Irmen de Jong
Krypto wrote: Hi, I want to give a short presentation in my group about benefits of python, why should one use python and some basic starting information about python, about its data type, etc. Can somebody point me to the right references on the web. I have searched a lot and I do get

Re: getmtime differs between Py2.5 and Py2.4

2007-05-08 Thread Irmen de Jong
Leo Kislov wrote: Let me guess: your E drive uses FAT filesystem? -- Leo Nope, its all NTFS on my system. Anyway this doesn't matter, as the true cause is explained in another reply in this thread (bug in c runtime library of Python 2.4). --Irmen --

Re: getmtime differs between Py2.5 and Py2.4

2007-05-07 Thread Irmen de Jong
Martin v. Löwis wrote: Is this a bug? Why don't you read the responses posted earlier? John Machin replied (in [EMAIL PROTECTED]) that you are mistaken: There is NO difference between the outcome of os.path.getmtime between Py2.5 and Py2.4. It always did return UTC, and always will.

Re: Numbers and truth values

2007-04-28 Thread Irmen de Jong
Szabolcs wrote: Newbie question: Why is 1 == True and 2 == True (even though 1 != 2), but 'x' != True (even though if 'x': works)? Please check before you post: [E:\Projects]python Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright,

Re: Select weirdness

2007-04-23 Thread Irmen de Jong
Ron Garret wrote: I don't understand why socketserver calling select should matter. (And BTW, there are no calls to select in SocketServer.py. I'm using Python2.5.) You don't *need* a select at all. Socketserver just blocks on accept() and dispatches a handler on the new connection.

Re: Select weirdness

2007-04-22 Thread Irmen de Jong
Ron Garret wrote: Here's my code. It's a teeny weeny little HTTP server. (I'm not really trying to reinvent the wheel here. What I'm really doing is writing a dispatching proxy server, but this is the shortest way to illustrate the problem I'm having): from SocketServer import * from

Re: how to transfer integer on socket?

2007-04-21 Thread Irmen de Jong
Frank Potter wrote: Is there any easy way to transfer 4 bit integer on socket? I think you mean a 4-byte integer? Look at the struct module, anyway. --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: [offtopic?] problem with UDP broadcast on Windows XP

2007-04-10 Thread Irmen de Jong
Hendrik van Rooyen wrote: I am not sure if this is at all relevant - but I seem to recall seeing something once that had a list of socket numbers, splitting them between UDP TCP - can the socket actually rx UDP? Yeah, as I wrote: when I'm sending UDP packets to the port directly on the

Re: problem with UDP broadcast on Windows XP

2007-04-10 Thread Irmen de Jong
Paul McGuire wrote: I would investigate Windows security settings as a likely culprit. My guess is that you are running WinXP SP2 with the default security policies, which are likely to prohibit such promiscuous behavior. Here's a URL that may shed some light, it seems surprisingly

[offtopic?] problem with UDP broadcast on Windows XP

2007-04-09 Thread Irmen de Jong
. Is this a known 'feature' of a windows NT service? Doesn't windows allow a service to receive broadcast packets? Again, sorry that I post this here it is probably more of a windows question. But I don't know a good place to ask this type of thing. Thanks for any help, --Irmen de Jong -- http

Re: [offtopic?] problem with UDP broadcast on Windows XP

2007-04-09 Thread Irmen de Jong
Gabriel Genellina wrote: Try running the service impersonating another user (not LOCAL_SERVICE, the default). You can change that from the service control panel. Alas, that didn't change anything. I made it run as a user account that has admin privileges even, and it still doesn't respond to

Re: [offtopic?] problem with UDP broadcast on Windows XP

2007-04-09 Thread Irmen de Jong
Gabriel Genellina wrote: Ouch, no more ideas from me. You'll surely get more answers from a Windows networking group - this appears not to be related to Python anyway. Yeah I know that... That's what I mentioned in my original post... But I'm a noob on that type of thing, no idea where to get

Re: low level networking in python

2007-04-04 Thread Irmen de Jong
Maxim Veksler wrote: I'm trying to bind a non-blocking socket, here is my code: #!/usr/bin/env python import socket, select from time import sleep s_nb1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s_nb1.setblocking(0) s_nb1.bind(('192.168.2.106', 10002))

Re: Getting word frequencies from files which are in folder.

2007-04-04 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: Hello to all, I'm beginer in learning Python I wish somebody help me with solving this problem. I would like to read all text files wchich are in some folder. For this text files I need to make some word frequencies using defined words like buy, red, good. If some

Re: How can I find out the size of a file

2007-03-28 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: How can I find out the size of a file in a disk in python? os.path.getsize(filename) -Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: Create new processes over telnet in XP

2007-03-23 Thread Irmen de Jong
Shane Geiger wrote: This reminds me of something I once wanted to do: How can I install Python in a totally non-gui way on Windows (without the use of VNC)? I think I was telnetted into a computer (or something like that) and I was unable to run the usual Python installer because it uses

Re: replace illegal xml characters

2007-03-21 Thread Irmen de Jong
killkolor wrote: Does InDesign export broken XML documents? What exactly is your problem? yes, unfortunately it does. it uses all possible unicode characters, though not all are alowed in valid xml (see link in the first post). Are you sure about this? Could you post a small example? If

ANN: Pyro 3.6 (remote objects)

2007-03-20 Thread Irmen de Jong
to include here. Please view it online: http://pyro.sourceforge.net/manual/12-changes.html#latest Have fun, and thanks for your interest, support, and feedback! --Irmen de Jong --- What is Pyro? Pyro is an acronym for PYthon Remote Objects. Pyro is an advanced and powerful Distributed Object Technology

Re: distributed queue?

2007-03-11 Thread Irmen de Jong
Paul Rubin wrote: Does anyone have an implementation of a distributed queue? I.e. I have a long running computation f(x) and I'd like to be able to evaluate it (for different values of x) on a bunch of different computers simultaneously, the usual worker thread pattern except distributed

Re: How to test if a key in a dictionary exists?

2007-03-10 Thread Irmen de Jong
Frank wrote: Hi, does anyone know how one can test if, e.g., a dictionary 'name' has a key called 'name_key'? name_key in name e.g. name={john: 42} john in name True julie in name False --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle problem - frexp() out of range

2007-02-26 Thread Irmen de Jong
ahaldar wrote: Hi: I have some large data structure objects in memory, and when I attempt to pickle them, I get the following error: SystemError: frexp() out of range Are there some objects that are just too large to serialize, and if so, is there an easy workaround without breaking up

Re: Possible to set cpython heap size?

2007-02-22 Thread Irmen de Jong
Andy Watson wrote: Why do you want that? And no, it is not possible. And to be honest: I have no idea why e.g. the JVM allows for this. Diez The reason why is simply that I know roughly how much memory I'm going to need, and cpython seems to be taking a fair amount of time

Re: Forking SocketServer daemon -- updating state

2007-02-19 Thread Irmen de Jong
Reid Priedhorsky wrote: Another possibility is that the signal handler simply sets a needs_update flag, which I could check for in a handle_request() loop. The disadvantage here is that the update wouldn't happen until after the next request is handled, and I would like the state to be

Re: message processing/threads

2007-02-17 Thread Irmen de Jong
Jonathan Curran wrote: I need a program running in the background to process messages (FIFO order) which I would send using soap/xmlrpc/pyro (haven't decided yet). According to my thinking I would need to make this a threaded application. One thread to process the messages and the other

ANN: Pyro 3.6 beta

2007-02-12 Thread Irmen de Jong
' chapter in the manual, and/or visit Pyro's todo wiki page: http://www.razorvine.net/python/PyroTodoList Thanks for your support, and I'm looking forward to release a final Pyro-3.6 version soon ! Sincerely, --Irmen de Jong PS: Sourceforge's shell access is down at the moment so I can't

ANN: Pyro 3.6 beta released

2007-02-12 Thread Irmen de Jong
' chapter in the manual, and/or visit Pyro's todo wiki page: http://www.razorvine.net/python/PyroTodoList Thanks for your support, and I'm looking forward to release a final Pyro-3.6 version soon ! Sincerely, --Irmen de Jong PS: Sourceforge's shell access is down at the moment so I can't

Re: How to Speed Up Internet Searches??

2007-02-12 Thread Irmen de Jong
Patrick Klos wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: How to Speed Up Internet Searches?? When you go to a web site, the first thing that happens is that. and for networking tips see at : : : Please don't post this kind of stuff here any

Re: Python, readline and OS X

2007-02-01 Thread Irmen de Jong
Ron Garret wrote: I have installed Python 2.5 on my new Intel Mac but I can't for the life of me get readline to work. I have libreadline installed, I've tried copying readline.so from my Python 2.3 installation into 2.5, I've searched the web, and no joy. Could someone please give me a

Re: Calculating future dates

2007-02-01 Thread Irmen de Jong
Toine wrote: Hello, I'm new to Python so please bare with me... I need to calculate a date that is exactly 31 days from the current date in -MM-DD format. I know that date.today() returns the current date, but how can I add 31 days to this result? I'm sure this task is simple, but I

Re: socket.inet_ntop, and pton question

2007-01-28 Thread Irmen de Jong
Andrew wrote: Hi Are these functions (inet_ntop(), inet_pton()) from the socket library supported on Windows. If not is there an equivalent for them using Windows Ive seen mention of people creating their own in order to use them Appreciate the help ty Why didn't you just try:

Re: socket.inet_ntop, and pton question

2007-01-28 Thread Irmen de Jong
Gabriel Genellina wrote: But these are not the requested functions, inet_ntop() and inet_pton(): py socket.inet_ntop Traceback (most recent call last): File stdin, line 1, in ? AttributeError: 'module' object has no attribute 'inet_ntop' Oops, my bad. Should have had more coffee

Re: newb: Can I use PYRO

2006-12-06 Thread Irmen de Jong
johnny wrote: What I want to do is the following: Web user uploads a word doc (web app written in php), and I need it to move the uploaded word doc, on to another machine and conver it to pdf. Then update the database and allow immediate pdf download. I am thinking of using ftp from

Re: client/server design and advice

2006-12-02 Thread Irmen de Jong
John Henry wrote: On the subject of passing things around, is there a no brainer way of sending files back and forth over Pyro? I am currently using a shared drive to do that. May be I missed that feature? Sending files around is just a special case of passing large amounts of data to

Re: client/server design and advice

2006-12-01 Thread Irmen de Jong
TonyM wrote: Lastly, as far as the networking goes, i have seen posts and such about something called Pyro (http://pyro.sourceforge.net) and wondered if that was worth looking into for the client/server interaction. I'm currently busy with a new version of Pyro (3.6) and it already includes a

Re: client/server design and advice

2006-12-01 Thread Irmen de Jong
bruce wrote: hi irmen... happened to come across this post. haven't looked at pyro. regarding your 'work packets' could these essentially be 'programs/apps' that that are requested by the client apps, and are then granted by the dispatch/server app? Pyro supports a limited form of mobile

Re: Dynamic function execution

2006-11-25 Thread Irmen de Jong
Andy Wu wrote: Say I have a string 'minutes' and a integer 30, now I need to call the func this way: func(minutes = 30), how do I do this? d={minutes: 30} func(**d) This is extended call syntax. You can read more about this when you look up the (deprecated) apply function in the manual.

Re: Why does this code crash python?

2006-11-11 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: I am trying to make a program that will basically simulate a chess clock in python. To do this I have two threads running, one that updates the currently running clock, and one that watches for a keypress. I am using the effbot Console module, and that is where I get

Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread Irmen de Jong
Jorge Godoy wrote: Cliff Wells [EMAIL PROTECTED] writes: I think this sums up my point of view as well (although I would have used around 3215 more words to say it). H... Putting this on the discussion of the week: you'd have used range(3215) or xrange(3215) more words? ;-)

Re: Pyro stability

2006-11-06 Thread Irmen de Jong
writeson wrote: Irmen, Thanks, you're very good about answering Pyro related questions! Well, I do have an advantage here, being Pyro's author... :) --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyro stability

2006-11-05 Thread Irmen de Jong
writeson wrote: [some questions about Pyro] I've replied to this on Pyro's mailing list. -Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: How set the source IP adress

2006-10-27 Thread Irmen de Jong
Maksim Kasimov wrote: Hi, how to set source ip-address when do __socket.connect((host, port)) on a machine that have a several ip-adresses? many thanks for advice. __socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) __socket.connect((host, port)) sock.connect (

Re: Stylesheet not respected

2006-10-24 Thread Irmen de Jong
Suren wrote: I was able to the see weird stylesheet behavior on opera, IE and mozilla under mod_python. [snip] I'm 99% sure this has nothing to do with Python but is just an error in your CSS file. Show the CSS so we might be able to see the problem. One thing to check for though is that

Re: Socket module bug on OpenVMS

2006-10-23 Thread Irmen de Jong
Fredrik Lundh wrote: Irmen de Jong wrote: This also raises the question to what extent Python itself should work around platform specific peculiarities, such as this one. There's another problem with socket code on Windows and VMS systems, where you get strange exceptions when using a too

Re: Socket module bug on OpenVMS

2006-10-23 Thread Irmen de Jong
Martin v. Löwis wrote: Irmen de Jong schrieb: In my opinion Python's socket module itself could implement these workarounds. That would make user code a lot cleaner and less error prone, and more portable. What do other people think? It depends: when VMS defines MSG_WAITALL, but doesn't

Socket module bug on OpenVMS

2006-10-22 Thread Irmen de Jong
() and a simple socket send()... In my opinion Python's socket module itself could implement these workarounds. That would make user code a lot cleaner and less error prone, and more portable. What do other people think? Regards --Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Altering the way exceptions print themselves

2006-10-22 Thread Irmen de Jong
wrong? Or is there perhaps a different way to do what I want? Thanks! --Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: Socket module bug on OpenVMS

2006-10-22 Thread Irmen de Jong
Jean-Paul Calderone wrote: I think everyone can agree that Python shouldn't crash. Well, it doesn't really crash in a bad way, in my example: it doesn't work because it simply raises a socket exception all the time. Whether Python should propagate other kinds of errors from the underlying

Re: Socket module bug on OpenVMS

2006-10-22 Thread Irmen de Jong
Jean-François Piéronne wrote: Which Python version, OpenVMS version, IP stack and stack version? OpenVMS 7.3-2, Python 2.3.5, no idea about IP stack version. If you think this is a Python on OpenVMS problem, send me a small reproduced anf I will take a look. I don't have any small case

Re: Socket module bug on OpenVMS

2006-10-22 Thread Irmen de Jong
Jean-Paul Calderone wrote: On Sun, 22 Oct 2006 19:58:44 +0200, Irmen de Jong [EMAIL PROTECTED] wrote: Jean-Paul Calderone wrote: I think everyone can agree that Python shouldn't crash. Well, it doesn't really crash in a bad way, in my example: it doesn't work because it simply raises

Re: Sending binary pickled data through TCP

2006-10-13 Thread Irmen de Jong
complex and/or you discover problems with your networking code. Hth, ---Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: How to ask sax for the file encoding

2006-10-04 Thread Irmen de Jong
Edward K. Ream wrote: What suits me best is what the *user* specified, and that got put in the first xml line. I'm going to have to parse this line myself. Please consider adding some elements to the document itself that describe the desired output format, such as: ... output

Re: Is there an alternative to os.walk?

2006-10-04 Thread Irmen de Jong
Bruce wrote: Hi all, I have a question about traversing file systems, and could use some help. Because of directories with many files in them, os.walk appears to be rather slow. Provide more info/code. I suspect it is not os.walk itself that is slow, but rather the code that processes its

Re: How to ask sax for the file encoding

2006-10-04 Thread Irmen de Jong
Edward K. Ream wrote: Please consider adding some elements to the document itself that describe the desired output format, Well, that's what the encoding field in the xml line was supposed to do. As others have tried to explain, the encoding in the xml header is not part of the document

Re: php and python: how to unpickle using PHP?

2006-10-02 Thread Irmen de Jong
Ted Zeng wrote: Hi, I store some test results into a database after I use python To pickle them (say, misfiles=['file1','file2']) Now I want to display the result on a web page which uses PHP. How could the web page unpickle the results and display them? Is there a PHP routine that can

Re: creating a small test server on my local computer

2006-09-29 Thread Irmen de Jong
John Salerno wrote: Ok, this is completely unnecessary so I don't intend to get into stuff that's beyond my skill, but I'm wondering how simple it would be to use Python to create a server that runs on my computer so I can test my webpages (because otherwise I have to keep sending them to

Re: new string method in 2.5 (partition)

2006-09-20 Thread Irmen de Jong
Terry Reedy wrote: Bruno Desthuilliers [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Err... is it me being dumb, or is it a perfect use case for str.split ? s.partition() was invented and its design settled on as a result of looking at some awkward constructions in the

Re: new string method in 2.5 (partition)

2006-09-20 Thread Irmen de Jong
Gabriel Genellina wrote: Nope, a python string has both a length *and* a null terminator (for ease of interfacing C routines, I guess) so you can't just share a substring. Ofcourse, that makes perfect sense. Should have thought a little bit further myself :) --Irmen --

Re: Python blogging software

2006-09-13 Thread Irmen de Jong
Cliff Wells wrote: I'm currently using Frog, and it's decent, but lacks some fundamental features (tags for one). Since Irmen is probably going to scrap it anyway, I'm kind of fishing about for something new. That is not really true. I won't scrap Frog. One of the reasons would be that I'm

Re: about daemons and IPC

2006-08-29 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: Hey people! For the first time I'm doing a client/server application, and I'm really confused with IPC stuff. [...] Any suggestions? http://pyro.sourceforge.net depending on your needs --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: Python linker

2006-07-18 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: I love python - I use it as a utility language to complement my C# programming every day. However, the reason I do not use it as my primary language is - surprise, surprise - not its lack of static type checking, but the size of standalone executes (which embed the

Re: Headers for Form Submision, and also HTTPrequests

2006-07-10 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: form action=http://login.myspace.com/index.cfm?fuseaction=login.process; method=post name=theForm id=theForm input type=text name=email input type=password name=password input type=submit value=Login/ What happens when you add the form param submit with value

Re: mirroring object attributes using xml-rpc

2006-07-06 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: but why can't I get the value of i like this? c.i How can I implement such behaviour? Not supported by XMLRpc. Switch to Pyro: http://pyro.sourceforge.net --Irmen -- http://mail.python.org/mailman/listinfo/python-list

socket close problems with Python 2.5b1

2006-06-28 Thread Irmen de Jong
I'm having some troubles with closing sockets using Python 2.5b1 Simply closing a client socket (on the server side) doesn't seem to actually shutdown the socket anymore. A connected client simply hangs, while with older Pythons it aborted with a socket close error. Can someone confirm this for

Re: locating strings approximately

2006-06-28 Thread Irmen de Jong
BBands wrote: I'd like to see if a string exists, even approximately, in another. For example if black exists in blakbird or if beatles exists in beatlemania. The application is to look though a long list of songs and return any approximate matches along with a confidence factor. I have

Re: Network Programming in Python

2006-06-22 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: Really, was that so hard? Python makes sockets a total breeze. You can write an 80's style HTTP server in less than a page of code. But making a *good* 80's style http/socket server is a lot of work. Better pick one of the high level protocols built on top of it,

Re: socket programming question

2006-06-20 Thread Irmen de Jong
Kiran wrote: Hello All, My question is, is it possible to make python do some other processing while it is waiting for a socket to timeout? sure, you have to use threads and/or use asynchronous socket programming. Google is your friend. --Irmen --

Re: billionlaughs, on me :-(( - on winXP help!

2006-06-15 Thread Irmen de Jong
for viewing in your favorite editor :) Cheers, --Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   >