Re: Python and SSL

2007-09-28 Thread Martin v. Löwis
> I need to use Python with SSL comunication betweeen servers. > (I use hhtplib but I think urllib2 can also be used ) > I think I need to use SSL root certificate and tell a program to > trust this certificate. I don't think so - what the SSL module does is already fine for you. > But how can

Re: marshal bug?

2007-09-28 Thread Martin v. Löwis
> [1] http://coverage.livinglogic.de/Python/marshal.c.html. (Actually, I > checked the downloaded bz2, but this is the only URL for marshal.c I > could find) A better URL is http://svn.python.org/projects/python/trunk/Python/marshal.c or http://svn.python.org/view/python/trunk/Python/marshal.c

Re: Python and SSL

2007-09-28 Thread Martin v. Löwis
> I heard that python 2.6 will include full "server-side SSL > support" (whatever this means). > Is it true? Yes, that's true. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and SSL

2007-09-29 Thread Martin v. Löwis
>>> But how can I tell my Python program to trust my SSL certificate? >> Why do you want to tell it that? The SSL module will trust *any* >> server certificate, no need to tell it explicitly which ones to >> trust. > > Er, the whole idea of SSL is that you don't trust the connection. Please try t

Re: python 2.5 and 3gb switch

2007-09-29 Thread Martin v. Löwis
> The code runs successfully in lesser missions it just wont run in the extra > memory available when I try to run it along with my other programs in a 3gb > space. Still, it would be helpful if you explained how "wont run" manifests: does it fail to start, does it give you an exception, does it

Re: python 2.5 and 3gb switch

2007-09-29 Thread Martin v. Löwis
> This is where python gives 'memerror'. Although the space is there it wont > use it. It's still not clear to me. Please be as precise and literal as you can when reporting error messages. I very much doubt that Python outputs memerror at some point to the terminal; the string 'memerror' does

Re: Python and SSL

2007-10-01 Thread Martin v. Löwis
>> No, as Martin points out, Python trusts EVERY certificate, which of >> course misses the whole point of certificates. Whatever is making >> your program fail is something different. > > Paul, are you sure for 100%. It is hard to belive. Not sure how many confirmations you want, but I can add

Re: Python and SSL

2007-10-01 Thread Martin v. Löwis
> Actually, the SSL certificate has to be in valid format, because > OpenSSL does require that. Sure. However, in the first message, the OP mentioned that he gets error 503. That tells me that the SSL connection had been established successfully, and that he was actually seeing a HTTP error

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-02 Thread Martin v. Löwis
> So, that leaves me wondering, why is Tkinter still getting so much > focus in the Python standard library? > > Maybe a better question is, how has Tk managed to keep beating up the > newer, more modern, more featureful, better documented toolkits > encroaching on his territory? What's Tk's secre

Re: Python and SSL

2007-10-02 Thread Martin v. Löwis
> a certificate that is signed by OpenSSL's own CA( certification > authority), that is not recognized in the program's list of root CAs, > causes an exception to be raised. What is "the program"? What programming language is it written in? What library does it use to maintain a list of root CAs,

Re: Python and SSL

2007-10-03 Thread Martin v. Löwis
> It looks like this > > MyPythonProgram --->Proxy>Server > The proxy is written in Java. I want to use that proxy to see what my > Python program sends to server. > The proxy uses its own certificate and this certificate must be > trusted, I think, otherwise I receive an error. What error d

Re: Python and SSL

2007-10-03 Thread Martin v. Löwis
> After I added certification, that the proxy uses, among those > Trusted Root Certification Authorities list,as > Gabriel described on Windows, > > I receive > sslerror: (1, 'error:140770FC:SSL > routines:SSL23_GET_SERVER_HELLO:unknown protocol') > > > What does it mean? Technically, it means

Re: toprettyxml messes up with whitespaces

2007-10-03 Thread Martin v. Löwis
> > Such white space is typically not intended for inclusion in the > delivered version of the document. On the other hand, "significant" > white space that should be preserved in the delivered version is > common, for example in poetry and source code. > > > I interpret "significant" whitespace

Re: Off Topic: Gmail hates newsgroups!!!

2007-10-08 Thread Andrii V. Mishkovskyi
2007/10/4, Robert Dailey <[EMAIL PROTECTED]>: > I don't know how many other people subscribe to the python mailing list and > use the mailing list using the web-based interface for Gmail, but I do. I > use it mainly because Gmail doesn't support IMAP and I use my email from > multiple locations. Gm

Re: Python SVN down?

2007-10-11 Thread Martin v. Löwis
> Are all the real ( ;-) ) developers using ssh+svn and not noticing > this? As Terry said, some noticed. But yes, many use svn+ssh, plus we live in different time zones, so we may be asleep when it breaks. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: unicodedata implementation - categories

2007-10-14 Thread Martin v. Löwis
> 1) Why doesn't the category method raise an Exception, like the name method > does? As Chris explains, the result category means "Other, Not Assigned". Python returns this category because it's the truth: for those characters, the value of the "category" property really *is* Cn; it means that th

Re: Build Python 2.5 against Tk 8.5

2007-10-16 Thread Martin v. Löwis
> I'd like to experiment with Tk 8.5 (now in beta) in my Python > application, but Python 2.5 requires Tk 8.4.x. Why do you say that? AFAIK, that's not the case. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Build Python 2.5 against Tk 8.5

2007-10-16 Thread Martin v. Löwis
> It's been a while, but when I've tried to run my Tkinter app against Tk > 8.5 with a stock Python installation, I get an error message saying that > Tk 8.4.x is required. Can you please clarify what you mean by "stock Python installation"? I just built Python 2.5.1 with Tk 8.5 on Debian unstabl

Re: C++ version of the C Python API?

2007-10-21 Thread Martin v. Löwis
> Is there a C++ version of the C Python API packaged with python 2.5? Stargaming has already mentioned the fine points; the first answer is: yes, the API packaged python 2.5 can be used with C++. It is a C++ version of the same API as it adds proper extern "C" declarations around all prototypes,

Re: C++ version of the C Python API?

2007-10-21 Thread Martin v. Löwis
> Well C++ implicitly includes OOP since that is the foundation of the > language. I was more or less asking if there was an object oriented > version of the Python embedded API or perhaps an OO wrapper. However > it doesn't seem that way, so I may have to make my own. I think you are misinterpret

Re: C++ version of the C Python API?

2007-10-21 Thread Martin v. Löwis
> Could you emphasize a little more? I haven't worked much at all with > the Python C API, so I may be misunderstanding. First of all, you say > that the "Python C API is object oriented", which is contradictory > because it should read "Python C++ API is object oriented". Perhaps > this is a typo,

Re: C++ version of the C Python API?

2007-10-22 Thread Martin v. Löwis
> This preference, in > turn, is what motivated my original question. The CPython API > interface itself seems modularized, NOT object oriented (only from > what I saw). I suggest you look again, then. Things like PyObject_String, PyObject_GetAttrString, or PySequence_GetItem all express the obje

Re: Building sparc64 32/64-bit Python

2007-10-22 Thread Martin v. Löwis
> Is this possible or do I really have to install two complete but > separate Pythons although most of the files are the same? That configuration is not explicitly supported in the build process. Notice that the "Python libraries" are not entirely platform independent. On Sparc64, the byte code f

Re: japanese encoding iso-2022-jp in python vs. perl

2007-10-23 Thread Martin v. Löwis
> var = var.encode("iso-2022-jp", "replace") > print var [...] > ↓東京メトロ日比谷線・北千住行 > > So, what's the deal? Why can't python properly encode some of these > characters? It's not clear. As Ryan says, it works just fine (and so it does for me with Python 2.4.4 on Debian). What Python version are

Re: Root element name not declared

2007-10-23 Thread Martin v. Löwis
> > > > [...] > > , [...] > Being both the file and the dtd provided by the supplier, I believe > they're correct so I don't understand what's wrong. MyMessage IS > declared... isn't it sufficient? No. MyMessage is declared above as a Parameter Entity (PE), not as an element. Look for defi

Re: Python on Intel A110?

2007-10-23 Thread Martin v. Löwis
> Will the "stock" Windows version of Python install on a Samsung Q1U-EL > UMPC running Vista and with an Intel A110 processor? Certainly. This is an Pentium M class processor; the Python binaries will run on any Pentium-or-better processor (probably actually 486-or-better). Regards, Martin --

Re: strange transliteration in win32com.client

2007-10-23 Thread Martin v. Löwis
ts out a string in its "repr", it always uses the source code notation to print it back. So if you want to have a single backslash in a string, you have to put two backslashes into the source code. > When I call it with data_source = 'V:\risk oversight\myassessdb.mdb', >

Re: Test for a unicode string

2007-10-24 Thread Martin v. Löwis
> I have a regular expression test in a script. When a unicode character > get tested in the regex it gives an error: > > UnicodeError: ASCII decoding error: ordinal not in range(128) > > Question: Is there a way to test a string for unicode chars (ie. test > if a string will throw the error cite

Re: Unicode raw string containing \u

2007-10-28 Thread Martin v. Löwis
> That doesn't answer my question, since I asked for a unicode RAW > string literal. Is this not possible? (I was able to get what I want > using ur"\u005Cuniverse", although this is not totally ideal.) It's a design flaw in Unicode raw string literals that they still interpret \u escape

Re: simple question on dictionary usage

2007-10-28 Thread Martin v. Löwis
le > to a neophyte to python. My recommendation: forget about the comprehension-based ones. It *is* Pythonic to have the code readable to a neophyte; there is no price to win for shortness or cuteness. >> egt = dict((k, v) for k, v in record.iteritems() if k.startswith('E')) > >

Re: Is the subprocess module thread-safe?

2007-10-28 Thread Martin v. Löwis
>Can the subprocess module be used to launch subprocesses from threads? The answer to this question ("can") is a clear yes. Notice that this question is different from the question in the subject. > Or does the subprocess module affect the entire process context, like > "fork"? On POSIX syst

Re: _tkinter installation in python 2.5 on mandriva with a default 2.4

2007-10-30 Thread Martin v. Löwis
> Should I need to download a later version of tkinter and/or should I > alter setup.py in my python install directory and then remake? Neither, nor. You need the Tk header files installed; they probably come in a package called libtk8.4-dev or some such in your system. If they are present when se

Re: why did these companies choose Tcl over Python

2007-10-30 Thread Martin v. Löwis
> I would prefer to use Python but can't deny how popular Tcl is, as > mentioned above, so my question is why wasn't Python selected by > these companies as the choice of scripting languages for their > product? I think this question needs to be answered on a case-by-case basis, but my guess is

Fwd: Namespace question

2007-10-31 Thread Andrii V. Mishkovskyi
2007/10/31, Frank Aune <[EMAIL PROTECTED]>: > Hello, > > Is it possible writing custom modules named the same as modules in the > standard library, which in turn use the same module from the standard > library? > > Say I want my application to have a random.py module, which in turn must > import th

Re: _tkinter installation in python 2.5 on mandriva with a default 2.4

2007-10-31 Thread Martin v. Löwis
> however make still complains of the non existance of the the Tcl/Tk > libs and/or headers So where it tk.h located? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: shouldn't 'string'.find('ugh') return 0, not -1 ?

2007-10-31 Thread Andrii V. Mishkovskyi
2007/10/31, jelle <[EMAIL PROTECTED]>: > the subject pretty much says it all. > if I check a string for for a substring, and this substring isn't found, > should't the .find method return 0 rather than -1? > this breaks the > > if check.find('something'): > do(somethingElse) > > idiom, which is

Re: Python bug tracker now secret?

2007-10-31 Thread Martin v. Löwis
> I don't know why they chose to make the sf tracker private. Maybe that > was the only way to remove write access. That, plus removing it means that people won't browse outdated information. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python bug tracker now secret?

2007-10-31 Thread Martin v. Löwis
> There are bug reports in the SourceForge tracker that aren't in the > "bugs.python.org" tracker, so that move was botched. Which one in particular? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: _tkinter installation in python 2.5 on mandriva with a default 2.4

2007-10-31 Thread Martin v. Löwis
> tk.h is now in just about every directory called include that could in > anyway be connected with this and indeed it does appear in the make > file printout: > > /usr/bin/install -c -m 644 ./Include/tk.h /usr/local/include/python2.5 How did you get tk.h into the Include directory? You shouldn't

Re: Python bug tracker now secret?

2007-10-31 Thread Martin v. Löwis
> Though it also means all old links are broken and there's no obvious > pointer to the new information. Not all of them, no. For a long time, people could use links of the form www.python.org/sf/, and these links continue to work. Most other links on www.python.org have been fixed. I believe mos

Re: _tkinter installation in python 2.5 on mandriva with a default 2.4

2007-10-31 Thread Martin v. Löwis
> Those TK libraries tcllib=None tklib=None tcl_includes=None > tk_includes=None This also contradicts your earlier statement that you have libtk8.4.so on your machine. > I don't understand why the headers report None as the file tk.h is > in /usr/include ... or is the lack of the word gener

Re: _tkinter installation in python 2.5 on mandriva with a default 2.4

2007-10-31 Thread Martin v. Löwis
> but no tcllib !!! > perhaps that's the problem? Did I assume that it was installed by the > tk mandriva module ? I see. I would have never guessed that you can manage to install Tk but not Tcl on Mandriva... Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils and ctypes

2007-01-09 Thread Martin v. Löwis
Robert Kern schrieb: > To which I say that doing the type-checking and error handling is much easier > in > Python than using the C API. Add to that the tediousness of the > edit-compile-run > cycle of C and the finickiness of refcounting. Sure: edit-compile-run is tedious, but in the given case

Re: dynamic library loading, missing symbols

2007-01-09 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > However, the linker fails at runtime here because it can't > find this symbol. The variable in question does exist in the C++ code > that in does dlopen. Did you verify, using nm -D, that the symbol is indeed present in the shared object, not just in the source code?

Re: dynamic library loading, missing symbols

2007-01-10 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > I suppose this means that any subsequent libraries dlopened will not > see any of the symbols in my module? That's correct, and intentional. Python has crashed in the past when symbols conflicted across shared libraries. > I guess I'll have to look through the Python

Re: Python 2.5 install on Gentoo Linux: failed dmb and _tkinter

2007-01-10 Thread Martin v. Löwis
Sorin Schwimmer schrieb: > *** WARNING: renaming "_tkinter" since importing it > failed: libtk8.4.so: cannot open shared object file: > No such file or directory > running build_scripts > > I have libtk: > > # ls -l /usr/local/lib/libtk8.4.so > -r-xr-xr-x 1 root root 906285 Jan 10 16:08 > /usr/lo

Re: Python 2.5 install on Gentoo Linux: failed dmb and _tkinter

2007-01-12 Thread Martin v. Löwis
Sorin Schwimmer schrieb: >> Did you add /usr/local/lib to /etc/ld.so.conf? > > It's there It is it also listed with "ldconfig -p"? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: XLM prolgoue

2007-01-17 Thread Martin v. Löwis
fscked schrieb: > How do I go about creating the XML prologue like I want it to be? print " % (version, encoding) Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory Management in Embedded Python

2007-01-18 Thread Martin v. Löwis
Huayang Xia schrieb: > I have a piece of code like this: > > void funct(PyObject* pyobj) > { > char str[128]; > strncpy(str, "just a test string", sizeof(str)); > PyObject* pydata = PyObject_CallMethod(pyobj, "method_x", > "s", str); > Py_DECREF(py

Re: PQueue and Python 2.5

2007-01-20 Thread Martin v. Löwis
Berteun Damman schrieb: > I haven't got a clue how to investigate this, but I would be willing to > help if someone has any ideas. There are a number of problems in this code; the most significant one is the incorrect usage of memory management API. In pqueue_dealloc, the call PyMem_DEL(pqp) shoul

Re: A solution to the MSVCRT vs MSVCR71 problem?

2007-01-20 Thread Martin v. Löwis
sturlamolden schrieb: > Problem 2: You want to distribute a program created Py2Exe, but has no > license for Visual Studio 2003. You are therefore not allowed to > redistribute msvcrt71.dll. But without this DLL your program will not > work. As a side note: Visual Studio 2003 is out of sale, so if

Re: A solution to the MSVCRT vs MSVCR71 problem?

2007-01-21 Thread Martin v. Löwis
Gabriel Genellina schrieb: > This would only work, if runtime dll's were compatibles between them, > and they are not. You can't blindly redirect a call to msvcr71.__xyz to > msvcr80.__xyz and expect that to work magically - it may have a > different number of arguments, or different types, or even

Re: A solution to the MSVCRT vs MSVCR71 problem?

2007-01-21 Thread Martin v. Löwis
Gabriel Genellina schrieb: > That's a good thing - but is this just by accident, or is documented > somewhere? It's documented somewhere (although I can't find the documentation right now - it explains how you can link object files from a static library compiled with an older compiler version agai

Re: A solution to the MSVCRT vs MSVCR71 problem?

2007-01-21 Thread Martin v. Löwis
sturlamolden schrieb: >> This would only work, if runtime dll's were compatibles between them, >> and they are not. > > It is standard C, defined by ANSI and ISO. ANSI and ISO don't define the ABI, though. For example, the definition of the FILE type might (and does) vary across compilers, even

Re: mmap caching

2007-01-21 Thread Martin v. Löwis
George Sakkis schrieb: > I've been trying to track down a memory leak (which I initially > attributed erroneously to numpy) and it turns out to be caused by a > memory mapped file. It seems that mmap caches without limit the chunks > it reads, as the memory usage grows to several hundreds MBs accor

Re: mmap caching

2007-01-21 Thread Martin v. Löwis
George Sakkis schrieb: >> You must be misinterpreting what you are seeing. It's the operating >> system that decides what part of a memory-mapped file are held in >> memory, and that is certainly not without limits. > > Sure; what I meant was that that whatever the limit is, it's high > enough tha

Re: mmap caching

2007-01-22 Thread Martin v. Löwis
Laszlo Nagy schrieb: > >> In fact, memory that is read in because of mmap should *never* cause >> a MemoryError. > This is certainly not true. You can run out of virtual address space by > reading data from a memory mapped file. That is true, but not what I said. I said you cannot run out of mem

Re: mmap caching

2007-01-22 Thread Martin v. Löwis
Nick Craig-Wood schrieb: > So presumably it is python generating a MemoryError. It is asking for > a new bit of memory and it is failing so it throws a MemoryError. > > Could memory allocation under windows be affected by a large chunk of > mmap()ed file which is physically swapped in at the time

Re: Building extensions with vc8

2007-01-22 Thread Martin v. Löwis
Howard Lightstone schrieb: > Has there been any progress on being able to build extensions with MSVC8 > (aka Visual Studio 2005)? No. No progress will happen throughout the release of Python 2.5. To get the facts straight: it *might* be possible to build an extension with msvc8 (thus linking with

Re: What's the reverse of Py_BuildValue("u#" ?

2007-01-23 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > How could I get the pointer to and the length of ucs2 array out of a > PyObject representing a string? Something that works whether PyObject > string is in unicode or not. You can use PyObject_Unicode(o) to convert the object to Unicode first, then use PyUnicode_AsUni

Re: raise UnicodeError, "label too long"

2007-01-24 Thread Martin v. Löwis
Flavio schrieb: > What I am doing is very simple: > > I fetch an url (html page) parse it using BeautifulSoup, extract the > links and try to open each of the links, repeating the cycle. > > Beautiful soup converts the html to unicode. That's why when I try to > open the links extracted from the

Re: raise UnicodeError, "label too long"

2007-01-24 Thread Martin v. Löwis
Flavio schrieb: > something like this, for instance: > http://.wikipedia.org/wiki/Copper%28II%29_hydroxide > > but even url with any non-ascii characters such as this > > http://.wikipedia.org/wiki/Ammonia > > also fail when passed to urlopen : > File "/usr/lib/python2.4/encodings/idna.py", line

Re: New vs Old Style Python Classes in C Extensions?

2007-01-27 Thread Martin v. Löwis
Jeff Rush schrieb: > from cextension import Context > > class MyContext(Context): > > def __init__(self): > super(Context, self).__init__() > > repeatedly and reliably failed with a corrupted C data structure, while > this: > > class MyContext(Context): > > def __init__(self):

Re: Trouble with max() and __cmp__()

2007-01-28 Thread Martin v. Löwis
Thomas Nelson schrieb: > On Jan 28, 3:13 pm, Wojciech Muła > <[EMAIL PROTECTED]> wrote: >> Define method __gt__. > > This works, thanks. I was a little surprised though. is __cmp__ used > by any builtin functions? It is used by max() if the object doesn't implement __gt__. Regards, Martin --

Re: Convert from unicode chars to HTML entities

2007-01-29 Thread Martin v. Löwis
Steven D'Aprano schrieb: > A few issues: > > (1) It doesn't seem to be reversible: > '© and many more...'.decode('latin-1') > u'© and many more...' > > What should I do instead? For reverse processing, you need to parse it with an SGML/XML parser. > (2) Are XML entities guaranteed to be t

Re: python 2.3 module ref

2007-01-29 Thread Martin v. Löwis
David Bear schrieb: > Since redhat packages python2.3 with their distro (RHEL 4..) I was looking > for a module reference for that version. Looking at python.org I only see > current documentation. > > any pointers to a 2.3 module ref? http://www.python.org/doc/2.3/ http://www.python.org/doc/2.3/

Re: Compiling extension with Visual C++ Toolkit Compiler - MSVCR80.dll

2007-01-29 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > The library seems to build correctly (producing Polygon.py and > cPolygon.pyd), but when I import it I get the following message from > python.exe: "This application has failed to start because MSVCR80.dll > was not found". I thought that this might be due to Python

Re: Unicode error handler

2007-01-30 Thread Martin v. Löwis
Walter Dörwald schrieb: > You might try the following: > > # -*- coding: iso-8859-1 -*- > > import unicodedata, codecs > > def transliterate(exc): > if not isinstance(exc, UnicodeEncodeError): > raise TypeError("don'ty know how to handle %r" % r) > return (unicodedata.n

Checking default arguments

2007-02-02 Thread Igor V. Rafienko
Hi, I was wondering whether it was possible to find out which parameter value is being used: the default argument or the user-supplied one. That is: def foo(x, y="bar"): # how to figure out whether the value of y is # the default argument, or user-supplied? foo(1, "bar") => user-sup

Re: Build Python 2.5 wit VC6.0 ?

2007-02-03 Thread Martin v. Löwis
Alexander Eisenhuth schrieb: > does somebody have experience in building with VC6.0. On my first try > there where missing C-Modules. Is that true. VC6.0 is not supported? It is supported, but not actively maintained. Contributions are welcome. Try the 2.5 maintenance branch first, though; it may

Re: Checking default arguments

2007-02-05 Thread Igor V. Rafienko
[ George Sakkis ] First of all, thanks to everyone who replied. [ ... ] > I don't know why you might want to distinguish between the two in > practice (the unique object idea mentioned in other posts should > handle most uses cases), but if you insist, here's one way to do it: There is no act

Re: when will python 2.5 take in mainstream?

2007-02-22 Thread Martin v. Löwis
> Its simple to require changes, not so sure that doing these > modifications keep things simple. Maybe an internal Python hacker can > give us his advice on such a modification (ie. staying compatible with > legacy modules compiled for previous versions). I think it should be possible to specify

Re: when will python 2.5 take in mainstream?

2007-02-22 Thread Martin v. Löwis
Paul Rubin schrieb: > Laurent Pointal <[EMAIL PROTECTED]> writes: >> IMHO trying to have a binary compatibility with older compiled modules >> by maintaining an ad-hoc layer to switch between 2.4/2.5 engines make >> Python code more complex. And more complex code have generally more >> bugs. This i

Re: unicodedata implementation

2007-02-22 Thread Martin v. Löwis
James Abley schrieb: > So from my understanding of the Unicode (3.2.0) spec, the code point > 0x325F has a numeric property with a value of 35, but the python (2.3 > and 2.4 - I haven't put 2.5 onto my box yet) implementation of > unicodedata disagrees, presumably for good reason. > > I can't see

Re: Possible to set cpython heap size?

2007-02-22 Thread Martin v. Löwis
Andy Watson schrieb: > I have an application that scans and processes a bunch of text files. > The content I'm pulling out and holding in memory is at least 200MB. > > I'd love to be able to tell the CPython virtual machine that I need a > heap of, say 300MB up front rather than have it grow as ne

Re: Finding non ascii characters in a set of files

2007-02-23 Thread Martin v. Löwis
Tim Arnold schrieb: > That looks much cleaner. I didn't know the 'num' from the enumerate would > persist so the except block could report it. It's indeed guaranteed that the for loop index variables will keep the value they had when the loop stopped (either through regular termination, break, or

Re: convert strings to utf-8

2007-02-25 Thread Martin v. Löwis
Niclas schrieb: > I'm having trouble to work with the special charcters in swedish (Å Ä Ö > å ä ö). The script is parsing and extracting information from a webpage. > This works fine and I get all the data correctly. The information is > then added to a rss file (using xml.dom.minidom.Document() to

Re: Pep 3105: the end of print?

2007-02-26 Thread Martin v. Löwis
Edward K Ream schrieb: > In other words, the consequence of pep 3105 will be that *nobody* who wants > their app to be portable will be able to use print until *everybody* has > converted to Python 3.x. I doubt that is what Guido had in mind, but I may > be mistaken :-) That's not true. Many

Re: Pep 3105: the end of print?

2007-02-26 Thread Martin v. Löwis
Neil Cerutti schrieb: > On 2007-02-23, I V <[EMAIL PROTECTED]> wrote: >> While that's true, C++ compiler vendors, for example, take >> backwards compatibility significantly less seriously, it seems >> to me. > > Compiler vendors usually take care of their c

Re: bsddb in python 2.5.1

2007-11-04 Thread Martin v. Löwis
> I know that when you upgrade Berkeley DB you're supposed to go through > steps solving this problem,but I wasn't expecting an upgrade. I've > tried to use different versions bsddb3, 4.4 and 4.5, (instead of bsddb > that comes with python 2.5.1) with different versions of Berkeley DB > installs (4

Re: bsddb in python 2.5.1

2007-11-04 Thread Martin v. Löwis
> I have two versions of bsddb3 installed (only one is active) this is > from /usr/lib/python2.5/site-packages: > drwxr-xr-x 3 root root 4096 2007-11-03 15:01 bsddb3 > -rw-r--r-- 1 root root905 2007-11-03 15:39 bsddb3-4.4.2.egg-info > -rw-r--r-- 1 root root905 2007-11-03 15:49 bsddb3-4

Re: How do I get the PC's Processor speed?

2007-11-06 Thread Martin v. Löwis
> Is this a WMI function or a PyWin32 function? I guess I'm not seeing > how to actually implement this in Python. Sounds intriguing though. Neither, nor. It's a Win32 function, period (not Py). You would have to use ctypes or some such to call it. See http://msdn2.microsoft.com/en-us/library/ms

Re: How do I get the PC's Processor speed?

2007-11-06 Thread Martin v. Löwis
> On the problem PCs, both of these methods give me the same information > (i.e. only the processor name). However, if I go to "System > Properties" and look at the "General" tab, it lists the CPU name and > processor speed. Does anyone else know of another way to get at this > information? I'm no

Re: Old version of sqlite3

2007-11-08 Thread Martin v. Löwis
> Any suggestions for a workaround? You could silence the warning, using the warnings module. Alternatively, I think you should be able to replace sqlite3.dll with a newer version. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Linking debug C++ DLL with python dlls

2007-11-08 Thread Martin v. Lo
> So I decided to download and build the debug version of python2.5.1/ > As it seems I also need to compile all relevant extension modules > (*.pyd) in debug as well - is this correct? That's correct. > I tried to change the code above (just for fun) so in both cases i'll > use python25.lib and i

Re: Creating installer with external extension modules

2007-11-09 Thread Martin v. Löwis
> Does anyone have any suggestions on the best way to approach this? For the Mac, I recommend to provide precompiled binaries to your users, rather than requiring them to download various source packages, to run your build-it-all script afterwards. To distribute a package on the Mac, you could st

Re: Binary search tree

2007-11-12 Thread Martin v. Löwis
> Now, I can see that this method has some superfluous data (the `1` > that is assigned to the dict). So I suppose this is less memory > efficient. But is this slower then? As both implementations use hashes > of the URL to access the data. Just asking out of curiosity ;) Performance-wise, there i

Re: A JEW hacker in California admits distributing malware that let him steal usernames and passwords for Paypal accounts.

2007-11-13 Thread Andrii V. Mishkovskyi
2007/11/14, ChairmanOfTheBored <[EMAIL PROTECTED]>: > On Tue, 13 Nov 2007 16:18:58 +0100, Richard G Riley > <[EMAIL PROTECTED]> wrote: > > >Your ascii art, while pretty, convinces no one ... > > > It's pretty goddamned retarded, actually... as was the post itself. > -- > http://mail.python.org/mai

Re: cross-platform c questions

2007-11-14 Thread Martin v. Löwis
> When writing a python c extension for needs to be compiled for > Windows, Linux, and the Mac, > what cross-platform differences need to be accounted for?# >From a Python point of view, it's primarily the difference in the size of types. For example, long may vary across platforms, and so chan

Re: Trouble building pywin32 with Visual Studio 2005

2007-11-14 Thread Martin v. Löwis
> Now, my theory on this issue is that DLLs like win32api.pyd, which I > acquired pre-built, were built with Visual Studio 2003, and they > depend on msvcr71.dll. My Python/MFC application, on the other hand, > was built with Visual Studio 2005, and is linking with msvcr80.dll. If > memory gets all

Re: Building python packages for the correct architecture on OSX 10.5

2007-11-14 Thread Martin v. Löwis
> This means the modules need to be compiles for at least both i386 and > x86_64 in my case. Building Python in 64-bit mode as a universal (fat) binary is not supported in Python 2.5, period. So any solution you come necessarily has to be a work-around. The only solution I can see is to make a pl

Re: daemon under windows

2007-11-14 Thread Martin v. Löwis
> I wrote a simple UNIX daemon (using 2 forks) which does a simple job: it > executes a function, waits for some time, and then executes it again. Now > I'd like to port that to Windows. How do I create daemon on Windows (since > I can't use fork)? On Windows, you develop "services". They are u

Re: Building python packages for the correct architecture on OSX 10.5

2007-11-14 Thread Martin v. Löwis
>> a) even if your extension module becomes x86_64 with that mechanism, >>the Python interpreter itself (i.e. the Python framework) will be >>purely 32-bit code. So it should not link correctly. > > My machine disagrees: I see. I guess Apple has implemented that somehow; the official Pyth

Re: Trouble building pywin32 with Visual Studio 2005

2007-11-14 Thread Martin v. Löwis
> Either I misunderstand, or you do. If it wasn't clear, I have already > rebuilt Python using Visual Studio 2005. I see. I must have misunderstood then - if you already rebuilt Python itself, all is fine. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: cross-platform c questions

2007-11-14 Thread Martin v. Löwis
> Is there any rules/criteria to decide when to use Py_ssize_t, int, or > long? I've seen them somewhat mixed and don't know when exactly to use > Py_ssize_t. You should use Py_ssize_t when you are counting things, and when there is no small limit (e.g. 66536) to the maximum number of things you c

Re: keyword parameter order

2007-11-18 Thread Martin v. Löwis
> I am not sure if this kind of info is available internally to the > interpreter (ordereddict is in C, so I would even prefer that). Has > anyone done this or anything like it? It's not available. See ceval.c:do_call; this fills the dictionary. >From then on, information about the order of keywor

Re: compiling python 2.5, missing zlib

2007-11-19 Thread Martin v. Löwis
> Neither seems to work. What am I missing here? You forgot to install the zlib header files, which come in an RPM provided by Redhat (probably called zlib-dev or some such). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Is python.org blocking traffic from the ibm.com domain?

2007-11-19 Thread Martin v. Löwis
> IBM internal network security confirms that they are not blocking > access to these sites, so we are guessing that the websites themselves > are choosing not to respond, perhaps thinking that the volume of > traffic from the ibm.com domain is spam or DOS attack. > > Can someone responsible for m

Re: compiling python 2.5, missing zlib

2007-11-19 Thread Martin v. Löwis
> Those headers are already installed, according to "up2date". Is there > a way to specify the header files used? It will automatically use them if they are good. What's the value of ZLIB_VERSION in /usr/include/zlib.h? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Windows installation

2007-11-22 Thread Martin v. Löwis
> does anyone know how I can automate installation of the Windows Python > distribution, using python1.5.1.msi ? See http://www.python.org/download/releases/2.5/ then follow the link "automated installation" to http://www.python.org/download/releases/2.5/msi/#automated > I want to be able to r

<    9   10   11   12   13   14   15   16   17   18   >