Re: python2.4-dbg and C modules

2008-01-23 Thread Martin v. Löwis
u have to recompile your module with the debug headers. HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system behavior when calling SQLPlus with spooling

2008-01-23 Thread Martin v. Löwis
#x27;t provide any? You can use "strace -p " to find out what it's doing when it hangs. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and binary compatibility

2008-01-24 Thread Martin v. Löwis
> All my troubles could apparently be fixed if I > could acquire a copy of VS 2003, but Microsoft has made it incredibly > difficult to find the download for it (I don't think it exists). > > Any suggestions? You can get copies of VS 2003 from ebay fairly easily. Rega

Re: Some questions about decode/encode

2008-01-27 Thread Martin v. Löwis
t;gbk" occurs in the encoding declaration as If the encoding name has a different spelling (e.g. GBK), you need to cater for that as well. You might want to try replacing the entire XML declaration (i.e. everything between ), or just the encoding= parameter. Notice that the encoding declaration

Re: strftime return value encoding (mbcs, locale, etc.)

2008-01-27 Thread Martin v. Löwis
le.getpreferredencoding() to "mbcs", so that my original code works > portably? No. The "mbcs" codec has a slightly different semantics from the cp932 codec, on your system. Specifically, the "mbcs" codec might map characters as approximations, whereas the cp932 cod

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-02-01 Thread Martin v. Löwis
it is expanding at a slower rate than souls entering, it is exothermic and pressure will increase until all hell breaks loose. If it is expanding at a higher rate, it is endothermic, and temperature will drop until hell freezes over. See http://www.pinetree.net/humor/thermodynamics.htm

Re: Mysterious xml.sax Encoding Exception

2008-02-01 Thread Martin v. Löwis
n > English locale). What operating system do they use, and how do they send you the file for verification? Can you have them run print repr(open(filename, "rb").read(10)) and send you its output? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Mysterious xml.sax Encoding Exception

2008-02-01 Thread Martin v. Löwis
exception. So are you sure you open the file in binary mode on Windows? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Martin v. Löwis
> That's odd, because readline seems to work fine in a Windows > console (recalling previous lines and line editing). That's an illusion. The Windows version of Python does not support or use GNU readline at all. What you see is a feature of the console window. Regards,

Re: What should I use under *nix instead of freeze?

2008-02-01 Thread Martin v. Löwis
ing back to the community, and contribute any patches to freeze that you may find necessary. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Martin v. Löwis
> Is there a reason why "/" is considered an absolute pathname by > CPython? Yes: it tests whether a path is absolute on the current volume. Use the source, Luke. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple interpreters retaining huge amounts of memory

2008-02-01 Thread Martin v. Löwis
n your own. If you find out what the problem is, please submit patches to bugs.python.org. In any case, the strategy you propose (with multiple arenas) would *not* work, since some objects have to be shared across interpreters. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Mysterious xml.sax Encoding Exception

2008-02-01 Thread Martin v. Löwis
> The basic fact, though, remains, the same code works for me with the > same input but not for two particular users (out of hundreds). I see. That's mysterious. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: What should I use under *nix instead of freeze?

2008-02-02 Thread Martin v. Löwis
hat? No. First, it works on Windows, Linux and Irix only, not on arbitrary *nix systems. Second, it doesn't create a single executable, but depends on the extension modules that the host Python interpreter uses. To compile a simple "print 'Hello, world'" with Python 2.5 o

Re: Multiple interpreters retaining huge amounts of memory

2008-02-02 Thread Martin v. Löwis
tems you > have developed which make use of multiple sub interpreters so we can > gauge with what standing you have to make such a comment. I have never used that feature myself. However, I wrote PEP 3121 to overcome some of its limitations. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows Python 2.5.1 IPV6 problems

2008-02-02 Thread Martin v. Löwis
> _sock = _realsocket(family, type, proto) > TypeError: an integer is required So what values have family, type, and proto at that point? Edit socket.py to find out. Could it be that you also need to set socketType for your Port subclass? Regards, Martin -- http://mail.python.org/m

Re: [2.4.2] Compiling Python with packages?

2008-02-03 Thread Martin v. Löwis
However, some modules are not builtin (they are shared libraries instead); it's easiest to ls build/lib. after compiling Python to see what modules have been built. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Why chdir command doesn't work with client.get_transport() ?

2008-02-03 Thread Martin v. Löwis
th the default directory again. You need to open a remote shell, and send commands to its command line; AFAICT, you can't use exec_command for that. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple interpreters retaining huge amounts of memory

2008-02-03 Thread Martin v. Löwis
AICT. The interpreter keeps track of loaded extensions by file name, so if the different version lives in a different file, that should work fine. Are you using sys.setdlopenflags by any chance? Setting the flags to RTLD_GLOBAL could have that effect; you'ld get the init function of the fi

Re: Multiple interpreters retaining huge amounts of memory

2008-02-03 Thread Martin v. Löwis
s become simpler to limit the source of potential > problems and just tell them to avoid doing it. :-) You do notice that my comment in that direction (avoid using multiple interpreters) started that subthread, right :-? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Why chdir command doesn't work with client.get_transport() ?

2008-02-05 Thread Martin v. Löwis
> Do you think that paramiko can replace telnet in my application? Thanks. You need to use .invoke_shell(), then send() and recv(). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Paramiko SFTP autologon using id_dsa.pub

2008-02-06 Thread Martin v. Löwis
anyone help ? When you have an ssh-agent running that has the key loaded, paramiko will automatically use that. If you don't have an ssh-agent running, you have to pass either the pkey or the key_filename argument; the former should be a PKey object (either RSAKey or DSSKey). Regards, Marti

Re: Multiple interpreters retaining huge amounts of memory

2008-02-06 Thread Martin v. Löwis
be only a single one of them. If you think you can fix that, start by changing Python so that Py_None is per-interpreter, then continue with PyBaseObject_Type. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Paramiko SFTP autologon using id_dsa.pub

2008-02-06 Thread Martin v. Löwis
Mike Hjorleifsson wrote: > Thanks for the response, is there an example bit of code somewhere i > could digest ? I did c.connect("",username="loewis") with ssh-agent, and it worked just fine. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple interpreters retaining huge amounts of memory

2008-02-07 Thread Martin v. Löwis
the SWIG module should be irrelevant. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Paramiko SFTP autologon using id_dsa.pub

2008-02-07 Thread Martin v. Löwis
> sorry i meant a code example that i pass the id_dsa.pub file contents > too > so i am not reliant on the host system to have the ssh-agent. c.connect("",username="loewis",key_filename=".ssh/identity") works for me with ssh-agent disabled. Regards, Ma

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-09 Thread Martin P. Hellwig
Steven D'Aprano wrote: > On Wed, 06 Feb 2008 10:14:10 -0600, Reedick, Andrew wrote: > 'c' is also the speed of light. >>> 'c' is the speed of light _in_a_vacuum_. >> True. >> >> And since nothing can travel faster than light... >>> Nothing can travel faster than the speed of light _in_a_

Re: Displaying Unicode Chars

2008-02-10 Thread Martin v. Löwis
t;221E" 1. convert that into an integer: char = int(char, 16) 2. convert that into a Unicode character: char = unichr(char) 3. print it: print char If you insist on the user entering "u221E" instead, you have to convert that first into a string without the leading u: 0.5 char = char[1:] HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Displaying Unicode Chars

2008-02-10 Thread Martin v. Löwis
y. On Linux, try gucharmap or kcharselect. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Chinese character error

2008-02-10 Thread Martin v. Löwis
> Have you any idea why this is not working on my computer ? Can you please try the listdir operation with the Python distribution from python.org instead of Cygwin Python? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: dream hardware

2008-02-12 Thread Martin P. Hellwig
Bjoern Schliessmann wrote: > Jeff Schwab wrote: > >> The only "dream hardware" I know of is the human brain. > > Nah. Too few storage capacity, and too slow and error-prone at > simple calculations. The few special but very advanced features are > all hard-wired to custom hardware, it's a real ni

Re: Unicode char replace

2008-02-12 Thread Martin v. Löwis
own error handler, such as the one in http://herlock.com/ob/pythoncb/0596007973/chp-1-sect-23.html HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Email Directly from python

2008-02-13 Thread Martin P. Hellwig
Larry Bates wrote: > brad wrote: >> I'd like to send email directly from within python without having to >> rely on an external smtp server. You know, something like the good, >> old Unix... >> >> echo My_message | mail -s Subject [EMAIL PROTECTED] >> >> Can Python do something similar in a porta

Re: Email Directly from python

2008-02-13 Thread Martin P. Hellwig
brad wrote: > Martin P. Hellwig wrote: > >> The tricky part is how to resolve the mail server for a mail address. >> Usually you have to query the mx record of that domain. I solved that >> by looking if I can find the nslookup binary. > > The from and to are

Re: Email Directly from python

2008-02-13 Thread Martin P. Hellwig
Martin P. Hellwig wrote: > I already wrote a command line mailer that can do attachments too, no > need to write it again. If anybody is interested I can open-source it. > To reply on my own post ;-) Even if nobody is interested in case you change your mind it is hosted

Re: Email Directly from python

2008-02-13 Thread Martin P. Hellwig
Guilherme Polo wrote: > I hope to not disappoint you, but mail will invoke a smtp server to > send your mail. > I disagree. If you really want to, all you need is telnet. You connect to port 25 of the mail server that handles the mail of the domain for that mail address and do the helo, mail f

Re: Email Directly from python

2008-02-14 Thread Martin P. Hellwig
Dennis Lee Bieber wrote: > The first response to the query was to invoke the command line > "mail" utility of a Unix type OS. THAT program is, what I believe, was > meant by "mail will invoke a smtp server"... Not "mail" as a general > concept, but the utility command... Ah yes I see that n

RELEASED Python 2.5.2, release candidate 1

2008-02-14 Thread Martin v. Löwis
lease, Martin Martin v. Loewis [EMAIL PROTECTED] Python Release Manager (on behalf of the entire python-dev team) -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED Python 2.5.2, release candidate 1

2008-02-14 Thread Martin v. Löwis
> The Mac binary is giving a 404. Thanks for pointing that out - it's fixed now. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED Python 2.5.2, release candidate 1

2008-02-14 Thread Martin v. Löwis
r, so "to release" means to me what the dictionary says it means: m-w's fourth meaning, "make available to the public". That's what I did - I made the release candidate available to the public. So is the subject incorrect as well? If so, what should it say? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Memory Manager

2008-02-17 Thread Martin v. Löwis
ilar scheme that allows incremental collection without write barriers. This particular scheme heavily relies on refcounting itself (specifically, an object is garbage in a certain generation when all references to it come from the same generation). As for the consequences of the scheme (i.e. no

Re: Threading the Python interpreter

2008-02-18 Thread Martin v. Löwis
MooJoo wrote: > I've read that the Python interpreter is not thread-safe Just to counter this misconception: the Python interpreter *is* thread-safe. It's just that it won't run in parallel with itself on multiple CPUs in a single process. Regards, Martin -- http://mail.

Re: Threads vs. continuations

2008-02-19 Thread Martin v. Löwis
y the operating system underly a system scheduler: they can be preempted, they have priorities, and they may voluntarily block. All this is not possible with continuations. IOW, threads are more expressive than continuations. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Threads vs. continuations

2008-02-19 Thread Martin v. Löwis
> 'Not trying to start a fight here, I'm just curious about the > current state of that art. It is the case today that all > modern language threading is realized over a kernel implementation > of threading that behaves as you suggest? I didn't suggest it for all languag

Re: Help on help()

2008-02-21 Thread Martin v. Löwis
> If I do: > > import my_module > help(my_module) > > I'd like to see ONLY help on my_module, NOT help on all the functions > inherited from the various parent classes . . . I would do print my_module.__doc__ HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Return value of an assignment statement?

2008-02-21 Thread Martin v. Löwis
ay that expressions evaluate to a value, not that they return a value. > The above example generates a SyntaxError. > > Is this correct? I just want to make sure I've understood the > semantics. Please try to study more on the difference between expressions and statements. Regar

[ANN] Python 2.5.2 released

2008-02-22 Thread Martin v. Löwis
clude: Bug fixes. According to the release notes, at least 100 have been fixed. Highlights of the previous major Python release (2.5) are available from the Python 2.5 page, at http://www.python.org/2.5/highlights.html Enjoy this release, Martin Martin v. Loewis [EMAIL PROTECTED] P

Re: _struct in Python 2.5.2

2008-02-24 Thread Martin v. Löwis
2 from, and how did you install it? _struct should be there; if it isn't, something went wrong during the installation. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding a literal "\u" in a unicode raw string.

2008-02-25 Thread Martin v. Löwis
Java and C is so that \u gets processed even before tokenization even starts, and it should be the same in Python. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows System Administration: State of the Art on Python?

2008-02-26 Thread Martin v. Löwis
l good enough (or at all, for that matter). I found Python does *very* well in Windows system administration, in many cases, better than Visual Basic (IMO, and for the things I wanted to do). I've mostly used the COM integration, as the things I wanted to manage had COM (automation

Re: European python developers

2008-02-27 Thread Martin P. Hellwig
[EMAIL PROTECTED] wrote: > Hi Python Enthusiasts, > > I am hoping one or two members of this list might help me locate in Europe > to begin a small team of developers with a focus on python for the central > part of the server development. > > My personal first choice is Spain only because I lik

Re: [Python-3000] RELEASED Python 2.6a1 and 3.0a3

2008-03-01 Thread Martin v. Löwis
> As of 4:50 PM EST, the links to Windows installers give 404 File Not > Found. > > I gather that they are still in process, > and notice that there is no public c.l.p. announcement. I just fixed that. The files were there; just the links were wrong. Regards,

Re: [Python-Dev] [Python-3000] RELEASED Python 2.6a1 and 3.0a3

2008-03-01 Thread Martin v. Löwis
> The 2.6a1 x86 MSI is there, but the 3.0a3 x86 MSI is still giving a 404. Please try again - *those* files weren't actually there when I sent my last message; I just built them. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems building 2.5.1 on AIX

2008-03-01 Thread Martin v. Löwis
ou really do have to check config.log. Check for any lines where it tries to invoke the compiler, and check whether it does so in the way you expect it to. From the output you provide, it seems to use "cc" as the compiler, not /usr/vacpp/bin/cc_r. Looking at the comfigure code, this is n

Re: cx_Freeze : LookupError: unknown encoding: ascii

2008-03-01 Thread Martin v. Löwis
> Can somebody point to some clues about options that need to be passed > to FreezePython API to get the right executable. You need to tell it to include the encodings.ascii module. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

[ANN] Python 2.3.7 and 2.4.5, release candidate 1

2008-03-02 Thread Martin v. Löwis
ghlights of the previous major Python releases are available from the Python 2.4 page, at http://www.python.org/2.3/highlights.html http://www.python.org/2.4/highlights.html Enjoy this release, Martin Martin v. Loewis [EMAIL PROTECTED] Python Release Manager (on behalf of the entire

Re: [Python-Dev] [ANN] Python 2.3.7 and 2.4.5, release candidate 1

2008-03-02 Thread Martin v. Löwis
xed for 2.5 (IIUC), but the fix was not backported (nor should it be, as it is not relevant for security). Use OS X 10.4 if you want to use Python 2.4. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] [ANN] Python 2.3.7 and 2.4.5, release candidate 1

2008-03-02 Thread Martin v. Löwis
ld have to be fixed. IIUC, 2.4.4 won't compile on 10.5, either, and Python 2.4.5 will have no code to port it to new platforms. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] [ANN] Python 2.3.7 and 2.4.5, release candidate 1

2008-03-03 Thread Martin v. Löwis
> Can you also add a note to the 2.3 and 2.4 web pages? You mean the 2.3.7 and 2.4.5 web pages? Sure. (If you mean some other web pages, please give precise URLs). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python GDB Wrapper

2008-03-06 Thread Martin v. Löwis
> Has anyone does this before ? Even some basic idea or code as to how > to proceed would be great. Have you seen Misc/gdbinit? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: os.chdir

2008-03-08 Thread Martin v. Löwis
ME'], 'dir1')) Or os.chdir(os.path.expanduser("~/dir1")) Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: List as FIFO in for loop

2008-03-08 Thread Martin v. Löwis
d later items, but makes modification of the sequence undefined behavior to allow alternative implementations. E.g. an implementation that would crash, erase your hard disk, or set your house in flames if you confront it with your code still might be a conforming Python implementation. Regards, Martin --

Re: Need Help Building PythonQt on Windows

2008-03-09 Thread Martin v. Löwis
the corresponding import library (libpythonxy.a/pythonxy.lib) into the linker line, using a -l option. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: python-2.5.2 src rpm

2008-03-10 Thread Martin v. Löwis
gt; any version of 2.5 for that matter. > > Any pointers would be appreciated. I have not released any source RPM for Python 2.5.2. You can build your own, from Misc/RPM. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: building arbitrary files with distutils?

2008-03-10 Thread Martin v. Löwis
you put it all in a single run method which sequentially first tries to generate the intermediate outputs (doing nothing if they are up-to-date), and then the final outputs (doing nothing when they are newer than the intermediate ones). HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

[ANN] Python 2.3.7 and 2.4.5 (final)

2008-03-11 Thread Martin v. Löwis
on.org/2.4/highlights.html Enjoy this release, Martin Martin v. Loewis [EMAIL PROTECTED] Python Release Manager (on behalf of the entire python-dev team) -- http://mail.python.org/mailman/listinfo/python-list

Why doesn't xmlrpclib.dumps just dump an empty value instead of ?

2008-03-16 Thread martin f krafft
Hi, xmlrpclib.dumps((None,), allow_none=True) yields '\n\n\n\n' Why doesn't it just yield '\n\n\n\n' Or even just '\n\n\n' Those are valid XML and valid XML-RPC, but isn't. Thanks for any thoughts... -- martin | http://madduck.net/ | ht

Re: Why doesn't xmlrpclib.dumps just dump an empty value instead of ?

2008-03-17 Thread martin f krafft
also sprach martin f krafft <[EMAIL PROTECTED]> [2008.03.16.1421 +0100]: > Why doesn't it just yield > > '\n\n\n\n' > > Or even just > > '\n\n\n' There's a difference between those two. The first one has an empty string value (&#x

Re: os.path.getsize() on Windows

2008-03-21 Thread Martin v. Löwis
Why do you say that? It most definitely returns what the size currently is, not what it will be in the future (how could it know, anyway). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Removal of tkinter from python 3.0? [was: Fate of the repr module in Py3.0]

2008-03-21 Thread Martin v. Löwis
rt IDLE to Tk 8.5: that would be a useful contribution. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: eval and unicode

2008-03-21 Thread Martin v. Löwis
ge across Python versions. Ideally, interactive mode should assume the terminal's encoding for source code, but that has not been implemented. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: eval and unicode

2008-03-21 Thread Martin v. Löwis
#x27;\xdb' will be the same in latin1, > latin3, latin4 and probably many others.) I think in all your examples, you pass a Unicode string to eval, not a byte string. In that case, it will encode the string as UTF-8, and then parse the resulting byte string. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: os.path.getsize() on Windows

2008-03-21 Thread Martin v. Löwis
complete (it knows, after > all, the size of the source file). I always thought this meant that > Windows is just much smarter than me, so I ignored it. No, I really think the target file has its size right from the beginning. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Do any of you recommend Python as a first programming language?

2008-03-23 Thread Martin P. Hellwig
jmDesktop wrote: > For students 9th - 12th grade, with at least Algebra I. Do you think > Python is a good first programming language for someone with zero > programming experience? Using Linux and Python for first exposure to > programming languages and principles. > > Thank you. I for one can

Re: Removal of tkinter from python 3.0? [was: Fate of the repr module in Py3.0]

2008-03-23 Thread Martin v. Löwis
Guilherme Polo wrote: > 2008/3/21, "Martin v. Löwis" <[EMAIL PROTECTED]>: >>> I've been thinking of volunteering to "port" Tkinter to Python 3.0, I >> > hadn't noticed that there was any discussion of removing it. It would >> > b

Re: Code folder with Emacs

2008-03-25 Thread Martin Sand Christensen
ion 0 1))) (length indentation) (/ (length indentation) py-indent-offset) (add-hook 'python-mode-hook '(lambda () (outline-minor-mode 1) (setq outline-regexp py-outline-regexp outline-level 'py-outline-level))) Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Why can't I store a DLL in a module library Zip file?

2009-01-09 Thread Martin v. Löwis
itself. For DLL loading, it must use the OS routines, which just don't look into zipfiles. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6.1 @executable_path

2009-01-10 Thread Martin v. Löwis
> I asked something similar a few days ago. Is it possible to compile > Python 2.6.1 with a dynamic path? What is a "dynamic path"? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: python3.0 MySQLdb

2009-01-12 Thread Martin v. Löwis
> I need something to connect to a database, preferably mysql, that > works in python3.0 please. For postgres, psycopg2 works with Python 3 (if you use my patch). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: python3.0 MySQLdb

2009-01-13 Thread Martin v. Löwis
such a thing > exist, and if so where can I find it?". Interestingly enough, the question was slightly (but importantly) different, though: the question really was "Does anybody has a patch for MySQLdb?"; as my reference to the existing interface to PostgreSQL was not sufficient for the

Re: python3.0 MySQLdb

2009-01-14 Thread Martin v. Löwis
s. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Crashes

2009-01-15 Thread Martin P. Hellwig
koranthala wrote: This does sounds more to me like a windows/hardware problem, what you could do is check the windows log for errors, especially look for read errors from the hard disk. Windows sometimes can behave very strangely especially if the external libs don't behave well on a multi

Re: UnicodeError for join()

2009-01-15 Thread Martin v. Löwis
s unicode-safe? One of self.title and self.content is a Unicode string, the other is a byte string. You need to change them to have the same type (depending on whether you want to process them as Unicode or byte strings). HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: UnicodeError for join()

2009-01-15 Thread Martin v. Löwis
title is a unicode string, and further suppose the output is to be encoded in cp1252, then you change the line to rc_file.write(u"\n\n".join([self.title.encode("cp1252"), "### BEGIN CONTENT ###", self.content]))

Re: s = sha1(random()).hexdigest()

2009-01-15 Thread Martin v. Löwis
> s = urandom(10).encode('hex') > > AttributeError: 'bytes' object has no attribute 'encode' py> binascii.hexlify(os.urandom(10)) b'92b91d5734a9fe562f23' Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Totally confused by the str/bytes/unicode differences introduced in Pythyon 3.x

2009-01-17 Thread Martin v. Löwis
t. readability sometimes, but I found that this approach works quite well for Django. I think Mark Hammond is also working on maintaining a single code base for both 2.x and 3.x, for PythonWin. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: tp_base, ob_type, and tp_bases

2009-01-17 Thread Martin v. Löwis
rom > type? No - it is the normal case for single inheritance. You can leave it NULL, which means you inherit from object. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: braces fixed '#{' and '#}'

2009-01-17 Thread Martin P. Hellwig
Roy Smith wrote: In article , Steve Holden wrote: Roy Smith wrote: In article <6264e675-ddd4-446a-822a-cc82e8f87...@w1g2000prk.googlegroups.com>, v4vijayakumar wrote: I saw some code where someone is really managed to import braces from __future__. ;) def test(): #{ print "hell

Re: s=ascii(hexlify(urandom(10)))

2009-01-17 Thread Martin v. Löwis
etely different from what you expect it to do. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: s=ascii(hexlify(urandom(10)))

2009-01-17 Thread Martin v. Löwis
gert wrote: > On Jan 17, 9:08 pm, "Martin v. Löwis" wrote: >>> I expected that py3 did not converted the b'...' indication too ? >>> b'afc76815e3fc429fa9d7' >> You mean, just because you invoked the ascii() builtin, the b >> pre

Re: Incorrect title case?

2009-01-17 Thread Martin v. Löwis
s to be generated). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: s=ascii(hexlify(urandom(10)))

2009-01-17 Thread Martin v. Löwis
>>> s = str(hexlify(urandom(8)))[2:18] >> And your question is? > > No question just solution to get rit of b'' :) Ah. hexlify(urandom(8)).decode('ascii') Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Dealing with large memory under linux or How to Build 64bit Python

2009-01-22 Thread Martin v. Löwis
ython executable, so no need to build Python at all. If you still wish to rebuild Python, then, on the 64-bit Ubuntu, the standard configure;make;make install will do the trick. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: The First Law Of comp.lang.python Dynamics

2009-01-23 Thread Martin P. Hellwig
Tim Rowe wrote: 2009/1/23 Kay Schluehr : Whatever sufficiently sophisticated topic was the initially discussed it ends all up in a request for removing reference counting and the GIL. Well, maybe, but it seems to me that the real issue here is that we need to remove reference counting and the

Re: Byte oriented data types in python

2009-01-24 Thread Martin v. Löwis
e a single byte, and the + operator will do the concatenation. In Python 3.x, use the bytes type (bytes() instead of chr()). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: MaxInt on Vista-64bit?

2009-01-24 Thread Martin v. Löwis
ir parameter types. And so on. > Can I replace the int values to a int64 value? See above. In short: no. Use a real 64-bit operating system (such as 64-bit Linux, Solaris, FreeBSD, etc) Regards, Martin P.S. I do wonder why you want to do this, though. Isn't Python's long integer

Re: Byte oriented data types in python

2009-01-25 Thread Martin v. Löwis
ry, > communications protocols in Python. I've used Python/struct > with transport layers ranging from Ethernet (raw, TCP, and UDP) > to async serial, to CAN. Do you use it for the fixed-size parts, or also for the variable-sized data? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Byte oriented data types in python

2009-01-25 Thread Martin v. Löwis
de any additional value: def encode(type, length, value): return chr(type)+chr(length)+value Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Byte oriented data types in python

2009-01-25 Thread Martin v. Löwis
ffer of n bytes. Now that bytes() ended up immutable (and bytearray was added), it's perhaps not so useful anymore. Of course, it would be confusing if bytes(4) created a sequence of one byte, yet bytearray(4) created four bytes. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Byte oriented data types in python

2009-01-25 Thread Martin v. Löwis
at', 1, 3.14159) > Traceback (most recent call last): > File "", line 1, in > File "", line 2, in encode > TypeError: an integer is required No: py> CONNECT_REQUEST=17 py> payload="call me" py> encode(CONNECT_REQUEST, len(payload), payload) '\x11\x07call me' Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

<    27   28   29   30   31   32   33   34   35   36   >