pytest-timeout 0.4

2014-08-08 Thread Floris Bruynooghe
Hi, I'm pleased to announce the availability of pytest-timeout 0.4: https://pypi.python.org/pypi/pytest-timeout/0.4 pytest-timeout is a plugin for the py.test testing framework which will interrupt hanging tests after a timeout and show stack traces for all threads at this time. This can

[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2014-07-17 Thread Floris Bruynooghe
Floris Bruynooghe added the comment: Oops, I've kicked the bruynooghe-solaris-csw buildslave and it should now be building again. A bit disappointed that buildbot/twisted doesn't reconnect automatically though. -- ___ Python tracker rep

[issue20671] test_create_at_shutdown_with_encoding() of test_io hangs on SPARC Solaris 10 OpenCSW 3.x

2014-02-21 Thread Floris Bruynooghe
Floris Bruynooghe added the comment: Turns out that the timeout is configured in the buildmaster's master.cfg which Antoine Pitrou has kindly done. It should also run tests a bit more parallel now which will hopefully reduce the 10h runtime a bit, but it remains a slow box. -- nosy

[issue15643] Support OpenCSW in setup.py

2012-08-13 Thread Floris Bruynooghe
New submission from Floris Bruynooghe: This patch proposes to add out of the box support for building against OpenCSW libraries on Solaris. It makes building all the extension modules a lot simpler since the CSW repositories provide almost all required libaries. The order of preference

[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2012-08-12 Thread Floris Bruynooghe
Floris Bruynooghe added the comment: I have no issue with changing the buildhost's zone configuration if that's the right thing to do. Just one more option. Is widening the expected errno in the test a valid thing to do? -- ___ Python tracker rep

[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2012-08-10 Thread Floris Bruynooghe
New submission from Floris Bruynooghe: The SPARC Solaris 10 OpenCSW 3.x builder fails with == FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer

[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2012-08-10 Thread Floris Bruynooghe
Floris Bruynooghe added the comment: It was my understanding that this is what the AI_ADDRCONFIG flag is for, if you don't use it you have no such guarantee. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15617

[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2012-08-10 Thread Floris Bruynooghe
Floris Bruynooghe added the comment: I think this is influenced by what you have in /etc/hosts. On my laptop I also have IPv6 loopback as well as an IPv6 link-local on eth0. But I have both 127.0.0.1 and ::1 in /etc/hosts as locahost. With that configuration I get the same getaddrinfo results

[issue15589] Bus error on Debian sparc

2012-08-08 Thread Floris Bruynooghe
Floris Bruynooghe added the comment: Running on Solaris 10 (T1000, OpenCSW toolchain, gcc 4.6.3) I also get a bus error, with added coredump: $ ./python Lib/test/regrtest.py == CPython 3.3.0b1 (default:67a994d5657d, Aug 8 2012, 21:43:48) [GCC 4.6.3] == Solaris-2.10-sun4v-sparc-32bit big

[issue15589] Bus error on Debian sparc

2012-08-08 Thread Floris Bruynooghe
Floris Bruynooghe added the comment: I compiled with a simple ./configure which I think is what you mean (it defaults to -O3). But when executing your test it doesn't give a bus error. -- ___ Python tracker rep...@bugs.python.org http

[issue15589] Bus error on Debian sparc

2012-08-08 Thread Floris Bruynooghe
Floris Bruynooghe added the comment: I think I can confirm this fixes the BusError. The test suite got past test_capi on my machine as well. Unfortunately I killed the ssh session by accident before the testsuite completed so I had to restart

[issue15589] Bus error on Debian sparc

2012-08-08 Thread Floris Bruynooghe
Floris Bruynooghe added the comment: I can now confirm the whole testsuite runs, so the BusError part seems fixed on my host: 329 tests OK. 7 tests failed: test_cmd_line test_exceptions test_ipaddress test_os test_raise test_socket test_traceback 1 test altered the execution

[issue8881] socket.getaddrinfo() should return named tuples

2012-07-07 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: Attached in a patch for this, I've also changed the version to 3.4 since this is a feature and therefore probably too late to go in 3.3. Please let me know if anything is inadequate. -- keywords: +patch versions

[issue14290] Importing script as module causes ImportError with pickle.load

2012-07-07 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: Hi, I think this is a usage error and if not you should try to provide a test case with both files for this. Pickle needs to be able to import the module which contains the classes by the same name as the original module

[issue8881] socket.getaddrinfo() should return named tuples

2012-01-13 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: I think the part which could possibly a problem is addressed in http://hg.python.org/cpython/rev/384f73a104e9/. Bearing in mind that direct usage for string interpolation is a pretty strange use for the result of getaddrinfo

[issue1975] signals not always delivered to main thread, since other threads have the signal unmasked

2012-01-11 Thread Floris Bruynooghe
Changes by Floris Bruynooghe floris.bruynoo...@gmail.com: -- nosy: +flub ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1975 ___ ___ Python-bugs

Re: Need some IPC pointers

2011-12-06 Thread Floris Bruynooghe
I'm surprised no one has mentioned zeromq as transport yet. It provides scaling from in proc (between threads) to inter-process and remote machines in a fairly transparent way. It's obviously not the python stdlib and as any system there are downsides too. Regards, Floris --

[issue13338] Not all enumerations used in _Py_ANNOTATE_MEMORY_ORDER

2011-11-06 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: Apologies for not attaching a patch, I thought it was pretty trivial. Attached it now. -- keywords: +patch Added file: http://bugs.python.org/file23616/pyatomic.diff ___ Python

[issue13338] Not all enumerations used in _Py_ANNOTATE_MEMORY_ORDER

2011-11-03 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: Hi, When compiling using gcc and -Werror=switch-enum the compilation fails, e.g. while compiling an extension module: In file included from /usr/include/python3.2mu/Python.h:52:0, from src/util.c:27: /usr

[issue12419] Add ident parameter to SysLogHandler

2011-06-27 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: It would be nice if the SysLogHandler also accepted an ident parameter in line with the syslog.openlog() function. This simply prepends the string passed in as ident to each log message which currently needs to be implemented

[issue12419] Add ident parameter to SysLogHandler

2011-06-27 Thread Floris Bruynooghe
Changes by Floris Bruynooghe floris.bruynoo...@gmail.com: -- nosy: +vinay.sajip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12419 ___ ___ Python

[issue12419] Add ident parameter to SysLogHandler

2011-06-27 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: That was quick, thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12419

Condition.wait(timeout) oddities

2011-05-23 Thread Floris Bruynooghe
Hi all I'm a little confused about the corner cases of Condition.wait() with a timeout parameter in the threading module. When looking at the code the first thing that I don't quite get is that the timeout should never work as far as I understand it. .wait() always needs to return while

Re: Condition.wait(timeout) oddities

2011-05-23 Thread Floris Bruynooghe
On Monday, 23 May 2011 17:32:19 UTC, Chris Torek wrote: In article 94d1d127-b423-4bd4...@glegroupsg2000goo.googlegroups.com Floris Bruynooghe comp.lan...@googlegroups.com wrote: I'm a little confused about the corner cases of Condition.wait() with a timeout parameter in the threading module

[issue3526] Customized malloc implementation on SunOS and AIX

2011-04-29 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: On 29 April 2011 17:16, Antoine Pitrou rep...@bugs.python.org wrote: Antoine Pitrou pit...@free.fr added the comment: Yes, I was probably not clear: When --with-dlmalloc is activated, PyMem_MALLOC/PyMem_Malloc will call

[issue3526] Customized malloc implementation on SunOS and AIX

2011-04-26 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: So by using dlmalloc on SunOS and AIX you would get the same level of performance for memory operations that you already probably can appreciate on Linux systems. Yes, but with the above trick, you can do that without

Re: Twisted and txJSON-RPC

2011-03-21 Thread Floris Bruynooghe
On Sunday, April 11, 2010 5:04:49 PM UTC+1, writeson wrote: I get an error message: error: docs/PRELUDE.txt: No such file or directory The setup.py code is trying to be too clever and the released package is missing files it requires. The easiest way to fix it is to simply get the latests

[issue5672] Implement a way to change the python process name

2010-12-29 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: There are actually a few implementations on pypi, just search for prctl. At least one of them is pretty decent IIRC but I can't remember which one I looked at in detail before. Anyway, they would certainly be a reasonable

[issue3526] Customized malloc implementation on SunOS and AIX

2010-10-18 Thread Floris Bruynooghe
Changes by Floris Bruynooghe floris.bruynoo...@gmail.com: -- nosy: +flub ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3526 ___ ___ Python-bugs

[issue9912] Fail when vsvarsall.bat produces stderr

2010-09-21 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: It would have saved me a lot of time if msvc9compiler would fail if executing the vsvarsall.bat file produced any output. The attached patch does this and fails when I try to compile from within a cygwin environment. I've

[issue9912] Fail when vsvarsall.bat produces stderr

2010-09-21 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: I'm aware of that but my limited testing showed that in this case that doesn't happen. However if this is considered too brittle to just plain fail as soon as there's stderr, how about using distutils' log facility to log

[issue9912] Fail when vsvarsall.bat produces stderr

2010-09-21 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: msvc9_log.diff does log stderr at warning level when it occurs. -- Added file: http://bugs.python.org/file18961/msvc9_log.diff ___ Python tracker rep...@bugs.python.org http

[issue9608] Re-phrase best way of using exceptions in doanddont.rst

2010-08-15 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: The description of how to best use exceptions is slightly confusing and led me to believe there was an issue when using open() as a context manager. The main issue is that the wording seems to suggest the example above

Re: How to read source code of python?

2010-06-10 Thread Floris Bruynooghe
On Jun 10, 8:55 am, Thomas Jollans tho...@jollans.com wrote: On 06/10/2010 07:25 AM, Qijing Li wrote: Thanks for your reply. I'm trying to understand python language deeply and  use it efficiently. For example: How the operator in works on list? the running time is be O(n)?  if my list

[issue8906] Document TestCase attributes in class docstring

2010-06-05 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: The unittest.TestCase class has some public attributes: failureException, longMessage and maxDiff. They each have a description in a comment, but I think it would be good if that description got moved into the class docstring

[issue8351] Suppress large diffs in unitttest.TestCase.assertSequenceEqual()

2010-04-08 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: This patch adds the ability to suppress large diffs in the failure message of TestCase.assertSequenceEqual(). The maximum size of the diff is customisable as an new keyword parameter with hopefully a sensible default

Re: converting a timezone-less datetime to seconds since the epoch

2010-04-07 Thread Floris Bruynooghe
On Apr 7, 9:57 am, Chris Withers ch...@simplistix.co.uk wrote: Chris Rebert wrote: To convert from struct_time in ***UTC*** to seconds since the epoch use calendar.timegm() ...and really, wtf is timegm doing in calendar rather than in time? ;-) You're not alone in finding this strange:

Re: Queue peek?

2010-03-03 Thread Floris Bruynooghe
On Mar 2, 6:18 pm, Raymond Hettinger pyt...@rcn.com wrote: On Mar 2, 8:29 am, Veloz michaelve...@gmail.com wrote: Hi all I'm looking for a queue that I can use with multiprocessing, which has a peek method. I've seen some discussion about queue.peek but don't see anything in the docs

Ad hoc lists vs ad hoc tuples

2010-01-27 Thread Floris Bruynooghe
One thing I ofter wonder is which is better when you just need a throwaway sequence: a list or a tuple? E.g.: if foo in ['some', 'random', 'strings']: ... if [bool1, bool2, boo3].count(True) != 1: ... (The last one only works with tuples since python 2.6) Is a list or tuple better or

Re: Ad hoc lists vs ad hoc tuples

2010-01-27 Thread Floris Bruynooghe
On Jan 27, 10:15 pm, Terry Reedy tjre...@udel.edu wrote: On 1/27/2010 12:32 PM, Antoine Pitrou wrote: Le Wed, 27 Jan 2010 02:20:53 -0800, Floris Bruynooghe a écrit : Is a list or tuple better or more efficient in these situations? Tuples are faster to allocate (they are allocated in one

Re: Install script under a different name

2009-12-05 Thread Floris Bruynooghe
On Dec 5, 1:52 am, Lie Ryan lie.1...@gmail.com wrote: on linux/unix, you need to add the proper #! line to the top of any executable scripts and of course set the executable bit permission (chmod +x scriptname). In linux/unix there is no need to have the .py extension for a file to be

Re: question about subprocess and shells

2009-12-05 Thread Floris Bruynooghe
On Dec 4, 9:38 pm, Ross Boylan r...@biostat.ucsf.edu wrote: If one uses subprocess.Popen(args, ..., shell=True, ...) When args finishes execution, does the shell terminate?  Either way seems problematic. Essentially this is executing /bin/sh args so if you're unsure as to the behaviour just

Re: Bored.

2009-12-01 Thread Floris Bruynooghe
On Nov 30, 11:52 pm, Stef Mientki stef.mien...@gmail.com wrote: Well I thought that after 2 years you would know every detail of a language ;-) Ouch, I must be especially stupid then! ;-) Floris -- http://mail.python.org/mailman/listinfo/python-list

[issue7407] Minor Queue doc improvement

2009-11-29 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: The documentation of the queue module (Queue in 2.x) does not mention that the constructors have a default argument of 0 for maxsize. The trivial patch adds this (patch against py3k trunk). -- assignee: georg.brandl

Re: how to create a pip package

2009-11-10 Thread Floris Bruynooghe
On Nov 10, 2:30 pm, Phlip phlip2...@gmail.com wrote: On Nov 10, 1:54 am, Wolodja Wentland wentl...@cl.uni-heidelberg.de wrote: http://docs.python.org/library/distutils.html#module-distutils http://packages.python.org/distribute/ ktx... now some utterly retarded questions to prevent false

[issue5672] Implement a way to change the python process name

2009-07-14 Thread Floris Bruynooghe
Changes by Floris Bruynooghe floris.bruynoo...@gmail.com: -- nosy: +flub ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5672 ___ ___ Python-bugs

Re: Best Way to Handle All Exceptions

2009-07-13 Thread Floris Bruynooghe
On Jul 13, 2:26 pm, seldan24 selda...@gmail.com wrote: The first example: from ftplib import FTP try:     ftp = FTP(ftp_host)     ftp.login(ftp_user, ftp_pass) except Exception, err:     print err *If* you really do want to catch *all* exceptions (as mentioned already it is usually better

Re: Where does setuptools live?

2009-07-04 Thread Floris Bruynooghe
On Jul 4, 4:50 pm, David Wilson d...@botanicus.net wrote: I'm trying to create a patch for a diabolical issue I keep running into, but I can't seem to find the setuptools repository. Is it this one?    http://svn.python.org/view/sandbox/trunk/setuptools/ It is, see

[issue6405] Redundant redeclarations in descrobject.h

2009-07-03 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: There are redundant redeclarations for PyGetSetDescr_Type and PyMemberDescr_Type in descrobject.h. This is an issue when compiling an extension module with the -Wredundant-decls flag: In file included from /usr/local/include

[issue6336] nb_divide missing in docs

2009-06-24 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: http://docs.python.org/c-api/typeobj.html#number-object-structures is missing the entry for nb_divide, this is confusing. -- assignee: georg.brandl components: Documentation messages: 89664 nosy: flub, georg.brandl

Re: multi-thread python interpreaters and c++ program

2009-06-10 Thread Floris Bruynooghe
On Jun 9, 6:50 am, myopc my...@aaa.com wrote:   I am ruuning a c++ program (boost python) , which create many python interpreaters and each run a python script with use multi-thread (threading). when the c++ main program exit, I want to shut down python interpreaters, but it crashed. Your

[issue5201] Using LDFLAGS='-rpath=\$$LIB:/some/other/path' ./configure breaks the build

2009-06-10 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: Hi What's the status of this? I haven't seen a commit message regarding this. Cheers -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5201

[issue1856] shutdown (exit) can hang or segfault with daemon threads running

2009-06-03 Thread Floris Bruynooghe
Changes by Floris Bruynooghe floris.bruynoo...@gmail.com: -- nosy: +flub ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1856 ___ ___ Python-bugs

[issue5201] Using LDFLAGS='-rpath=\$$LIB:/some/other/path' ./configure breaks the build

2009-05-12 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: Oh, sorry about the super() that is why the ar test failed then. Sorry, I got a little confused by the conflicting update on that file while working on this patch and must have merged it badly

[issue5998] Add __bool__ to threading.Event and multiprocessing.Event

2009-05-11 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: I think it would allow for more pythonic code if the threading.Event and multiprocessing.Event classes had the __bool__ special attribute. This would allow doing if e: ... instead of if e.is_set(): This could be backported

[issue5201] Using LDFLAGS='-rpath=\$$LIB:/some/other/path' ./configure breaks the build

2009-05-11 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: The updated patch inserts the single $ when needed. I've checked this on compiling python, stdlib extension modules and custom extension modules and this gives the correct results in all cases. -- Added file: http

[issue5991] Add non-command help topics to help completion of cmd.Cmd

2009-05-10 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: The cmd.Cmd module has a default complete_help() method which will complete all existing commands (methods starting with do_). It would be useful to complete all exising help topics too by default, i.e. all methods starting

[issue5941] customize_compiler broken

2009-05-06 Thread Floris Bruynooghe
Changes by Floris Bruynooghe floris.bruynoo...@gmail.com: -- nosy: +flub ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5941 ___ ___ Python-bugs

[issue5900] Ensure RUNPATH is added to extension modules with RPATH if GNU ld is used

2009-05-04 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: I'm not convinced that would help much. The GNULD variable in the makefile is for when the default linker is used. If you change that by using LDSHARED then you're probably not going to be using --rpath but LDFLAGS to configure

[issue5201] Using LDFLAGS='-rpath=\$$LIB:/some/other/path' ./configure breaks the build

2009-05-02 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: The attached patch does fix this issue. Concerning the specific example of LDFLAGS used here there is still and issue with LDFLAGS being ignored by the buid for the shared modules, but that is an other issue. -- keywords

[issue5201] Using LDFLAGS='-rpath=\$$LIB:/some/other/path' ./configure breaks the build

2009-05-02 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: Hmm, the patch isn't quite right yet. When a $$ is present in the makefile .parse_makefile() needs to return a single $. I'm not sure yet what needs to happen with the \ for the shell escape

[issue5900] Ensure RUNPATH is added to extension modules with RPATH if GNU ld is used

2009-05-01 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: The build_ext command does accept a handy --rpath option to encode an RPATH in the built extension modules. However RPATH is superseded by RUNPATH since the former can not be overwritten by the LD_LIBRARY_PATH environment

[issue5854] logging module's __all__ attribute not in sync with documentation

2009-04-27 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: The logging module in Python 2.6 has started to use the __all__ method. However it does not list all the symbols that are described in the documentation. Most notably the getLogger function is not in the __all__ list

[issue5726] ld_so_aix does exit successfully even in case of failure

2009-04-09 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: ld_so_aix is used to invoke the linker correctly on AIX. However when the linking fails the script happily returns 0 and a Makefile using it will assume all went well. See the trivial patch attached. -- components

Re: Python C API String Memory Consumption

2009-04-07 Thread Floris Bruynooghe
On Apr 7, 2:10 pm, John Machin sjmac...@lexicon.net wrote: On Apr 7, 9:19 pm, MRAB goo...@mrabarnett.plus.com wrote: k3xji wrote: Interestaing I changed malloc()/free() usage with PyMem_xx APIs and the problem resolved. However, I really cannot understand why the first version does

Re: PEP 3143: Standard daemon process library

2009-03-24 Thread Floris Bruynooghe
On Mar 21, 11:06 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: Floris Bruynooghe floris.bruynoo...@gmail.com writes: Had a quick look at the PEP and it looks very nice IMHO. Thank you. I hope you can try the implementation and report feedback on that too. One of the things that might

Re: distutils compiler flags for extension modules

2009-03-20 Thread Floris Bruynooghe
On Mar 20, 9:48 am, Christian Meesters meest...@gmx.de wrote: as I got no answers with the previous question (subject: disabling compiler flags in distutils), I thought I should ask the question in a different way: Is there an option to set the compiler flags for a C/C++ extension in

Re: PEP 3143: Standard daemon process library (was: Writing a well-behaved daemon)

2009-03-20 Thread Floris Bruynooghe
On Mar 20, 9:58 am, Ben Finney ben+pyt...@benfinney.id.au wrote: Ben Finney b...@benfinney.id.au writes: Writing a Python program to become a Unix daemon is relatively well-documented: there's a recipe for detaching the process and running in its own process group. However, there's much

[issue1785] inspect gets broken by some descriptors

2009-02-18 Thread Floris Bruynooghe
Changes by Floris Bruynooghe floris.bruynoo...@gmail.com: -- nosy: +flub ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1785 ___ ___ Python-bugs

Re: memory recycling/garbage collecting problem

2009-02-17 Thread Floris Bruynooghe
On Feb 17, 5:31 am, Chris Rebert c...@rebertia.com wrote: My understanding is that for efficiency purposes Python hangs on to the extra memory even after the object has been GC-ed and doesn't give it back to the OS right away. Even if Python would free() the space no more used by it's own

Re: Pythonic way to determine if a string is a number

2009-02-17 Thread Floris Bruynooghe
On Feb 16, 12:05 am, Mel mwil...@the-wire.com wrote: Christian Heimes wrote: Roy Smith wrote: They make sense when you need to recover from any error that may occur, possibly as the last resort after catching and dealing with more specific exceptions. In an unattended embedded system

Re: Pythonic way to determine if a string is a number

2009-02-17 Thread Floris Bruynooghe
On Feb 16, 7:09 am, Python Nutter pythonnut...@gmail.com wrote: silly me, forgot to mention build a set from digits + '.' and use that for testing. `.' is locale dependent. Some locales might use `,' instead and maybe there's even more out there that I don't know of. So developing this

[issue5201] Using LDFLAGS='-rpath=\$$LIB:/some/other/path' ./configure breaks the build

2009-02-10 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: When specifying an RPATH with -rpath or -R you can use the special tokens `$LIB' and `$ORIGIN' which the runtime linker interprets as normal search path and relative to current sofile respectively. To get these correctly

Re: x64 speed

2009-02-04 Thread Floris Bruynooghe
On Feb 4, 10:14 am, Robin Becker ro...@reportlab.com wrote: [rpt...@localhost tests]$ time python25 runAll.py . . -- Ran 193 tests in

[issue4908] adding a get_metadata in distutils

2009-01-30 Thread Floris Bruynooghe
Changes by Floris Bruynooghe floris.bruynoo...@gmail.com: -- nosy: +flub ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4908 ___ ___ Python-bugs

Overriding base class methods in the C API

2009-01-18 Thread Floris Bruynooghe
Hello I've been trying to figure out how to override methods of a class in the C API. For Python code you can just redefine the method in your subclass, but setting tp_methods on the type object does not seem to have any influcence. Anyone know of a trick I am missing? Cheers Floris --

[issue4950] Redundant declaration in pyerrors.h

2009-01-14 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: When compiling with -Wredundant-decls gcc spots a redundant declaration: f...@laurie:sandbox$ cat test.c #include Python.h #include stdio.h int main(void) { printf(hello\n); return 0; } f...@laurie:sandbox$ gcc

Using exceptions in defined in an extension module inside another extension module

2008-12-24 Thread Floris Bruynooghe
Hello If I have an extension module and want to use an exception I can do by declaring the exception as extern PyObject *PyExc_FooError in the object files if I then link those together inside a module where the module has them declared the same (but no extern) and then initialises them in the

Re: Using exceptions in defined in an extension module inside another extension module

2008-12-24 Thread Floris Bruynooghe
Christian Heimes wrote: Floris Bruynooghe schrieb: What I can't work out however is how to then be able to raise this exception in another extension module. Just defining it as extern doesn't work, even if I make sure the first module -that creates the exception- gets loaded first

Re: C API and memory allocation

2008-12-18 Thread Floris Bruynooghe
On Dec 18, 6:43 am, Stefan Behnel stefan...@behnel.de wrote: Floris Bruynooghe wrote: I'm slightly confused about some memory allocations in the C API. If you want to reduce the number of things you have to get your head around, learn Cython instead of the raw C-API. It's basically Python

C API and memory allocation

2008-12-17 Thread Floris Bruynooghe
Hi I'm slightly confused about some memory allocations in the C API. Take the first example in the documentation: static PyObject * spam_system(PyObject *self, PyObject *args) { const char *command; int sts; if (!PyArg_ParseTuple(args, s, command)) return NULL; sts =

Re: C API and memory allocation

2008-12-17 Thread Floris Bruynooghe
Hello again On Dec 17, 11:06 pm, Floris Bruynooghe floris.bruynoo...@gmail.com wrote: So I'm assuming PyArg_ParseTuple() must allocate new memory for the returned string.  However there is nothing in the API that provides for freeing that allocated memory again. I've dug a little deeper

[issue4483] Error to build _dbm module during make

2008-12-06 Thread Floris Bruynooghe
Floris Bruynooghe [EMAIL PROTECTED] added the comment: Hi, I'd like to confirm that Skip's last patch fixes the issue. Hope it gets included soon! Thanks -- nosy: +flub ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4483

Re: C Module question

2008-11-10 Thread Floris Bruynooghe
Hi On Nov 10, 11:11 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: 1. How can I pass a file-like object into the C part? The PyArg_* functions can convert objects to all sort of types, but not FILE*. Parse it as a generic PyObject object (format string of O in PyArg_*), check the type and cast

Re: C Module question

2008-11-10 Thread Floris Bruynooghe
On Nov 10, 1:18 pm, Floris Bruynooghe [EMAIL PROTECTED] wrote: On Nov 10, 11:11 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: 1. How can I pass a file-like object into the C part? The PyArg_* functions can convert objects to all sort of types, but not FILE*. Parse it as a generic

Re: Logging thread with Queue and multiple threads to log messages

2008-11-10 Thread Floris Bruynooghe
Hi On Nov 9, 8:28 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I am trying to put up a queue (through a logging thread) so that all worker threads can ask it to log messages. There is no need to do anything like this, the logging module is thread safe and you can happily just create loggers

Re: Module clarification

2008-07-28 Thread Floris Bruynooghe
On Jul 28, 9:54 am, Hussein B [EMAIL PROTECTED] wrote: Hi. I'm a Java guy and I'm playing around Python these days... In Java, we organize our classes into packages and then jarring the packages into JAR files. What are modules in Python? An importable or runable (i.e. script) collection of

lxml validation and xpath id function

2008-06-30 Thread Floris Bruynooghe
Hi I'm trying to use the .xpath('id(foo)') function on an lxml tree but can't get it to work. Given the following XML: rootchild id=foo//root And it's XMLSchema: ?xml version=1.0 encoding=UTF-8? xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; elementFormDefault=qualified xs:element

Context manager for files vs garbage collection

2008-06-16 Thread Floris Bruynooghe
Hi I was wondering when it was worthwil to use context managers for file. Consider this example: def foo(): t = False for line in file('/tmp/foo'): if line.startswith('bar'): t = True break return t What would the benefit of using a context manager

Re: Running commands on cisco routers using python

2008-05-20 Thread Floris Bruynooghe
On May 19, 4:18 pm, SPJ [EMAIL PROTECTED] wrote: Is it possible to run specific commands on cisco router using Python? I have to run command show access-list on few hundred cisco routers and get the dump into a file. Please let me know if it is feasible and the best way to achieve this.

Re: How to kill Python interpreter from the command line?

2008-05-09 Thread Floris Bruynooghe
On May 9, 11:19 am, [EMAIL PROTECTED] wrote: Thanks for the replies. On May 8, 5:50 pm, Jean-Paul Calderone [EMAIL PROTECTED] wrote: Ctrl+C often works with Python, but as with any language, it's possible to write a program which will not respond to it.  You can use Ctrl+\ instead

Re: @x.setter property implementation

2008-04-11 Thread Floris Bruynooghe
On Apr 11, 10:16 am, Floris Bruynooghe [EMAIL PROTECTED] wrote: On Apr 10, 5:09 pm, Arnaud Delobelle [EMAIL PROTECTED] wrote: On Apr 10, 3:37 pm, Floris Bruynooghe [EMAIL PROTECTED] wrote: On Apr 7, 2:19 pm, Andrii V. Mishkovskyi [EMAIL PROTECTED] wrote: 2008/4/7, Floris

Re: @x.setter property implementation

2008-04-11 Thread Floris Bruynooghe
On Apr 10, 5:09 pm, Arnaud Delobelle [EMAIL PROTECTED] wrote: On Apr 10, 3:37 pm, Floris Bruynooghe [EMAIL PROTECTED] wrote: On Apr 7, 2:19 pm, Andrii V. Mishkovskyi [EMAIL PROTECTED] wrote: 2008/4/7, Floris Bruynooghe [EMAIL PROTECTED]: Have been grepping all over the place

Re: @x.setter property implementation

2008-04-11 Thread Floris Bruynooghe
Oh, that was a good hint! See inline On Apr 11, 12:02 pm, Arnaud Delobelle [EMAIL PROTECTED] wrote: On Apr 11, 11:19 am, Floris Bruynooghe [EMAIL PROTECTED] wrote: [...] Unfortunatly both this one and the one I posted before work when I try them out on the commandline but both fail

Re: @x.setter property implementation

2008-04-10 Thread Floris Bruynooghe
On Apr 7, 2:19 pm, Andrii V. Mishkovskyi [EMAIL PROTECTED] wrote: 2008/4/7, Floris Bruynooghe [EMAIL PROTECTED]: Have been grepping all over the place and failed to find it. I found the test module for them, but that doesn't get me very far... I think you should take a look

Re: @x.setter property implementation

2008-04-07 Thread Floris Bruynooghe
On Apr 6, 6:41 pm, Daniel Fetchinson [EMAIL PROTECTED] wrote: I found out about the new methods on properties, .setter() and .deleter(), in python 2.6. Obviously that's a very tempting syntax and I don't want to wait for 2.6... It would seem this can be implemented entirely in python

@x.setter property implementation

2008-04-06 Thread Floris Bruynooghe
Hello I found out about the new methods on properties, .setter() and .deleter(), in python 2.6. Obviously that's a very tempting syntax and I don't want to wait for 2.6... It would seem this can be implemented entirely in python code, and I have seen hints in this directrion. So before I go

Ignoring windows registry PythonPath subkeys

2008-04-04 Thread Floris Bruynooghe
Hi We basically want the same as the OP in [1], i.e. when python starts up we don't want to load *any* sys.path entries from the registry, including subkeys of the PythonPath key. The result of that thread seems to be to edit PC/getpathp.c[2] and recompile. This isn't that much of a problem

Re: Any fancy grep utility replacements out there?

2008-04-04 Thread Floris Bruynooghe
On Mar 19, 2:44 am, Peter Wang [EMAIL PROTECTED] wrote: On Mar 18, 5:16 pm, Robert Kern [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: So I need to recursively grep a bunch of gzipped files. This can't be easily done with grep, rgrep or zgrep. (I'm sure given the right

Re: How to send a var to stdin of an external software

2008-03-14 Thread Floris Bruynooghe
On Mar 14, 11:37 am, Benjamin Watine [EMAIL PROTECTED] wrote: Bryan Olson a écrit : I wrote: [...] Pipe loops are tricky business. Popular solutions are to make either the input or output stream a disk file, or to create another thread (or process) to be an active reader or writer.

  1   2   >