Re: Python compared to other language

2007-05-20 Thread Martin v. Löwis
>> But that is my point. With Python, the language itself takes care of >> the platform differences, so the same Python code will run on >> different platforms. I realize that, at a lower level, everything is >> done is C. But, from the developers point of view: developing code in >> C requires mor

Re: Python compared to other language

2007-05-20 Thread Martin v. Löwis
> PHP was definitely born _for_ webpages; Ruby wasn't, just like Perl or > Python weren't, it just became very popular for webpages when Rails > appeared. In this kind of discussion, I get always reminded that Perl stands for "Practical Extraction and Report Language". So Perl _clearly_ is for gen

Re: Windows Debugging w/o MS

2007-05-22 Thread Martin v. Löwis
> I am trying to build an extension module written in C++ on windows XP. > I am trying to use only open-source tools, such as mingw. I'm using > the Python 2.5 official, and it seems to compile my module just fine > (I'm using the --compiler=mingw32). I can also import the module. The > problem is,

Re: how to print the GREEK CAPITAL LETTER delta under utf-8 encoding

2007-05-28 Thread Martin v. Lo
人言落日是天涯,望极天涯不见家 schrieb: > I lookup the utf-8 form of delta from the link. > http://www.fileformat.info/info/unicode/char/0394/index.htm > > and then I want to print it in the python ( I work under windows) > > #!/usr/bin/python > #coding=utf-8 > > print "\xce\x94" > > but the result is not the

Re: how to print the GREEK CAPITAL LETTER delta under utf-8 encoding

2007-05-29 Thread Martin v. Lo
> yes, it could print to the terminal(cmd.exe), but when I write these > string to file. I got the follow error: > > File "E:\Tools\filegen\filegen.py", line 212, in write > self.file.write(data) > UnicodeEncodeError: 'ascii' codec can't encode character u'\u0394' in > position 0 > : ordinal

Re: How to print this character u'\u20ac' to DOS terminal

2007-05-29 Thread Martin v. Lo
人言落日是天涯,望极天涯不见家 schrieb: > Who could explain the follow issue ? print u'\u0394' > Δ print u'\u20ac' > Traceback (most recent call last): > File "", line 1, in > UnicodeEncodeError: 'gbk' codec can't encode character u'\u20ac' in > position 0: > illegal multibyte sequence > > My termi

Re: Compiling python2.5.1 results in 3.5MB python lib?

2007-07-28 Thread Martin v. Löwis
> I'm compiling 2.5.1 and end up with a 3.5MB libpython2.5.so file. I > seem to remember it should be somewhere around the 1MB mark. What > could be causing this? Try stripping it. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Why no maintained wrapper to Win32?

2007-07-28 Thread Martin v. Löwis
> It looks like the development of the PyWin32 wrapper to the > Win32 API stopped years ago, which is too bad because it means that > writing GUI apps in Python even just for Windows means adding > megabytes when using eg. wxWidgets. Why does it mean that? The Win32 APIs for GUI are up-to-da

Re: Compiling 2.5.1 on OpenBSD 4.1

2007-07-28 Thread Martin v. Löwis
> I'm stumped. Any suggestions? You will have to find the true declaration of lstat - reading man pages or checking that everything "looks right" won't help. So where is lstat declared? Is it declared at all, and if so, is that declaration conditional perhaps? Produce a preprocessor output (pos

Re: Why no maintained wrapper to Win32?

2007-07-28 Thread Martin v. Löwis
>> Why does it mean that? The Win32 APIs for GUI are up-to-date; they >> don't need further development. Win32 itself stopped years ago. >> You can write GUI applications with PyWin32 just fine. > > Besides the total lack of documentation, you mean that nothing was > added to the Win32 API since P

Re: Compiling 2.5.1 on OpenBSD 4.1

2007-07-29 Thread Martin v. Löwis
> Thanks Martin. Did I mention this was OpenBSD 4.1 in the original post? > Here's the patch: It may work, but I don't like it. Can you please try this one instead, and report whether it works? Thanks, Martin Index: configure ===

Re: Compiling 2.5.1 on OpenBSD 4.1

2007-07-29 Thread Martin v. Löwis
> __BSD_VISIBLE is there (it wasn't there before and that's what was causing my > original problem). > [EMAIL PROTECTED]:/bu/pkg/Python-2.5.1$ grep _BSD_SOURCE pyconfig.h > [EMAIL PROTECTED]:/bu/pkg/Python-2.5.1$ grep _BSD_VISIBLE pyconfig.h > #define __BSD_VISIBLE 1 It being in pyconfig.h is irr

Re: Why no maintained wrapper to Win32?

2007-07-30 Thread Martin v. Löwis
> Guess I have the answer as to no one seems to write GUI apps for > Windows natively :-) That's certainly an important factor. If I wanted to ship a small application, I would write a web server, and run that locally. GUI programming is so last-century :-) Regards, Martin -- http://mail.python.

Re: Subprocess and pipe-fork-exec primitive

2007-07-31 Thread Martin v. Löwis
> From my experience, this primitive will fail with 'no child processes' > at the waitpid call if the forked child dies very quickly - before the > parent is scheduled back for execution. This seems to happen because > Python has a default SIGCHLD handler that, in this case, will reap the > proce

Re: encode() question

2007-07-31 Thread Martin v. Löwis
>>> str.decode and unicode.encode should NOT exist, or at least issue a >>> warning (IMHO). >>> >> Yes, that sounds like a good idea. > > It sounds like horrible idea as those are the ones that are really needed. Correct. > One could argue about `str.encode` and `unicode.decode`. But there ar

Python Package Index hostname change

2007-07-31 Thread Martin v. Löwis
The Python Packaging Index (the software formerly known as Cheeseshop) is now available at http://pypi.python.org/pypi The old addresses (www.python.org/pypi, and cheeseshop.python.org/pypi) will continue to work, either as aliases or using HTTP redirections. The software was renamed to its old

Re: Python end of file marker similar to perl's __END__

2007-07-31 Thread Martin v. Löwis
> In perl, I can write __END__ in a file and the perl interpreter will > ignore everything below that line. This is very handy when testing my > program. Does python have something similar? Sorry, no, it doesn't. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Using cursor.callproc with zxJDBC

2007-08-03 Thread Vaughan V Ashe
Hi We would like to use the store proc. We are using a postgreql database. what we have working so far is: params = [4,4,2] curs.callproc("update_job_status",params) db.commit() #print db #print curs.description result = curs.fetchall() if result == 1: print "good one" else: p

Re: Semantics of thread.error

2007-08-05 Thread Martin v. Löwis
Paul Miller schrieb: > In the language documentation, all that is said about thread.error is > that it's raised "on thread-specific errors." Is there anywhere a > list of conditions which will cause thread.error to be raised? I don't think so. However, it is fairly easy to extract such a list fr

Re: Misleading wikipedia article on Python 3?

2007-08-05 Thread Martin v. Löwis
that much? Last time I looked, e.g. dict.items() no > longer returned a list. Correct. > Seems unlikely that most code will run on 2 > and 3, in that case, Why that? Most reasonable code doesn't care what dict.items returns, as it reads like for k,v in dict.items(): do_someth

Re: Misleading wikipedia article on Python 3?

2007-08-05 Thread Martin v. Löwis
>> I think you misunderstood. It's not a design goal that code works >> without modifications, yet most reasonable code will even without >> that being an explicit goal. > > I think the design goals have been fairly clear. What hasn't been > clear (to me, at least) is the practical question of th

Re: Misleading wikipedia article on Python 3?

2007-08-05 Thread Martin v. Löwis
John J. Lee schrieb: > "Martin v. Löwis" <[EMAIL PROTECTED]> writes: > [... snip stuff I don't follow ...] >> However, it *is* a design goal to make 2.6 so that transition to >> 3k becomes simpler. That's not a 3k feature, but a 2.6 one. > >

Re: Setting default output encoding

2007-08-05 Thread Martin v. Löwis
> python = subprocess.Popen(["python", "myscript.py"], > stdout=subprocess.PIPE, stderr=subprocess.PIPE) > > However, this child script has sys.stdout.encoding set to None, > which means that Unicode strings cannot be printed without trouble. The automatic settin

Re: Misleading wikipedia article on Python 3?

2007-08-07 Thread Martin v. Löwis
> Do you *really* think that projects will fall 50-50 into the "yes" and > "no" camps, as you seem to imply -- after all, if you thought that one > case was more common, why wouldn't you mention which it was? I know you didn't ask me this time, but I answer anyway: I don't know. I *really* think

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Martin v. Löwis
> I don't see how file() can be "removed", actually, unless the > file type itself is getting axed. Indeed, that's the case. Py3k won't use stdio for file input and output, but the io module. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: tokenize module after installation

2007-08-09 Thread Martin v. Löwis
> After installation my program that uses tokenize module,when I run > myprogram.exe (vgsveki.exe): > > AttributeError: 'module' object has no attribute 'untokenize' Perhaps you use the 2.4 version of tokenize.py here, which did not have untokenize. Regards, Martin -- http://mail.python.org/mai

Re: Pausing and Unpausing Threads

2007-08-12 Thread Martin v. Löwis
> I'm worried that this loop may wast some CPU cycles, and wonder if > there's a better way through thread synchronization using such things > as Events or Conditions. Typically, people are after the Queue module in such cases. Each DirectedControl(l)er would have an instance of the Queue class, a

Re: Python not freeing memory (?)

2007-08-12 Thread Martin v. Löwis
> Is there *any* way of getting around this? Sure: Determine the bug, and fix it. A prerequisite is that you have the source code of all extension modules which you are using, but that seems to be the case. If you want others to help you in finding the bug, you need to provide more detail, e.g. a

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

non-blocking communication with imaplib

2007-08-22 Thread Igor V. Rafienko
Hi, I was wondering if anyone had a suggestion for the following issue. I would like to talk to an IMAP-server, imaplib being the tool of choice, of course. Unfortunately it may happen that the IMAP-server fails to respond to certain commands, and I would like to be able to detect that within a

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: non-blocking communication with imaplib

2007-08-29 Thread Igor V. Rafienko
[ Lawrence D'Oliveiro ] [ ... ] > According to the documentation > , you can override > the "read" and "readline" methods. How about replacing them with > routines that use select.select on the socket() object to implement > a timeout? Sounds like

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: An Editor that Skips to the End of a Def

2007-09-20 Thread Michael v. Fondern
W. Watson: > Is there an editor that allows one to position to put the cursor and > then by pushing some button goes to the end of the def? Eclipse, together with the pydev plugin. (Ctrl-Shift-Down) Greetings - Michael - -- http://mail.python.org/mailman/listinfo/python-list

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

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