Re: Is setdefaultencoding bad?

2011-02-23 Thread moerchendiser2k3
Ok, but that the interface handles UTF-8 strings are still ok? The defaultencoding is still ascii. -- http://mail.python.org/mailman/listinfo/python-list

Is setdefaultencoding bad?

2011-02-22 Thread moerchendiser2k3
sys.defaultencoding is still ascii. Should I change it in the site.py and turn it to utf-8 or is this not recommended somehow? I often read its highly unrecommended but I can't find an explanation why. Thanks for any hints!! Bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: Python leaks in cyclic garbage collection

2011-02-19 Thread moerchendiser2k3
Thanks for your answers! They really helped me out!! :) -- http://mail.python.org/mailman/listinfo/python-list

Python leaks in cyclic garbage collection

2011-02-18 Thread moerchendiser2k3
Hi, I have some problems with Python and the garbage collection. In the following piece of code I create a simple gargabe collection but I am still wondering why the finalizers are never called - at least on exit of Py they should be called somehow. What do I miss here? I know, there is no

Re: Python leaks in cyclic garbage collection

2011-02-18 Thread moerchendiser2k3
Thanks a lot for any help!!! Bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: Resolve circular reference

2011-01-10 Thread moerchendiser2k3
so there is no chance without using weakrefs? any ideas, tips, workarounds how I might handle this? bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: Resolve circular reference

2011-01-10 Thread moerchendiser2k3
time I have to close and destroy all dialogs but this does not happen because the widget keeps the dialog alive. I have the reference to the dialog but after I closed the dialogs I also would like to destroy them because they have to free some special ressources. Thanks a lot!! Bye, moerchendiser2k3

Re: Resolve circular reference

2011-01-10 Thread moerchendiser2k3
On Jan 10, 7:18 pm, Stefan Behnel stefan...@behnel.de wrote: moerchendiser2k3, 10.01.2011 18:55: If you can tell us why it's so important that the object be destroyed at that given time, even while a reference to it exists, maybe we can give you better suggestions. Thanks for your

Re: Resolve circular reference

2011-01-07 Thread moerchendiser2k3
Force what? j refers to i, i refers to Foo, Foo refers to A. Therefore A should be alive. Oh, sorry. Force the deletion of A. -- http://mail.python.org/mailman/listinfo/python-list

Re: Resolve circular reference

2011-01-07 Thread moerchendiser2k3
Force what? j refers to i, i refers to Foo, Foo refers to A. Therefore A should be alive. Oh, sorry. Force the deletion of instance Foo(A) and Bar(B). -- http://mail.python.org/mailman/listinfo/python-list

Resolve circular reference

2011-01-06 Thread moerchendiser2k3
Hi, I have a small problem with circular references. I embedded Python into my app and I have two types which are flagged with Py_TPFLAGS_BASETYPE so I can inherit Python types from these types. Lets call my C types A and B. Here is the dependency: class Foo(A): e=Bar() class Bar(B):

Get frame object of last called function

2010-11-06 Thread moerchendiser2k3
Hi, is there any chance to get the frame object of the previous called function? I just find the 'f_back' frame object but this is the frame object of the parent function, not the previous one. I try to get the line number of the exit point of the previous function. (0) def Test(): (1)

compile Py2.6 on SL

2010-09-16 Thread moerchendiser2k3
(10.5.8) it works fine. Any ideas? Thanks a lot! Bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: The trouble with dynamic attributes.

2010-09-16 Thread moerchendiser2k3
I am really sorry, but what are you talking about ? Hmmm, ...I have problems to compile Python on SL, I did not ask anything about dynamic attribute. I don't get it... -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Embedding Importing relative modules

2010-07-06 Thread moerchendiser2k3
Set sys.path to include each script's base dir before running it, then restore after each script. That works, but doesnt solve the problem. ScriptA.py has a module in its directory called 'bar.py' ScriptB.py has a module in its directory called 'bar.py' Imagine the 'bar.py' modules dont have

Re: Python Embedding Importing relative modules

2010-07-06 Thread moerchendiser2k3
load the scripts in a row. Thanks for your shoulder I can cry on ;) Bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: Crash in PyThread_acquire_lock

2010-07-05 Thread moerchendiser2k3
Thanks Antoine! :) You were right. It was the wrong thread...uhmm... Bye! :) -- http://mail.python.org/mailman/listinfo/python-list

Python Embedding Importing relative modules

2010-07-05 Thread moerchendiser2k3
in the system path due to security reasons. import sys; sys.path.pop(0) Hope one of you can help me out here. Really thanks!! Bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Crash in PyThread_acquire_lock

2010-07-02 Thread moerchendiser2k3
released by PyStateGIL_Ensure and PyStateGIL_Release. Any ideas how to get rid of this crash somehow? Thanks in advance!! Bye, moerchendiser2k3 #0 0x7fff86c95316 in __semwait_signal () #1 0x7fff86c99131 in _pthread_cond_wait () #2 0x00011c89f8f4 in PyThread_acquire_lock (lock

Extract doc strings

2010-07-01 Thread moerchendiser2k3
Hi all, when I have a PyCodeObject, is there any way to extract a doc string from the code? For instance the following script ---script Hello World! def main(): pass main() /---script--- I would like to get Hello World!. Any chance? Thanks in advance!! Bye, moerchendiser2k3 -- http

Re: Extract doc strings

2010-07-01 Thread moerchendiser2k3
Hi ben, thanks for your answer. Sure, __doc__ is the access point to the docstring, but in this case, I just get the docstring of the code object. So an explanation what a code object, but I need the docstring of real docstring of the script. bye, moerchendiser --

tp_richcompare vs tp_compare

2010-07-01 Thread moerchendiser2k3
help!! Bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: Extract doc strings

2010-07-01 Thread moerchendiser2k3
Great! Thanks a lot! This is what I was looking for. :) Bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: Mark built-in module as deprecated

2010-06-14 Thread moerchendiser2k3
Hi, yes, that was my first idea when I just create an external module. I forgot something to say: In my case the initfoo() function is called on startup in my embedding environment, that means I call that on startup of my main app. Bye, moerchendiser2k3 -- http://mail.python.org/mailman

Mark built-in module as deprecated

2010-06-13 Thread moerchendiser2k3
Hi, can anyone give me a hint how to mark a built-in module as deprecated? So mark via warnings... I create a module with Py_InitModule4. Thanks in advance!! Bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: Mark built-in module as deprecated

2010-06-13 Thread moerchendiser2k3
PyErr_WarnEx(PyExc_DeprecationWarning, foo deprecated. use fuzz, 1); But where can I write this? With Py_InitModule4 I can just pass a list of functions but no real execution part which is executed when a module is imported. -- http://mail.python.org/mailman/listinfo/python-list

Re: Py_single_input and the side-effects...

2010-06-06 Thread moerchendiser2k3
thx, thats it! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Py_single_input and the side-effects...

2010-05-31 Thread moerchendiser2k3
the sources, seems that I cant really free it, because its wrapped somewhere in Py_Finalize() and PyGC_Collect and Py_FreeModules. Any ideas? Thanks a lot! Cheers, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: Py_single_input and the side-effects...

2010-05-31 Thread moerchendiser2k3
Hi Carl, you are right, Python still holds the last reference. I just set a dummy and thats it :) Can you tell me where did you get the information from? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Py_single_input and the side-effects...

2010-05-30 Thread moerchendiser2k3
Hi, any idea? -- http://mail.python.org/mailman/listinfo/python-list

Py_single_input and the side-effects...

2010-05-29 Thread moerchendiser2k3
before. It seems that Py_single_input stores the references somewhere else. Could anyone explain me a little bit what is actually going on here? Thanks a lot! Cheers, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

buffer objects (C-API)

2010-05-12 Thread moerchendiser2k3
. moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

INCREF DECREF manually

2010-05-10 Thread moerchendiser2k3
Hi, just a small question. Is it possible to change the refcount of a reference manually? For debugging / ... Thanks! moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: INCREF DECREF manually

2010-05-10 Thread moerchendiser2k3
Do to some debugging if a version contains a bug and needs to be fixed there manually. -- http://mail.python.org/mailman/listinfo/python-list

Python Embedding, no correct lib

2010-05-05 Thread moerchendiser2k3
explain whats going wrong here. I expected that it just uses the System lib when it cannot find it in the subfolder which I set in the environment variables before.. :-( Any ideas? Thanks a lot for help. Bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Embedding, no correct lib

2010-05-05 Thread moerchendiser2k3
On 6 Mai, 01:30, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Wed, 05 May 2010 09:04:06 -0300, moerchendiser2k3   googler.1.webmas...@spamgourmet.com escribió: I have a serious problem with Python. I am currently trying to implement Python into my app. Well this works fine, but get

Re: Windows installer of Python

2010-04-15 Thread moerchendiser2k3
Hm, I thought there will be installed something like the Microsoft Redistributable 2008 Package to make Python run? -- http://mail.python.org/mailman/listinfo/python-list

Windows installer of Python

2010-04-14 Thread moerchendiser2k3
Hi, can anyone tell me where to find information which files are installed by the Python installer on Windows? I am looking for some special files but dont know how to catch them. Thanks!! moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

C-API: Extract information from function object

2010-03-24 Thread moerchendiser2k3
are written to the traceback. So any suggestions how to do that? Thx!! moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: C-API PyObject_Call

2010-03-19 Thread moerchendiser2k3
In my case I call a funcion and I would like to get the line where the function returned. for instance: def my_function(): return 3 So I would like to get line 2(in C) somehow. -- http://mail.python.org/mailman/listinfo/python-list

Simple lock

2010-03-19 Thread moerchendiser2k3
(this-lock); return this-ptr; } }; Just a question, is this lock redundant, when the Pointer can be set/ get from different threads? Thanks a lot!! Bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: C-API PyObject_Call

2010-03-19 Thread moerchendiser2k3
of them have implemented a special function. So he wouldnt know where to check for the error. Bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: C-API PyObject_Call

2010-03-18 Thread moerchendiser2k3
Funny that you (being the OP) ask *me* what kind of line information *you* want. Stefan Well, I need the line/file information of Python : -- http://mail.python.org/mailman/listinfo/python-list

Re: C-API PyObject_Call

2010-03-17 Thread moerchendiser2k3
1) put the line number information into the message string when you raise the exception you mean the line and file information of the C code, right? -- http://mail.python.org/mailman/listinfo/python-list

C-API PyObject_Call

2010-03-16 Thread moerchendiser2k3
is? Thanks!! moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: C-API PyObject_Call

2010-03-16 Thread moerchendiser2k3
But the stack is empty after PyObject_Call, isnt it? -- http://mail.python.org/mailman/listinfo/python-list

Re: C-API PyObject_Call

2010-03-16 Thread moerchendiser2k3
In one case I have to check the return value of PyObject_Call, and if its not of the correct return value, I throw an exception, but I just get a simple output: TypeError: Expected an instance of XYZ, no int. instead of Traceback (most called...) TypeError: in line 3, file test.py: expected an

Re: C-API PyObject_Call

2010-03-16 Thread moerchendiser2k3
is missing? Bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: C-API PyObject_Call

2010-03-16 Thread moerchendiser2k3
available in which line, file the last called function/method exited. Bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Build Python with XCode

2010-03-15 Thread moerchendiser2k3
Hi, I would like to build Python with Xcode (but without the makefile). Does anyone know a link where I can get a real xcodeproj with the current Py2.x sources? Thanks in advance!! Bye, donnerCobra -- http://mail.python.org/mailman/listinfo/python-list

time_struct

2010-03-07 Thread moerchendiser2k3
Hi, can anyone tell me how to return a time_struct from the timemodule in my own C-Module? Is that possible? I can just find one function in timefuncs.h, but it doesnt return any PyObject. Thanks in advance. moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: time_struct

2010-03-07 Thread moerchendiser2k3
any ideas? -- http://mail.python.org/mailman/listinfo/python-list

Re: C-API: Get scope in function

2010-01-18 Thread moerchendiser2k3
Perfect, this helped me a lot, thx! :) -- http://mail.python.org/mailman/listinfo/python-list

C-API: Get scope in function

2010-01-17 Thread moerchendiser2k3
Hi, I have a small problem how to get the scope from a C-API function. Check out this code snippet: [code] variable = 3 def test(): print variable #output: 3 print globals() # ... 'variable': 3, ... test() [/code In my case I know there is a variable in the scope where this function

Freetype2 in PIL

2009-07-24 Thread moerchendiser2k3
Hi, I have a problem with Freetype2 in the Python Image Library. I compiled it as 64bit and I got a file named freetype239.lib. So I added this file to a folder called lib. I added the parent folder of the lib folder to the setup.py settings (like all the others: libjpeg, zlib). LIbjpeg and Zlib

Freetype2 in PIL

2009-07-24 Thread moerchendiser2k3
Hi, I have a problem with Freetype2 in the Python Image Library. I compiled it as 64bit and I got a file named freetype239.lib. So I added this file to a folder called lib. I added the parent folder of the lib folder to the setup.py settings (like all the others: libjpeg, zlib). LIbjpeg and Zlib

PIL for OSX 64bit

2009-07-21 Thread moerchendiser2k3
Hi, I have a problem with Python and the Python Image Library to get it work on OSX 64 bit. Maybe anyone can help me? I started Python in 64 bit mode and called Image.open(...).load() and got: ImportError: The _imaging C module is not installed Yes, it seems PIL is not available in 64 bit on my