Re: Should PyImport_ImportModule be threadsafe when importing from zipfiles?

2020-02-21 Thread Geoff Bache
the stacktrace. Thanks for your replies, anyway. /Geoff On Fri, Feb 21, 2020 at 12:25 PM Chris Angelico wrote: > On Fri, Feb 21, 2020 at 8:58 PM Geoff Bache wrote: > > > > But, as I say, I don't have the module loaded beforehand, so caching it > from sys.modules and res

Re: Should PyImport_ImportModule be threadsafe when importing from zipfiles?

2020-02-21 Thread Geoff Bache
s mentioned I can't do that in practice. /Geoff On Thu, Feb 20, 2020 at 6:59 PM Chris Angelico wrote: > On Fri, Feb 21, 2020 at 3:06 AM Geoff Bache wrote: > > > > Hi Chris, > > > > Yes, I've tried both of these things already. I can confirm there are >

Re: Should PyImport_ImportModule be threadsafe when importing from zipfiles?

2020-02-21 Thread Geoff Bache
k I already have a fairly good overview of the symptoms. /Geoff On Fri, Feb 21, 2020 at 9:11 AM Chris Angelico wrote: > On Fri, Feb 21, 2020 at 6:56 PM Geoff Bache wrote: > > > > I'm not sure I understand what you mean by "stick something" there. What > di

Re: Should PyImport_ImportModule be threadsafe when importing from zipfiles?

2020-02-20 Thread Geoff Bache
at 2:37 AM Geoff Bache wrote: > > When several threads execute this simultaneously I often get a stacktrace > > saying some function near the end of module b is not defined, presumably > > because the module has been imported part-initialised. > > This only seems to h

Should PyImport_ImportModule be threadsafe when importing from zipfiles?

2020-02-20 Thread Geoff Bache
a zip file, not when they are ordinary files on disk. I have observed this in both Python 3.7 and Python 3.8. Does anyone have any insights or suggestions for how to debug this? It seems likely to be hard to produce a reproducible test case. Regards, Geoff Bache -- https://mail.python.org/mailma

Re: Access violation in Python garbage collector (visit_decref) - how to debug?

2019-10-08 Thread Geoff Bache
On Tue, Oct 8, 2019 at 7:27 AM dieter wrote: > Geoff Bache writes: > > Yes, this is hard, that's why I'm here :) > > > > I've enabled the equivalent tools to valgrind in Visual Studio, and tried > > setting PYTHONMALLOC=debug, but neither of those seem

Re: Access violation in Python garbage collector (visit_decref) - how to debug?

2019-10-08 Thread Geoff Bache
is a "common idiom", but not common enough to be familiar to me and tricky to be inconsistent. But now I know, and the crash is gone :) Regards and many thanks again, /Geoff On Mon, Oct 7, 2019 at 7:32 PM MRAB wrote: > On 2019-10-07 08:04, Geoff Bache wrote: > > It's possible.

Re: Access violation in Python garbage collector (visit_decref) - how to debug?

2019-10-07 Thread Geoff Bache
t 5, 2019 at 7:22 AM dieter wrote: > Geoff Bache writes: > > ... > > We are running Python embedded in our C++ product and are now > experiencing > > crashes (access violation reading 0xff on Windows) in the Python > > garbage collector. > > Errors

Re: Access violation in Python garbage collector (visit_decref) - how to debug?

2019-10-07 Thread Geoff Bache
efHolder etc are such resource objects as described above, wrapping round the PyObject pointers etc. /Geoff On Fri, Oct 4, 2019 at 9:56 PM MRAB wrote: > On 2019-10-04 20:32, Geoff Bache wrote: > > Hi all, > > > > We are running Python embedded in our C++ product and are now &

Re: Access violation in Python garbage collector (visit_decref) - how to debug?

2019-10-07 Thread Geoff Bache
large" by production standards, only by test data standards. It's about 500kb and not at all deeply nested, basically a long list of dictionaries. But I don't seem to be able to reduce it further either. /Geoff On Fri, Oct 4, 2019 at 9:53 PM Chris Angelico wrote: > On Sat, Oct

Access violation in Python garbage collector (visit_decref) - how to debug?

2019-10-04 Thread Geoff Bache
ish characters in it. It works at least once, and then crashes on the second or third send of the same data. I paste the stacktrace from Python 3.7.4 below. Please let me know how I can debug this further. I'm using Visual Studio 2017 on Windows 10 if that helps. Regards, Geoff Bache >

Re: Problems with imports on multiple threads, with embedded Python

2017-12-21 Thread geoff . bache
On Thursday, 21 December 2017 00:33:54 UTC+1, Lawrence D’Oliveiro wrote: > On Thursday, December 21, 2017 at 5:13:33 AM UTC+13, geoff...@gmail.com wrote: > > > > I have a multithreaded application using an embedded Python 3.6.4 ... > > Avoid multithreading if you can. Is your application CPU-bou

Problems with imports on multiple threads, with embedded Python

2017-12-20 Thread geoff . bache
this line: dt = datetime.strptime(dtStr, fromFmt) which produces AttributeError: module '_strptime' has no attribute '_strptime_datetime' at random. Does anyone have any insight into this problem? Regards, Geoff Bache -- https://mail.python.org/mailman/listinfo/python-list

Re: Buffering of sys.stdout and sys.stderr in python3 (and documentation)

2011-12-10 Thread Geoff Bache
e docs need upgrading, > open an issue on the tracker at bugs.python.org with suggestions as > specific as possible, including changed or new lines of text based on > your experience and experiments. OK, I'll do that if nobody points me at some existing docs here. Regards, Geoff Bache -- http://mail.python.org/mailman/listinfo/python-list

Buffering of sys.stdout and sys.stderr in python3 (and documentation)

2011-12-09 Thread Geoff Bache
seems misleading to me, as it is only relevant if writing to the console. It would be useful to contrast the behaviour with and without "-u" when writing to files I would say. Regards, Geoff Bache -- http://mail.python.org/mailman/listinfo/python-list

Re: Customizing class attribute access in classic classes

2011-10-30 Thread Geoff Bache
ent call last): File "", line 1, in TypeError: method() takes exactly 1 argument (0 given) >>> print a.method(1) answer >>> print A.method(1) answer >>> print a.basemethod() Traceback (most recent call last): File "", line 1, in TypeError: '

Re: Customizing class attribute access in classic classes

2011-10-30 Thread Geoff Bache
On Oct 30, 4:16 am, Ben Finney wrote: > Geoff Bache writes: > > I'm wondering if there is any way to customize class attribute access > > on classic classes? > > Why do that? What is it you're hoping to achieve, and why limit it to > classic classes on

Customizing class attribute access in classic classes

2011-10-29 Thread Geoff Bache
it just a limitation of classic classes? Regards, Geoff Bache -- http://mail.python.org/mailman/listinfo/python-list

Re: Read-write lock for Python

2011-04-29 Thread Geoff Bache
On Fri, Apr 29, 2011 at 12:38 AM, Ryan Kelly wrote: > On Thu, 2011-04-28 at 07:02 -0700, Geoff Bache wrote: >> Hi all, >> >> I currently find myself needing a Python read-write lock. I note that >> there is none in the standard library, but googling "python read-w

Re: Read-write lock for Python

2011-04-28 Thread Geoff Bache
On Thu, Apr 28, 2011 at 7:53 PM, D'Arcy J.M. Cain wrote: > On Thu, 28 Apr 2011 19:14:45 +0200 > Geoff Bache wrote: >> On Thu, Apr 28, 2011 at 4:28 PM, Jean-Michel Pichavant >> wrote: >> > What about >> > >> > http://docs.python.org/library/t

Re: Read-write lock for Python

2011-04-28 Thread Geoff Bache
On Thu, Apr 28, 2011 at 4:28 PM, Jean-Michel Pichavant wrote: > Geoff Bache wrote: >> >> Hi all, >> >> I currently find myself needing a Python read-write lock. I note that >> there is none in the standard library, but googling "python read-write >>

Read-write lock for Python

2011-04-28 Thread Geoff Bache
ays pick a random one and hope for the best, but I was hoping someone here might have a tip for one that has been used and debugged and is likely to work. Regards, Geoff Bache -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding the right Python executable on Windows

2011-01-26 Thread Geoff Bache
On Tue, Jan 25, 2011 at 3:24 PM, Brian Curtin wrote: > On Tue, Jan 25, 2011 at 04:25, Geoff Bache wrote: >> >> Hi all, >> >> I have a Python process on Windows and would like to start a Python >> subprocess using the same interpreter. I wonder how to go abo

Finding the right Python executable on Windows

2011-01-25 Thread Geoff Bache
#x27;t seem to be any standard location for the interpreter under this directory in any case. I feel certain there must be some way to do this as it seems a rather basic thing somehow, can anyone give me a hint? Regards, Geoff Bache -- http://mail.python.org/mailman/listinfo/python-list

Re: A way to get setup.py to create links instead of copy

2010-11-10 Thread Geoff Bache
On Nov 9, 6:33 pm, Steve Holden wrote: > On 11/9/2010 4:18 AM, Geoff Bache wrote: > > > Hi all, > > > One of the things I've always loved about Python (having come from > > compiled languages) was the lack of an extra step between changing my > > code and r

A way to get setup.py to create links instead of copy

2010-11-09 Thread Geoff Bache
't have to install the whole time any more. I wonder if there is some standard way to deal with this situation? Regards, Geoff Bache -- http://mail.python.org/mailman/listinfo/python-list

Re: inspect.getmodulename giving unexpected results

2010-09-24 Thread Geoff Bache
> > Unfortunately, it doesn't seem to do that in some cases. Consider the > > following code: > > It does behave as documented: it does not find package names, or investigate > sys.modules Possibly, although for me "logging" is exposed as a module, and ought to behave as one when requesting the m

inspect.getmodulename giving unexpected results

2010-09-24 Thread Geoff Bache
is some other way to do that? I can naturally write my own method to do this but wondered if I'm missing something here. Regards, Geoff Bache -- http://mail.python.org/mailman/listinfo/python-list

A simpler logging configuration file format?

2009-06-05 Thread geoff . bache
Hi all, I wonder if there are others out there who like me have tried to use the logging module's configuration file and found it bloated and over- complex for simple usage (i.e. a collection of loggers writing to files) At the moment, if I want to add a new logger "foo" writing to its own file "

Problems with background processes on Windows

2009-03-27 Thread geoff . bache
t stdin, stdout and stderr of the child process to os.devnull then it will wait 10 seconds on Linux also, which I'd also expect as we can't collect info from these places if they've been forwarded elsewhere. It seems like Windows somehow doesn't notice this. Any help gratefully appreciated. Regards, Geoff Bache -- http://mail.python.org/mailman/listinfo/python-list