Re: Python in Chinese

2007-08-13 Thread Martin v. Löwis
Paul McGuire schrieb: > Back in May, there was quite an extensive discussion of whether or not > Python should support Unicode identifiers (with the final result being > that this would be supported in Python 3). In my periodic googling > for pyparsing users, I stumbled upon Zhpy, a preprocessor t

Re: IDLE path browser not recognizing my PYTHONPATH

2007-08-14 Thread Martin v. Löwis
> I set PYTHONPATH to /home/me/bin in bash.bashrc, however the IDLE path > browser is not recognizing this. Not sure why. > > Grateful for any insight. The file "bash.bashrc" has no relevance. If you meant to set the variable every time you start bash, put it into ".bashrc", in your home directo

Re: Layer 2 socket connection

2007-08-15 Thread Martin v. Löwis
> I'm looking at trying to write a python script to connect to a layer 2 > bridge (no IP available). > > Looking at the sockets function, it's not clear if I can connect using > only the mac address - it appears to want either a broadcast address > or a specific IP address. > > Can anyone give me

Re: threads, mutual exclusion, and lists

2007-08-15 Thread Martin v. Löwis
> I have two threads that share a python list. One thread adds to the > list with append(), the other thread removes items with pop(). > > My question is -- are python list operations atomic? Yes, they are in the current implementation of CPython (all versions). Notice that not *all* operations a

Re: threads, mutual exclusion, and lists

2007-08-16 Thread Martin v. Löwis
>> My question is -- are python list operations atomic? If they are not, >> then I assume I need to put some mutual exclusion around the append() >> and pop() calls ? > > They are not, but there is one included in the standard library: > http://docs.python.org/dev/lib/module-Queue.html Why do you

Re: threads, mutual exclusion, and lists

2007-08-16 Thread Martin v. Löwis
>> Why do you think they are not? > > Because they aren't. You even mentioned that a few operations that > aren't atomic. OTOH, the OP specifically asked for .append() and .pop(), which are atomic. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes and C99 complex numbers

2007-08-16 Thread Martin v. Löwis
Thomas Heller schrieb: > Eugen Wintersberger schrieb: >> Hi there >> I want to use ctypes in connection with C functions that use complex >> datatypes defined in the C99 standard. Does someone know a simple way >> how to implement this? Are there any plans to integrate the C99 complex >> data type

Re: Python 2.51 install on Vista "files in use"

2007-08-21 Thread Martin v. Löwis
Steve Mavronis schrieb: > I tried to install Python 2.51 on Microsoft Vista Ultimate 32-bit > because I use the 3D modeler software Blender 2.44, in case I needed > additional Python support in the future for add-on scripts. > > I got a warning about "files in use" during installation that needed

Re: MsiLib

2007-08-22 Thread Martin v. Löwis
> I am trying to figure out how to use msilib to extract the registry > information from an MSI file and I really could use a good example of > how that is accomplished or even just an example using msilib in > general. Does anybody happen to know of an example for this as I wasn't > able to find o

Re: MsiLib

2007-08-22 Thread Martin v. Löwis
Charlie schrieb: > Thanks for pointing that out. It solved the one problem and along came > another. Now I get the following error when I try running it. Thanks for > the help. > > Traceback (most recent call last): > File "msi.py", line 7, in > record = view.Fetch() > _msi.MSIError: functi

Re: MsiLib

2007-08-22 Thread Martin v. Löwis
Charlie schrieb: > This doesn't seem to be my day for this. When I add view.Execute() to > the script, it gives me an error of Execute() takes exactly 1 argument > (0 given). I can't seem to find anything on the Microsoft page that > concerns the execute function that states what exactly needs to b

Re: MsiLib

2007-08-23 Thread Martin v. Löwis
Charlie schrieb: > Thank you everybody for your help. It finally runs without errors and I > should be able to use this as I figure out more of it. I am curios if > there is any idea as to when GetString will be implemented? If I can find the time, it may be for Python 2.6. If not, Python 2.7, 3.1

Re: MsiLib

2007-08-23 Thread Martin v. Löwis
> Thank you. I would be willing to help out, but as of now I have no idea > how to get started on it. If you would be willing to provide some > guidance, then I would be fine with giving it a shot if nothing more. My > guess is that it would have to implement the MsiRecordGetString function > so th

Re: sys.setdefaultencoding

2007-08-28 Thread Martin v. Löwis
> Is there a way to allow the process to specify that unicode-->str should > use 'utf8' rather than 'ascii' in all non-specific cases? No. Things might break if you change the default encoding to anything but ASCII, and more so if you do that "at runtime". For example, dictionaries with Unicode ke

Re: strange list comprehension on generator

2007-08-29 Thread Martin v. Löwis
> #this does not return the way I would expect. why? You yield the very same list object all the times. So when you make a later change, all earlier results will get changed, too (since they are the same object). Of course, it won't affect the terminal output, so you don't see that the older value

Re: gc.garbage

2007-08-30 Thread Martin v. Löwis
> gc.set_debug(gc.DEBUG_LEAK) > print gc.garbage > > --output:-- > [] > gc: uncollectable > gc: uncollectable > gc: uncollectable > gc: uncollectable gc.garbage is filled only after these messages are printed, not before. You need to add an explicit call to gc.collect() if you want to see wha

Re: How to find out if the interpreter is a debug build?

2007-08-31 Thread Martin v. Löwis
llothar schrieb: > How can i find out if a selected python interpreter (i only know the > path name under which i should start it) is a debug build? I tried > > sys.api_version, sys.platform, sys.version, sys.version_info > > and there is no difference between "python.exe" and "python_d.exe".

Re: How to find out if the interpreter is a debug build?

2007-09-01 Thread Martin v. Löwis
> It is a huge problem and weakness of python Would you like to contribute a patch? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: How to find out if the interpreter is a debug build?

2007-09-01 Thread Martin v. Löwis
> Would such a patch require a full blown PEP? No. > If i have to write a PEP i can better add it to the documentation of > my application and be sure that the problem is solved. I don't understand. Are you saying you would rather not write a PEP, and add something to the documentation of your a

Re: Why is this loop heavy code so slow in Python? Possible Project Euler spoilers

2007-09-02 Thread Martin v. Löwis
>> (2) it is a interpretation language > Not quite. It's compiled to byte-code - just like Java (would you call > Java an 'interpreted language' ?) Python is not implemented like Java. In Java (at least in HotSpot), the byte code is further compiled to machine code before execution; in Python, the

Re: py3k - format specifier for strings

2007-09-03 Thread Martin v. Löwis
a = "{0}".format(5.66) a > '5.66' > > There are more options in PEP 3101 (fill, alignment, etc.), but I'm having > trouble implementing them. It would be good if you could describe these troubles in more detail. What have you been trying, what happened, and what did you expect to happen

Re: FCGI app reloading on every request

2007-09-03 Thread Martin v. Löwis
John Nagle schrieb: >I'm converting a web app from CGI to FCGI. The application works fine > under FCGI, but it's being reloaded for every request, which makes FCGI > kind of pointless. I wrote a little FCGI app which prints when the > program is loaded and when it gets a request. And indeed

Re: Parse or Pass?

2007-09-04 Thread Martin v. Löwis
> In general, "parsing" is analyzing the grammatical structure of a > string. People sometimes talk loosely about "parsing the command line". > but I don't think that's normally applied to providing the actual > arguments (corresponding to the definition's "formal parameters") when a > function is

Re: FCGI app reloading on every request

2007-09-04 Thread Martin v. Löwis
>Anything executable in the > cgi-bin directory is being launched as a CGI program. A file > named "example.foo", if executable, will launch as a CGI program. > Nothing launches with FCGI. Perhaps you have a SetHandler declaration somewhere that makes all files CGI by default? I would advise

Re: Why zlib not included in Python tarball?

2007-09-10 Thread Martin v. Löwis
> I need to install my own Python. I compiled Python 2.4.4 from sources. zlib > did not compile - it's not in the lib-dynload directory. > > I did not have this problem with any of my earlier Python compiles. I > routinely compile Python from source. > > What is the correct procedure for insta

Re: Py2.5.1 on Ubuntu AMD X2, unicode problems

2007-09-11 Thread Martin v. Löwis
> I'm building 2.5.1 from source, using the ubuntu(7.0.4)-provided gcc > 4.1.2. Something must be terribly wrong with your system if you have to go through such hassles. It should build out of the box, and does for me on Debian. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-l

Re: Compiler Python

2007-09-11 Thread Martin v. Löwis
> Someone knows since as I can obtain the information detailed about the > compiler of Python? (Table of tokens, lists of productions of the > syntactic one , semantic restrictions...) The EBNF grammar is in Grammar/Grammar; this also implies the list of tokens. Another list of tokens in Include/t

Re: pwdmodule.c

2007-09-12 Thread Martin v. Löwis
> Is pwdmodule.c supposed to be excluded for windows compilation? Yes, it is - it gives access to /etc/passwd. See PCbuild/*.vcproj for what files get compiled on Windows. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel/Multiprocessing script design question

2007-09-12 Thread Martin v. Löwis
> I tend to ramble, and I am afraid none of you busy experts will bother > reading my long post I think that's a fairly accurate description, and prediction. > I am hoping people > with experience using any of these would chime in with tips. The main thing > I would look for in a toolkit is ma

Re: When will 2.5.1 be released?

2007-03-31 Thread Martin v. Löwis
>> And while we're waiting for 2.5.1, can somebody post a clear (as >> opposed to the one that comes with Tix ;)) explanation of how to >> manually install Tix into python 2.5? It should be possible... > > LLoyd > -Not possible - this is a known bug and won't be fixed until 2.5.1 This is not tru

Re: CRC CCITT UPDATE in Python

2007-03-31 Thread Martin v. Löwis
> Please, is there here some good soul that understand this > functions hi8 and lo8 (from GCC AVR) and can help me to port it to > Python? > > uint16_t > crc_ccitt_update (uint16_t crc, uint8_t data) > { >data ˆ= lo8 (crc); >data ˆ= data << 4; >return uint16_t)data << 8) | h

Re: Unicode list

2007-03-31 Thread Martin v. Löwis
> Like this, the program prints some characters as strange escape > sequences, which is due to the input file being encoded in utf-8: When I > convert "re.findall..." to a string and wrap an "unicode()" around it, > the matches get printed correctly. Is it possible to make "matches" > unicode w

Re: tag replacement in toxml()

2007-04-01 Thread Martin v. Löwis
> import xml.dom.minidom > from xml.dom.minidom import getDOMImplementation > impl = getDOMImplementation() > myDoc = impl.createDocument(None, "example", None) > myRoot = myDoc.documentElement > myNode1 = myDoc.createElement("node") > myNode2 = myDoc.createElement("nodeTwo") > myText = myDoc.crea

Re: curses module

2007-04-02 Thread Martin v. Löwis
Kenneth McDonald schrieb: > I know that the curses module has a long-standing bug wherein cursor > visibility can't be set. > > This isn't criticism, I just know that the curses module is the sort of > thing that probably isn't being maintained consistently, and I for one, > have no idea how well

Re: Problem installing Python 2.5

2007-04-04 Thread Martin v. Löwis
> After a lot of output, got this: You will need to check this output line-for-line to see why it fails. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: troubles building python 2.5 on Windows XP x64 Windows Server 2003 sp1 Platform SDK

2007-04-04 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > I am needing to build python 2.5 on Windows XP x64 Windows Server 2003 > sp1 Platform SDK and am not finding anything documented on the process > to use. Has anyone had any success with this? I did - I built the official binaries with it. > If so has anyone > document

Re: SWIG, Python, C++, and Coca-Cola

2007-04-07 Thread Martin v. Löwis
> Any clues as to what is happening here or what to do next? Apparently, it tries to wrap the main() function. It should not do that: main should not be callable from Python. Most likely, you have a declaration of main somewhere so it thinks it should wrap it. You should not have a declaration of

Re: Convert xml symbol notation

2007-04-07 Thread Martin v. Löwis
> I'm working on a script to download and parse a web page, and it > includes xml symbol notation, such as ' for the ' character. Does > anyone know of a pre-existing python script/lib to convert the xml > notation back to the actual symbol it represents? If you have this given in an XML file (ra

Re: Understanding Python's interpreter

2007-04-07 Thread Martin v. Löwis
>> Why harder? Once you read the file, they're just numbers. Anyway, being >> harder to program the *interpreter* is not a problem, if you gain >> something like speed or eficiency for the interpreted language. > > Well, it's harder to get 4 bytes and create an int out of it in a > portable way

Re: Custom Python Runtime

2007-04-07 Thread Martin v. Löwis
> Is there a way to customize the Windows build? In my case, there is no need > to build an installer. The best way is to have everything in a directory, as > long as I know where to find Python and Python knows where to find the > necessary libs. Any online docs describing this? Thanks! The i

Re: Convert xml symbol notation

2007-04-07 Thread Martin v. Löwis
>> I'm working on a script to download and parse a web page, and it >> includes xml symbol notation, such as ' for the ' character. Does >> anyone know of a pre-existing python script/lib to convert the xml >> notation back to the actual symbol it represents? > > Try the htmlentitydefs module. T

Re: 1 Thread = 3 interpreter launched ???

2007-04-07 Thread Martin v. Löwis
> When creating the thread, Python forks 2 times and thus consume me > around 60% of RAM ! > It's very critical, am i missed something ? In case Diez's answer isn't clear: you misinterpret the data you see. That each process is listed with 4172kB memory doesn't mean they consume 12000kB together.

Re: Custom Python Runtime

2007-04-07 Thread Martin v. Löwis
> Is this information somewhere on python.org? This is at least an > occasional question here. Part of it. The way Python finds its landmark is in the sources (so it is on svn.python.org/projects/python/trunk/PC/getpathp.c); the minimum set of modules is nowhere documented (and will certainly ch

Re: Unicode problem

2007-04-08 Thread Martin v. Löwis
> Thanks! That's a nice little stumbling block for a newbie like me ;) Is > there a way to make utf-8 the default encoding for every string, so that > I do not have to encode each string explicitly? You can make sys.stdout encode each string with UTF-8, with sys.stdout = codecs.getwriter('utf-8

Re: Unicode problem

2007-04-09 Thread Martin v. Löwis
> BTW, any reason why an EncodedFile can't act like a Unicode > writer/reader object > if one of its encodings is explicitly set to None? AFAIU, that's not the intention of EncodedFile: instead, it is meant to do recoding. I find it a pretty useless API, and rather see it go away than being enhanc

Re: Custom Python Runtime

2007-04-10 Thread Martin v. Löwis
Jack schrieb: > Thanks for all the replies. It would be great to have all customization > related information on one doc page. Please put it into a wiki page, at wiki.python.org > 1. One Windows, it's possible to zip all files in a Python24.zip. I'm not > very clear if it's used in the stardard d

Re: XML-RPC SSL and client side certs?

2007-04-11 Thread Martin v. Löwis
Jeff McNeil schrieb: > I apologize for not giving you a Python specific answer, but for the > XMLRPC services I've deployed, I front them with Apache and proxy back > to localhost:8080. > > I do all of the encryption and authentication from within the Apache > proper and rely on mod_proxy to forwa

Re: troubles building python 2.5 on Windows XP x64 Windows Server 2003 sp1 Platform SDK

2007-04-11 Thread Martin v. Löwis
> I guess I am a little confused on the directions for the vsextcomp. I > don't see an IDE for the vsextcomp. Do you know of any explicit > directions on how to do this build? Can you please explicitly say what step you did and at what precise step you failed? 0. Install VS 2003 1. Install vsextc

Re: help building debug .pyd files

2007-04-11 Thread Martin v. Löwis
> You should read the file PCBuild/readme.txt. > It explains how to build python from source, and has long explanations > about the same list of modules you are asking for. > > And it works: I regularly use the debug build of python for my own > projects. Also, as of Python 2.5, you don't have to

Re: odd unicode error

2007-04-12 Thread Martin v. Löwis
> path += '/' + b > UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 1: > ordinal not in range(128) > > Any ideas? path is a Unicode string, b is a byte string and contains the byte \xd0. The problem is that you have a directory with file names in it that cannot be conver

Re: Portably generating infinity and NaN

2007-04-12 Thread Martin v. Löwis
Michael Hoffman schrieb: > What's the best way to portably generate binary floating point infinity > and NaNs? I only know two solutions: > > 1. Using the fpconst module proposed in IEEE 754, which I believe shifts > bits around. > > 2. Using an extension module (for example, numarray.ieeespecial

Re: How to copy a file on Windows while preserving permissions

2007-04-12 Thread Martin v. Löwis
> Can someone who is more familiar than I with the vagaries of Windows file > protection and the Python interfaces available to it point me in a useful > direction? To copy a file along with its attributes, try SHFileOperation. Alternatively, if you have backup privileges, open the file for bac

Re: compiling modules with VS 2008 for python 2.4 prepared with Visual Studio 2003

2007-04-12 Thread Martin v. Löwis
> well, instructions were clear enough for me. What is hard to get why it > could not use free M$ compiler which is presumably produces compatible > objects and libraries. This presumption is incorrect. The compiler does *not* create compatible objects and libraries. It links with msvcr8.dll, wher

Re: Portably generating infinity and NaN

2007-04-13 Thread Martin v. Löwis
> (Note the absence of a demonstration on Windows.) Can't the above be > blessed as the One True Way and wormed around in floatmodule.c for those > platforms where float'ing "NaN" or "Inf" doesn't currently work? How would you do the worming-around? Regards, Martin -- http://mail.python.org/ma

Re: Portably generating infinity and NaN

2007-04-13 Thread Martin v. Löwis
> I don't know. On I was just asking. On unixoid systems I sort of assume > you could add tests to the configure script to detect what worked. If > converting the strings works you're done. If not, maybe Robert Kern's numpy > code could be run in the configure script to generate constants for N

Re: nonstandard XML character entities?

2007-04-14 Thread Martin v. Löwis
> I'm new to xml mongering so forgive me if there's an obvious > well-known answer to this. It's not real obvious from the library > documentation I've looked at so far. Basically I have to munch of a > bunch of xml files which contain character entities like ú > which are apparently nonstandard

Re: tuples, index method, Python's design

2007-04-14 Thread Martin v. Löwis
> The use case has already been discussed. Removing the pointless > inconsistency between lists and tuples means you can stop having to > remember it, so you can free up brain cells for implementing useful > things. That increases your programming productivity. So to increase consistency, the .i

Re: Python Feature Request: Explicit variable declarations

2007-04-14 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > Hello. Please tell me whether this feature request is sane (and not > done before) for python so it can be posted to the python-dev mailing > list. I should say first that I am not a professional programmer with > too much technical knowledge. I believe it has been req

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-14 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > This is like the previous one. Please check for sanity and approve for > posting at python-dev. This one is not sane. It's not possible to change the indexing of objects on a per-module basis, as objects may cross module boundaries. Suppose you have this code: option

Re: Python Feature Request: (?) Group all file-directory-related stdlib functions in one place

2007-04-14 Thread Martin v. Löwis
> Currently file-directory-related functionality in the Python standard > library is scattered among various modules such as shutil, os, > dircache etc. So I request that the functions be gathered and > consolidated at one place. Some may need renaming to avoid conflicts > or for clarification. >

Re: compiling modules with VS 2008 for python 2.4 prepared with Visual Studio 2003

2007-04-14 Thread Martin v. Löwis
> complier is just a compiler. perhaps final linking could be somehow > tweaked to include msvcrt71 instad of 80. Not easily. VS 2005 is not just a complier, it is also a rinkel, and ships with improt librareis. The import library for msvcrt.lib it ships with automatically links with msvcr8.dll.

Re: Python and SSL

2007-04-16 Thread Martin v. Löwis
> - I noticed that socket module provides an SSL class (socket.ssl) but > even if documentation reports that it does not do any certificate > verification a lot of stdlib modules (imaplib, poplib, smtplib, > httplib and urllib2) provides SSL extension classes wherein socket.ssl > is used. What does

Re: C++ extension problem

2007-04-16 Thread Martin v. Löwis
> Now this is what confuses me: Why does it say that I have the wrong > type when it's the same type as it suggests? When referring to the type, you must *always* form the address of the type structure, including, but not limited to, the line > if (!PyArg_ParseTuple(args, "O!", SillyStringTyp

Re: C++ extension problem

2007-04-17 Thread Martin v. Löwis
> I assumed that the compiler would warn me about that kind of problem, > but I know better know. :) It's a variable argument list (...). The compiler is not supposed to give any warnings for that (although I do have a gcc patch that enables warnings for PyArg_ParseTuple). > Still, the error mess

Re: unicode data - accessing codepoints > FFFF on narrow python builts

2007-04-18 Thread Martin v. Löwis
> Is it a bug in unicodedata, or is this the expected behaviour on a > narrow build? It's a bug. It should either raise an exception, or return the correct result. If you know feel like submitting a bug report: please try to come up with a patch instead. > Another problem I have is to access the

Re: uninstall python2.5 on debian

2007-09-22 Thread Martin v. Löwis
> I have tried make uninstall and searched the web, but that did not help me. > I guess rm -Rf python2.5 is not a wise thing to do. It's part of the solution. There is no automated install procedure; you have to manually remove everything that got installed. In /bin, it's most files that have 2.5

Re: Building Python with VC8 on x64 Vista

2007-09-22 Thread Martin v. Löwis
> 1>py_dyn_test.obj : error LNK2001: unresolved external symbol > _Py_NoneStruct Could it be that py_dyn_test.obj is a x86 (not AMD64) object file? Run dumpbin. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode categories -- regex

2007-09-22 Thread Martin v. Löwis
> So how do i include this information in regular pattern search? Any > ideas? At the moment, you have to generate a character class for this yourself, e.g. py> chars = [unichr(i) for i in range(sys.maxunicode)] py> chars = [c for c in chars if unicodedata.category(c)=='Po'] py> expr = u'[\\' + u

Re: Building Python with VC8 on x64 Vista

2007-09-24 Thread Martin v. Löwis
> It doesn't look like these are x86, though. Ok. Can you then check symbol lists also?: undefined symbols in the object file, and defined symbols in the library, wrt. PyExc_IndexError (say). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

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: 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
> 'Microsoft JET Database Engine', "'c:\\Hqwhslfs001\\office\risk > oversight\\myaccess.mdb' is not a valid path. Make sure that the path > name is spelled correctly and that you are connected to the server on > which the file resides.", None, 5003044, -2147467259), None) > > Please note the stra

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
>> egt = {} >> for key in record: >>if key.startswith('E'): >>egt[key] = record[key] > > I actually had come up with something like this, but thought it wasn't > quite as pythonish as it should be. It is certainly much more readable > to a neophyte to python. My recommendation: forge

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

<    5   6   7   8   9   10   11   12   13   14   >