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
Hi Chris, Yes, I've tried both of these things already. I can confirm there are multiple calls, and that pre-importing the module fixes it. But pre-importing it is not a solution in practice. Regards, Geoff On Thu, Feb 20, 2020 at 4:45 PM Chris Angelico wrote: > On Fri, Feb 21, 2020

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
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 to be showing anything either. I don't really know what else to try in this direction. /Geoff On Sat, Oc

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

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: Syntax error (The Python Book) Linux User and Developer Bookazine

2016-02-15 Thread Geoff Munn
On Monday, 15 February 2016 15:07:03 UTC, Joel Goldstick wrote: > On Mon, Feb 15, 2016 at 9:56 AM, Geoff Munn wrote: > > > On Sunday, 14 February 2016 13:39:52 UTC, Geoff Munn wrote: > > > Hi, > > > > > > Noob at the Python thing so here goes, > > &

Re: Syntax error (The Python Book) Linux User and Developer Bookazine

2016-02-15 Thread Geoff Munn
On Sunday, 14 February 2016 13:39:52 UTC, Geoff Munn wrote: > Hi, > > Noob at the Python thing so here goes, > > I have copied a program to demonstrate control structures in Python but get a > syntax error at line 31, isint = False. I'm using Python 2.7.6 and Lin

Syntax error (The Python Book) Linux User and Developer Bookazine

2016-02-14 Thread Geoff Munn
Hi, Noob at the Python thing so here goes, I have copied a program to demonstrate control structures in Python but get a syntax error at line 31, isint = False. I'm using Python 2.7.6 and Linux Mint based around ubuntu14.04.1. I have pasted all the code below, #!/usr/bin/env python2 ''' We

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

Question about encoding, I need a clue ...

2011-08-05 Thread Geoff Wright
Hi, I use Mac OSX for development but deploy on a Linux server. (Platform details provided below). When the locale is set to FR_CA, I am not able to display a u circumflex consistently across the two machines even though the default encoding is set to "ascii" on both machines. Specifically,

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
me this file to "inspect_test.py", and the filename will make sense to > inspect.getmodulename, which should *then* return "inspect_test" instead of > None. I realise that, but of course I can't do that in the real code. It's a long-established convention to drop the ".py" from executable programs on UNIX. Regards, Geoff -- http://mail.python.org/mailman/listinfo/python-list

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 "

Re: How do I test the integrity of a Python installation in Debian and Ubuntu

2009-05-11 Thread Geoff Gardiner
lso posting in parallel to the original posters. In doing so, your address initially bounced the message - so I changed it unthinkingly in a to: line. I did not realize until this morning that they made it through python-list unchanged, as they obviously do. All the best, Geoff -- http://m

Re: How do I test the integrity of a Python installation in Debian and Ubuntu

2009-05-11 Thread Geoff Gardiner
well. Although that wasn't what I was originally looking for it has been helpful. Thank you for your suggestions. All the best, Geoff -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I test the integrity of a Python installation in Debian and Ubuntu

2009-05-10 Thread Geoff Gardiner
st_socket_ssl ImportError: cannot import name test_socket_ssl geg...@gegard:/usr/lib/python2.5$ Also geg...@gegard:~$ locate */test_socket_ssl.* geg...@gegard:~$ #returns nothing And geg...@gegard:~$ locate /usr/lib/python2.5/test/test_*.* /usr/lib/python2.5/test/test_support.py /usr/lib/python2.5/test

Re: How do I test the integrity of a Python installation in Debian and Ubuntu

2009-05-09 Thread Geoff Gardiner
he lap of the hosting provider, and apt-get is probably the only delivery mechanism they will take any responsibility for. (I want to use their 'standard'.) All the best, Geoff -- http://mail.python.org/mailman/listinfo/python-list

How do I test the integrity of a Python installation in Debian and Ubuntu

2009-05-08 Thread Geoff Gardiner
l Ubuntu VM. A number of modules are installed in addition to python, but I can't even see how to test the core python installation. There are few test_*.py files in the installation. I have previously encountered a fault on the server hosting the VM and would like to be more comfortable tha

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

Re: Is python worth learning as a second language?

2009-03-09 Thread Geoff Smith
In article , ze...@op.pl says... > > Hi > > I hope I won't sound trivial with asking my question. > > I am a C++ programmer and I am thinking of learning something else > because I know second language might be very helpful somehow. I have > heard a few positive things about Python but I have

trying to check the creation date of a file

2007-04-04 Thread Geoff Bjorgan
Nice going…way to help! gb -- http://mail.python.org/mailman/listinfo/python-list

Re: can't find a way to display and print pdf through python.

2007-02-10 Thread Geoff Hill
Are you trying to: a) Make the PDF file open in it's default application? b) Create a PDF-reader in Python? ...because your question is somewhat unclear. Report Lab has no PDF viewer. You would need a PDF/PostScript parser to do that and that's more of a job than I think you're looking f

Re: Regular Expressions

2007-02-10 Thread Geoff Hill
Thanks. O'Reilly is the way I learned Python, and I'm suprised that I didn't think of a book by them earlier. -- http://mail.python.org/mailman/listinfo/python-list

Re: Hacking in python

2007-02-10 Thread Geoff Hill
The word "hack" can be known as a "smart/quick fix" to a problem. -- http://mail.python.org/mailman/listinfo/python-list

Regular Expressions

2007-02-10 Thread Geoff Hill
What's the way to go about learning Python's regular expressions? I feel like such an idiot - being so strong in a programming language but knowing nothing about RE. -- http://mail.python.org/mailman/listinfo/python-list

Re: Best Free and Open Source Python IDE

2007-02-10 Thread Geoff Hill
If you can take some time and master Vim, you'll be set for typing out any programming language for the rest of your life. I hear Emacs is good too, and the GNU project is great, so you could try that as well. It's supposed to be more geared towards programming -- http://mail.python.org/mail

Best FCGI handler

2007-01-11 Thread Geoff
Hi! Does anyone have any recommendations for FGCI interfaces for python? For example jonpy? Thanks, Geoff -- http://mail.python.org/mailman/listinfo/python-list

OpenBSD, Apache and Python

2007-01-07 Thread Geoff
ortant? Thanks for any help, Geoff -- http://mail.python.org/mailman/listinfo/python-list

Using freeze or other application to create linkable dynamic libraries for c++ applications?

2006-01-20 Thread Geoff Wedig
Is it possible to create a DLL (pr on unix a .a, .so, etc) from python code, perhaps using freeze or some other application? Freeze seems to assume that it's creating the main program body, but I don't really understand it well enough to say. If it doesn't work, is there another application th

Embedding pure python statically -- possibly a newbie question

2006-01-18 Thread Geoff Wedig
I have inherited a project with an embedded python interpretter, and don't know much about it, but have been given the task of porting it to a new compiler/OS and have run into some problems. I seem to have got the embedded interpretter part of it working, and have worked out how to add c modul