Re: Multiple Versions of Python on Windows XP

2008-12-05 Thread Martin v. Löwis
Glenn Linderman wrote: > I'm unaware of it needing to handle multiple extensions > from the command line or via double clicking in Explorer, so was > exploiting the extra level of indirection to save typing, and make the > command simpler to remember. Python *does* provide multiple useful extensio

Re: Running Python 2 and Python 3 on the same machine

2008-12-05 Thread Martin v. Löwis
Terry Reedy wrote: > Martin v. Löwis wrote: >>> Since the source code is incompatible, I was expecting the Python >>> executable to have a new name such as 'python3' >> >> It does: the executable is called python3.0. > > Why do you say that?

Re: Running Python 2 and Python 3 on the same machine

2008-12-05 Thread Martin v. Löwis
> For *NIX machines, will 'python' be placed into /usr/bin? Not by default, no. Just try it and see for yourself. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Running Python 2 and Python 3 on the same machine

2008-12-06 Thread Martin v. Löwis
> Ok. I built the source on an openSUSE 11.0 system. I used 'sudo make > altinstll'. It created an executable /usr/local/bin/python3.0 file. > Nothing was touched in /usr/bin. Ah, then you missed the fun part. Take a look at the install: target in the Makefile. > I need to start writing some c

Re: Multiple Versions of Python on Windows XP

2008-12-06 Thread Martin v. Löwis
> SciTE doesn't do that, in the default configuration it just uses > whatever is called "pythonw" on the path, for running files having a .py > or .pyw suffix. I see. By default, Python does not put itself onto PATH. Does that mean that SciTE cannot run Python scripts in the default installation?

Re: Number of Python 3.x packages at the PyPI

2008-12-07 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > Is there an easy way to see the number of PyPI packages which have > been ported to Python 3? Yes: browse all pacakges classified with Programming Language :: Python :: 3 You can find them at http://pypi.python.org/pypi?:action=browse&c=533 It seems that some pack

Re: Number of Python 3.x packages at the PyPI

2008-12-07 Thread Martin v. Löwis
> I've had to fork my appscript project's codebase in order to add > support for Python 3.x. I would like to distribute both 2.x and 3.x > versions under the same package name for obvious reasons. This isn't a > problem with eggs as the Python version number is included in each > egg's name, but wh

Re: Number of Python 3.x packages at the PyPI

2008-12-07 Thread Martin v. Löwis
> Should specifying the 3.0 tag implicity and automatically specify the > 3 tag as well? No. There is really no builtin automatic semantics to any of the classifiers. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Number of Python 3.x packages at the PyPI

2008-12-08 Thread Martin v. Löwis
>> On second thought: can't you just include the source of both versions >> in a single source distribution file? > > The .tar.gz distributions are built by distutils/setuptools. If I > manually combine them into a single archive That's not what I'm proposing, though. Assuming you have two differ

Re: python-devel download and install

2008-12-08 Thread Martin v. Löwis
> I am developing in Python version 2.5.2 and need to install and download > the python-devel library. (This is needed so I can build and install > mysql-python.) Where can I find find this module to download and > build/installation instructions? I have been unable to find the source > online t

Re: how to add command line flags to distutils setup script?

2008-12-08 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > Suppose I have a setup.py script which imports distutils.core.setup. Is > there some way to, for example, add a command line flag to the build command > so that I can run it like > > python setup.py build --frob=True > > ? You should inherit from the build comman

Re: Google Summer of Code 2009

2008-12-09 Thread Martin v. Löwis
> I am interested in participating in Google Summer of Code 2009, > hopefully for something in Python. I realize that this is way before > it begins, but I would like to start to get to know the community > better and find something that I could work on during the summer of > code. I know a decen

Re: Compiling and installing python 2.5.2 with Visual C++ 2008

2008-12-09 Thread Martin v. Löwis
> - > ... > error: Python was built with Visual Studio 2003; > extensions must be built with a compiler than can generate compatible > binaries. > Visual Studio 2003 was not found on this system. If you have Cygwin installed, > you can try co

Re: Umlauts in idle

2008-12-13 Thread Martin v. Löwis
> When I try to use umlauts in idle it will only print out as Unicode > escape characters. Is it possible to configure idle to print them as > ordinary characters? Did you really use the print statement? They print out fine for me. Regards, Martin -- http://mail.python.org/mailman/listinfo/python

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-13 Thread Martin v. Löwis
>> This is intended behavior. > > I see. That means that the behaviour in Python 1.6 to 2.6 (i.e. > encoding the text using the repr() function (as then defined) was not > intended behaviour? Sure. This behavior has not changed. It still uses repr(). Of course, the string type has changed in 3.0

[ANN] Python 2.4.6 and 2.5.3, release candidate 1

2008-12-13 Thread Martin v. Löwis
Highlights of the previous major Python releases are available from the Python 2.5 page, at http://www.python.org/2.4/highlights.html http://www.python.org/2.5/highlights.html Enjoy this release, Martin Martin v. Loewis mar...@v.loewis.de Python Release Manager (on behalf of the entire

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-13 Thread Martin v. Löwis
> "Sure" as in "sure, it was not intended behaviour"? It was intended behavior, and still is in 3.0. >> This behavior has not changed. It still uses repr(). >> >> Of course, the string type has changed in 3.0, and now uses a different >> definition of repr. > > So was the above-reported non-cras

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-14 Thread Martin v. Löwis
> But shouldn't the production of an object's representation via repr be > a "safe" operation? It's a trade-off. It should also be legible. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Building from source -- zlib/binascii problems 2.5.2/2.6.1

2008-12-14 Thread Martin v. Löwis
> Target: x86_64-redhat-linux > gcc -pthread -shared build/temp.linux-x86_64-2.5/location/of/ > Python-2.5.2/Modules/zlibmodule.o -L/usr/local/lib -lz -o build/ > lib.linux-x86_64-2.5/zlib.so > /usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for > -lz Do file /usr/lib/libz.so

Re: Building from source -- zlib/binascii problems 2.5.2/2.6.1

2008-12-14 Thread Martin v. Löwis
> So.. it seems as though I need to get it to point to the 64 bit > version (or compile the zlib that comes with Python source). I'm not > sure how to override that. The easiest solution would be to invoke the linker line manually, and replace -lz with the absolute path to the right library. Reg

Re: the official way of printing unicode strings

2008-12-14 Thread Martin v. Löwis
> My main problem is that when I use some language I want to use it the way it > is supposed to be used. Usually doing like that saves many problems. > Especially in Python, where there is one official way to do any elementary > task. And I just want to know what is the normal, official way of prin

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-14 Thread Martin v. Löwis
> It's unfortunate that the default behaviour isn't > optimal at the interactive prompt for some configurations, though. As I said, it's a trade-off. The alternative, if it was the default, wouldn't be optimal at the interactive prompt for some other configurations. In particular, users of non-la

Re: Problem Python 2.6.1 vs 2.6 & pyWin32

2008-12-15 Thread Martin v. Löwis
> I am very disappointed. Help me, please. Try installing Python 2.6.1 "for all users". Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem Python 2.6.1 vs 2.6 & pyWin32

2008-12-15 Thread Martin v. Löwis
>> Try installing Python 2.6.1 "for all users". > > Could you clarify why that's needed? I didn't say it's needed. I said that he should try that, perhaps it helps. > One thing we noticed (I'm not sure has this been yet submitted to > bugs.python.org yet) was that installing packages created wit

Re: Problem Python 2.6.1 vs 2.6 & pyWin32

2008-12-15 Thread Martin v. Löwis
> I noted, also, than, in some cases, Python26.dll is not copied in > %WINDIR%\system32 > After that, external softs don't find the DLL. Right. Only in "for all users" installations, python26.dll is put into system32. In a "just for me" installation, the user is not expected to have permissions to

Re: Problem Python 2.6.1 vs 2.6 & pyWin32

2008-12-16 Thread Martin v. Löwis
> Sorry for not being explicit. With "installer" I meant the binary > Windows installer you create with command "python setup.py > bdist_wininst". In the past we've been able to use > "package-version.win32.exe" files created with Python 2.5 on older > version, but that doesn't seem to be case with

Re: What does the at sign do?

2008-12-16 Thread Martin v. Löwis
> I'm reading a lot of python code lately, django code to be exact, and > I keep bumping into expressions that look like this > @register.filter > > I see nothing importing @register, so I assume it's not just a > function name. That can't be. register must be a bound name - not necessarily an i

Re: Python for amd64 and mingw-w64

2008-12-18 Thread Martin v. Löwis
> - Any extension requires the MS_WIN64 to be defined, but this symbol > is only defined for MS compiler (in PC/pyport.h). Why do you say that? It is only defined when _WIN64 is defined; this has nothing to do with a MS compiler. > Shouldn't it be > defined independantly of the compiler ? You m

[ANN] Python 2.4.6 and 2.5.3 (final)

2008-12-19 Thread Martin v. Löwis
ious major Python releases are available from the Python 2.5 page, at http://www.python.org/2.4/highlights.html http://www.python.org/2.5/highlights.html Enjoy this release, Martin Martin v. Loewis mar...@v.loewis.de Python Release Manager (on behalf of the entire python-dev tea

Re: Python for amd64 and mingw-w64

2008-12-21 Thread Martin v. Löwis
> This is the only problem on python side of things to make extensions > buildable on windows x64 (all the other problems I have encountered so > far to make numpy build with mingw-w64 are numpy's or mingw-w64). Thanks! Martin -- http://mail.python.org/mailman/listinfo/python-list

[ANN] Python 2.5.4 (final)

2008-12-23 Thread Martin v. Löwis
2.5.4, including download links for various platforms, release notes, and known issues, please see: http://www.python.org/2.5.4 Highlights of the previous major Python releases are available from the Python 2.5 page, at http://www.python.org/2.5/highlights.html Enjoy this release, Martin Mar

Re: Python 3 and my Mac (Leopard)

2008-12-26 Thread Martin v. Löwis
Dan wrote: > Is the python community just not interested in Macs? This is fairly close to the truth. The Mac port is currently mostly unmaintained, due to the past contributors having moved on or being occupied by other matters (such as Real Life). I would phrase it vice versa, though: the Mac

Re: strange thing after call PyObject_CallMethod

2009-01-03 Thread Martin v. Löwis
> Why this happenning and who makes Py_INCREF(self)? There are multiple possible explanations, but I think you have ruled out most of them: 1. on_recv might be returning self. So py_result would be the same as self, and hence be an additional reference. However, you said that on_recv raised

Re: Memory debugging tool for Python/C API?

2009-01-04 Thread Martin v. Löwis
> This works, but I'm not sure if PyString...() really makes a new copy of > the data (ellowing me to use free()) See the documentation: http://docs.python.org/c-api/string.html#PyString_FromString # Return a new string object with a *copy* of the string v as value > Another e

Re: Problem building Python 2.5.2 curses module on HP/UX 11.11

2009-01-07 Thread Martin v. Löwis
> So, given that there are no actual errors during the compile, and the > warnings are probably benign, does anyone know what would cause the > resulting compiled module to NOT have the init function? Can you do nm(1) on the module? It's now called _curses_failed.sl Regards, Martin -- http://mail

Re: del behavior 2

2009-01-07 Thread Martin v. Löwis
> I understand that and have seen it too. That's fine. But how do any > of you deal with things that are left open because you did not get a > chance to close them? How do you clean up after the fact? Do you > simply keep track externally the things that need to be cleaned up if > __del__ doesn

Re: del behavior 2

2009-01-07 Thread Martin v. Löwis
> Thanks for the responses. What I mean is when a python process is > interrupted and does not get a chance to clean everything up then what > is a good way to do so? For instance, I have a script that uses child > ptys to facilitate ssh connections (I'm using pxssh). When I ^C the > python proc

Re: How to store passwords?

2009-01-07 Thread Martin v. Löwis
> I'm writing a program in which I will ask users to enter user name and > password once only. It's a console based program that will run on > Windows XP. Actually, I'm trying to provide the similar functionality > as "Remember me" thing in browsers. For that, I will need to store > user name and p

Re: [Python-Dev] compiling python2.5 on linux under wine

2009-01-08 Thread Martin v. Löwis
> i'd just ... much rather be completely independent of proprietary > software when it comes to building free software. I guess my question is then: why do you want to use Windows in the first place? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: ulimit stack size and python threads

2009-01-08 Thread Martin v. Löwis
> Why is Python overloading the meaning of the ulimit -s like this? Why do you think Python is overloading the meaning of that? I ensure you it isn't - it doesn't actively care what the limits are. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: ulimit stack size and python threads

2009-01-08 Thread Martin v. Löwis
> But even if that worked, I'd be worried that python is doing something > bad with the ulimit -s value under the covers. Again: it definitely isn't. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: ulimit stack size and python threads

2009-01-09 Thread Martin v. Löwis
> Always crashing because I asked the OS to please not allow a process > to grow too big is what I call overloading the meaning of ulimit -s. Please trust that there is no explicit code in the Python interpreter that tests whether the stack size is 4GB, and then produces an explicit crash. > It's

Re: ulimit stack size and python threads

2009-01-09 Thread Martin v. Löwis
> I see. I should be blaming the default behavior of pthreads. You shouldn't blame anybody. Instead, you should sit down and study the problem in detail, until you fully understand it. Then you should start contributing fixes. Never ever should you spread blame. Regards, Martin -- http://mail.py

Re: BadZipfile "file is not a zip file"

2009-01-09 Thread Martin v. Löwis
> What would cause a zip file to not have a table of contents? AFAICT, _EndRecData is failing to find the "end of zipfile" structure in the file. You might want debug through it to see where it looks, and how it decides that this structure is not present in the file. Towards 22 bytes before the en

Python 2.5.3: call for patches

2008-10-07 Thread Martin v. Löwis
Within a few weeks, we will release Python 2.5.3. This will be the last bug fix release of Python 2.5, afterwards, future releases of 2.5 will only include security fixes, and no binaries (for Windows or OSX) will be provided anymore (from python.org). In principle, the release will include all ch

Re: [Python-Dev] Python 2.5.3: call for patches

2008-10-07 Thread Martin v. Löwis
> Just to emphasize this, "changes" means "bugfixes". (I'm mentioning this > mainly because of the people who joined for 2.6/3.0.) For more info, > see PEP6 about bugfix releases: > http://www.python.org/dev/peps/pep-0006/ Thanks for clarifying this. For the last 2.5.x release in particular, we

Re: Python pre-release announcements

2008-10-07 Thread Martin v. Löwis
> Is there some policy document or release management guide that could > be updated for release teams to follow on this without needing to have > this discussion every time? It's in PEP 101. If it matters to you, please submit a patch to that document (which is in subversion) to bugs.python.org. I

Re: Compiler, ast and forwards/backwards compatibility

2008-10-08 Thread Martin v. Löwis
> The documentation for the ast module states that it "helps to find out > programmatically what the current grammar looks like". I can't find > any reference (even when reading the code) on how you should go about > this, other than checking the sys.version number and reading up on the > changes.

Re: Compiler, ast and forwards/backwards compatibility

2008-10-08 Thread Martin v. Löwis
> My confusion starts with the fact that I'm not sure if all Python 2.4 > code is going to be syntactically valid 2.6 code. That's not so much a matter of confusion, but of careful research. I *think* all code that is syntactically correct in 2.4 is also syntactically correct in 2.6 - but only be

Re: Quality control in open source development

2008-10-08 Thread Martin v. Löwis
Matimus wrote: > Others have made some pretty > sound arguments around trademarks and such, but I'm going to simply > argue that Python as a community has its own inertia, and it simply > isn't a practical to be concerned about a dubious fork. It simply > wouldn't take off. I think this is indeed

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Martin v. Löwis
>> I say, ignore this advice and disable UAC. > > Fine. Can you then see to it that this is mentioned on the Python > download page? I think Thorsten's advice is helpful (in the sense that it solves the problem, and is IMO pragmatic also), but I *still* wouldn't put it on the Python download page

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Martin v. Löwis
> You can believe what you want. The people who developed UAC don't have > to support it. I know for a fact that the implementation is incomplete. In Windows Installer, there is no way (that I know of) to create an MSI file that conditionally turns on UAC, only when the installation actually need

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Martin v. Löwis
> I posted a problem with Vista on Jul 6 concerning not being > able to run IDLE in 2.6b1. No replies. Where did you post that? On python-dev? > What am I supposed to do? File bug reports on things > I don't even know are bugs? You mean, it might have been intentional that IDLE won't run on Vist

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Martin v. Löwis
> I'm not a developer, just a lowly end user. I'm not in > a position to be able to fix anything. All I can do is > report it and if it's legitimate, then hopefully someone > who knows what he's doing will fix it. Ok. It's then still unfortunate that nobody reported the problem; your message to co

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Martin v. Löwis
>> I know for a fact that the implementation is incomplete. In Windows >> Installer, there is no way (that I know of) to create an MSI file >> that conditionally turns on UAC, only when the installation actually >> needs privilege elevation. > > You cannot turn on (or turn off) UAC for a single ap

Re: PIL on windows XP x64 (64-bit)?

2008-10-12 Thread Martin v. Löwis
Berco Beute wrote: > Investigated this a little more. Since I only needed to resize an > image I thought going through all the hoops of building PIL was too > much effort and took a look at PythonMagick. Turned out I had to build > that myself as well. Am I the first that wants to do image > manipu

Re: Upgrading from 2.5 to 2.6

2008-10-12 Thread Martin v. Löwis
> Are there any guidelines for upgrading from 2.5 to 2.6? Dear Daniel, Python 2.5 and 2.6 can coexist, so there isn't any need for some kind of upgrade procedure. Installing 2.6 will not affect your 2.5 installation. > Do you have to uninstall 2.5, or does the installer do that for you? No. Aft

Re: unicode .replace not working - why?

2008-10-12 Thread Martin v. Löwis
> On a side note, do you really think the function call wouldn't interpret > the unichr before the function call? Dennis' main point was not that you can reuse fn (which he suggested just as performance improvement), but that you need to assign the result of .replace back to textu. Regards, Ma

Re: Upgrading from 2.5 to 2.6

2008-10-13 Thread Martin v. Löwis
> That isn't entirely true. In Windows, python files bound to a > particular version of python in the registry. So, for example, if you > double click on "some_prog.py" to run it, then it will by default > start up using python2.6 once it is installed. Also right-clicking on > a file and selecting

Re: installing python 3.0rc1 on Linux

2008-10-13 Thread Martin v. Löwis
> It seems that the make process cannot find some of the shared > libraries. Is there some way to change the install process ( make, > config files or whatever) to pick up support for these missing > modules?? Yes. It probably has no problem finding the libraries, but, more likely, problems findin

Re: PIL on windows XP x64 (64-bit)?

2008-10-13 Thread Martin v. Löwis
>> Has anybody here got PIL (the Image lib) working on Windows XP x64 (64- >> bit)? There is no version available for that platform from >> pythonware.com. > > Shouldn't your distro maintainers have it in their repositories? You mean, it might be in Microsoft's Open Source Repository? Worth a try

Re: Upgrading from 2.5 to 2.6

2008-10-14 Thread Martin v. Löwis
> I'd say the wording in the installer is unfortunate. The option is > labeled "Register extensions" and for some time I thought it was related > to .pyd/.dll files ("C extensions"), not "Associate .py files to this > Python installation" Unfortunately, I think this is too long for the available s

Re: Installing Python 2.4 over 2.4?

2008-10-14 Thread Martin v. Löwis
W. eWatson wrote: > I suspect something has been corrupted in Python 2.4. Can I just > re-install on top of it On Windows, you shouldn't reinstall, but instead run the "repair" installation, from "Add and remove programs". Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: python3 - the hardest hello world ever ?

2008-10-14 Thread Martin v. Löwis
> do I miss something (I do hope so) or is switching to Python3 > really hard for Latin1-users? Why do you want to switch? sys.stdout.encoding should already be iso-8859-1, if you are a Latin1-user. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing Python 2.4 over 2.4?

2008-10-14 Thread Martin v. Löwis
>> On Windows, you shouldn't reinstall, but instead run the "repair" >> installation, from "Add and remove programs". >> > Do you mean on the Win Control Panel? Yes. > This is, Remove and Add? This question I do not understand. *What* is "Remove and Add"? I'm talking about the "Add or [not an

Re: Installing Python 2.4 over 2.4?

2008-10-15 Thread Martin v. Löwis
> More a generic -- some applications allow one control over optional > features. "Change" would let one, uhm, change the options that were > installed; "repair" attempt to restore the installation to the > configuration that had been "last installed". In the specific case of Python, the typ

Re: python3 - the hardest hello world ever ?

2008-10-15 Thread Martin v. Löwis
> What defines me as latin1-user? That your locale is based on Latin-1, e.g. because it is a German locale. How precisely that works depends on the operating system. > So my system seems to be an ASCII system? At least that's what Python determined. If Python couldn't have found out that you usu

Re: memory use with regard to large pickle files

2008-10-15 Thread Martin v. Löwis
> The program works fine, but the memory load is huge. The size of > the pickle file on disk is about 900 Meg so I would theoretically > expect my program to consume about twice that (the dictionary > contained in the pickle file plus its repackaging into other formats), > but instead my program n

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Martin v. Löwis
> Still, I wished it were possible call sys.setdefaultencoding > at the very beginning of a script. > > Why isn't that possible? The default encoding was used when combining byte-oriented text and unicode-oriented text. Such combination is no longer supported, hence the notion of a default encodi

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Martin v. Löwis
> I meant setting the default encoding which is used by print (e.g.) when > outputting the internal unicode string to a file. Having such a thing would be conceptually wrong. What encoding should be used depends on the file - different files may have different encodings. When opening a file, you n

Re: ImportError in python 2.5 in C API DLL

2008-10-16 Thread Martin v. Löwis
> Would really appreciate any assistance. You should change your project to create a .pyd file instead of a .dll file. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode File Names

2008-10-17 Thread Martin v. Lo
> Step 4: Either wait for Python 2.7 or apply the patch to your own copy > of zipfile ... Actually, this is released in Python 2.6, see r62724. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: crossplatform standalone python apps

2008-10-17 Thread Martin v. Löwis
> I like to create a cross-platform standalone python application, like > Mac OS *.app dirs. The idea is to distribute a zip file containing > everything (the python interpreter and all) so that a user just unzips > it and runs it. I don't think this can possibly work. If the zipfile contains the

Re: inserting Unicode character in dictionary - Python

2008-10-18 Thread Martin v. Löwis
> 2. Exactly what Unicode you get would be dependent on Python properly > interpreting the bytes in the source file -- which you can make it do by > adding something like "-*- coding: utf-8 -*-" in a comment at the top of > the file. That depends on the Python version. Up to (and including) 2.4, t

Re: Unicode File Names

2008-10-18 Thread Martin v. Löwis
> Should the note be removed, or should it say something like "Unicode > file names are supported. New in Python 2.6."? Is there anything else > that should be mentioned? The note should be corrected, documenting the behaviour implemented. > More on cp437: I see where you mentioned to the patch a

Re: Unicode File Names

2008-10-18 Thread Martin v. Löwis
> Oddly, os.getcwd() and os.getcwdu() both still exist in Python 3.0. > Since the behavior is now identical it seems os.getcwdu() should be > dropped. It is dropped, and os.getcwdb() has been added. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: inserting Unicode character in dictionary - Python

2008-10-19 Thread Martin v. Löwis
> Well, the if no encoding is declared, it (quite sensibly) assumes UTF-8, > so for my purposes this boils down to using a UTF-8 editor -- which I > always do anyway. But do I still have to put a "u" before my string > literals in order to have it treated as characters rather than bytes? Yes. >

Re: I want to release the GIL

2008-10-21 Thread Martin v. Löwis
> When I run it, I notice that only one thread works and the other one > never has a chance to run. I guess it is because the thread don't > have a chance to release the GIL This guess is wrong. A call to lock.acquire *does* release the GIL, (as does the call to thread.sleep, as somebody else poi

Re: Unicode (UTF8) in dbhas on 2.5

2008-10-21 Thread Martin v. Löwis
Paul Boddie wrote: > On 20 Okt, 16:04, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> What is the difference? The dbhash module can only work with *bytestrings*. >> Bytestrings are just that - a sequence of 8-bit-values. > > Sounds like a prime candidate for some improvement work. Patches, > any

Re: Unicode (UTF8) in dbhas on 2.5

2008-10-21 Thread Martin v. Löwis
>> Many database engines are encoding-aware, and distinguish between >> 'text' columns and 'blob' columns -- the latter are arbitrary bags >> of bytes, but text columns store text, and a good database (with a >> sensibly designed database) will be aware of this and handle >> encoding and decoding o

Re: Python 2.5.chm problem

2008-10-22 Thread Martin v. Löwis
> When I try to open the 2.5 Python help, I got error message: > "A fájl (mk:@MSITStore:c:\Python25\Doc\Python25.chm) nem nyitható meg." Can you please elaborate what precisely you do to "open the 2.5 Python help"? What operating system are you using, how did you install Python, and where are y

Re: socket and DynDNS

2008-10-22 Thread Martin v. Löwis
> My naive and ugly alternative is to periodically (e.g. every 5 > minutes) do a manual lookup and use the last address. You should look at the TTL of the DNS record, and re-lookup when it expires. There will be *no* kind of protection for UDP messages. When the machine loses its IP address, it w

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Martin v. Löwis
> - In python 3, the C module API now supports true interpreter > independence, but have all the modules in the python codebase been > converted over? No, none of them. > Are they all now truly compliant? It will only take > a single static/global state variable in a module to potentially cause

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Martin v. Löwis
> I would *love* for our company to be 10 times larger and be able to > add another zero to what we'd be able to hire/offer the python dev > community for work that we're looking for, but we unfortunately have > limits at the moment. There is another thing about open source that you need to consid

Re: crossplatform standalone python apps

2008-10-23 Thread Martin v. Löwis
> yes, I know that :-), I ment everything that can be, my problem is more > with PYTHONPATH and stuff like that. Then I don't understand what you meant. What is it (specifically!) that you do, what happens, what do you want to happen instead? Regards, Martin -- http://mail.python.org/mailman/list

Re: 2.6, 3.0, and truly independent intepreters

2008-10-24 Thread Martin v. Löwis
> You seem confused. PEP 3121 is for isolated interpreters (ie emulated > processes), not threading. Just a small remark: this wasn't the primary objective of the PEP. The primary objective was to support module cleanup in a reliable manner, to allow eventually to get modules garbage-collected pr

Re: 2.6, 3.0, and truly independent intepreters

2008-10-24 Thread Martin v. Löwis
>> A c-level module, on the other hand, can sidestep/release >> the GIL at will, and go on it's merry way and process away. > > ...Unless part of the C module execution involves the need do CPU- > bound work on another thread through a different python interpreter, > right? Wrong. > (even if th

Re: 2.6, 3.0, and truly independent intepreters

2008-10-24 Thread Martin v. Löwis
> It seems to me that the very simplest move would be to remove global > static data so the app could provide all thread-related data, which > Andy suggests through references to the QuickTime API. This would > suggest compiling python without thread support so as to leave it up > to the applicatio

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Martin v. Löwis
> If Py_None corresponds to None in Python syntax (sorry I'm not familiar > with Python internals yet; glad you are commenting, since you are), then > it is a fixed constant and could be left global, probably. If None remains global, then type(None) also remains global, and type(None),__bases__[0]

Re: sqlite version for python 2.6

2008-10-25 Thread Martin v. Löwis
> I'd like to know which version of sqlite the python 2.6 sqlite3 module > supports. When you compile Python, you can chose any version of sqlite that you want to. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Martin v. Löwis
>> There are a number of problems with that approach. The biggest one is >> that it is theoretical. > > Not theoretical. Used successfully in Perl. Perhaps it is indeed what Perl does, I know nothing about that. However, it *is* theoretical for Python. Please trust me that there are many many

Re: 2.6, 3.0, and truly independent intepreters

2008-10-26 Thread Martin v. Löwis
>>> As far as I can tell, it seems >>> CPython's current state can't CPU bound parallelization in the same >>> address space. >> That's not true. >> > > Um... So let's say you have a opaque object ref from the OS that > represents hundreds of megs of data (e.g. memory-resident video). How > do y

Re: 2.6, 3.0, and truly independent intepreters

2008-10-27 Thread Martin v. Löwis
Andy O'Meara wrote: > On Oct 24, 9:52 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >>>> A c-level module, on the other hand, can sidestep/release >>>> the GIL at will, and go on it's merry way and process away. >>> ...Unless part

Re: 2.6, 3.0, and truly independent intepreters

2008-10-28 Thread Martin v. Löwis
> Because then we're back into the GIL not permitting threads efficient > core use on CPU bound scripts running on other threads (when they > otherwise could). Why do you think so? For C code that is carefully written, the GIL allows *very well* to write CPU bound scripts running on other threads.

Re: Specifying an IP address for outbound connections?

2008-10-29 Thread Martin v. Löwis
erikcw wrote: > Python seems to default to the main system IP for outbound connections > (such as urllib), but I want to bind to one of my other IPs for > outbound connections. > > Any ideas? Just use the .bind method of a socket to bind it to a specific address. If you then want to continue to u

Re: separate shared libraries or different Linux/Unix

2008-10-29 Thread Martin v. Löwis
> What, in your experiences, is a functionally elegant solution to > installing 2.6 and 3 from source without breaking package dependencies > on your favorite Linux/Unix flavor? Is compiling Python 2.6 and 3.0 on > a *nix development machine and having it work seamlessly as simple as > choosing a p

Re: Why gives "k = 09" a syntax error ?

2008-10-29 Thread Andrii V. Mishkovskyi
2008/10/29 Stef Mientki <[EMAIL PROTECTED]>: > hello, > > Why gives "k = 09" a syntax error ? Because leading zero means that the number is octal, and there is no 9 among octal digits. :) > > thanks, > Stef Mientki > -- > http://mail.python.org/mailman/listinfo/python-list > -- Wbr, Andrii M

Re: 2.6, 3.0, and truly independent intepreters

2008-10-30 Thread Martin v. Löwis
>> Why do you think so? For C code that is carefully written, the GIL >> allows *very well* to write CPU bound scripts running on other threads. >> (please do get back to Jesse's original remark in case you have lost >> the thread :-) >> > > I don't follow you there. If you're referring to multip

Re: Embedding: Is it possible to limit number of virtual instructions executed?

2008-11-01 Thread Martin v. Löwis
> Does anyone have any suggestions for how this could be achieved? You'll have to adjust Python/ceval.c. Look for _Py_Ticker, which provides some fairness for Python threads (releasing the GIL after _Py_CheckInterval instructions). If you decrement another global variable there, you can determine

Re: Simplifying anonymous inner classes?

2008-11-01 Thread Martin v. Löwis
> Is there a more Pythonic way to instantiate sub-classes and provide > instance-specific implementations without the overhead of an unused > "anonymous" class cluttering my code/namespace? I agree with Carl Banks that what you do is already fairly Pythonic: explicit is better than implicit, and s

<    13   14   15   16   17   18   19   20   21   22   >