[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-10 Thread Bernie Hackett


Change by Bernie Hackett :


--
nosy: +behackett

___
Python tracker 
<https://bugs.python.org/issue43923>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38890] A subprocess.Popen created with creationFlags=DETACHED_PROCESS on Windows should not emit a ResourceWarning

2019-11-21 Thread Bernie Hackett


Change by Bernie Hackett :


--
nosy: +behackett

___
Python tracker 
<https://bugs.python.org/issue38890>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17123] Add OCSP support to ssl module

2019-10-15 Thread Bernie Hackett


Bernie Hackett  added the comment:

OCSP is the only way Let's Encrypt supports revocation. It would be really 
useful to have stapling verification supported in the standard library, even 
just the callback support PyOpenSSL supports.

https://letsencrypt.org/docs/revoking/

--
nosy: +behackett

___
Python tracker 
<https://bugs.python.org/issue17123>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Newbie problem with urllib.request.urlopen

2017-09-26 Thread Bernie Connors
On Tuesday, September 26, 2017 at 12:32:18 PM UTC-3, Bernie Connors wrote:
> Hello,
> 
>   My first post here on C.L.P.  I have only written a few python scripts 
> in 2.7 and now I'm trying my first python 3 script.  Can you tell me why this 
> snippet won't run?
> ---
> from urllib.request import urlopen
> 
> with 
> urlopen('http://geonb.snb.ca/arcgis/rest/services/GeoNB_SNB_Parcels/MapServer/0/query?outSR=4617=JSON=PID='75385120'')
>  as conn:
> print(conn)
> ---
> Thanks,
> Bernie.

Peter Otten,

  Yes that seems to work better.  Thanks for the tips.  But I see now that 
I am getting some http errors when I try to run this code from the Microsoft 
Azure Notebooks.  Here is the URL to my Note Book:
https://notebooks.azure.com/n/n31C2DSCOr8/notebooks/URLopen%20Test.ipynb
And here is the error:
URLError: 

Does anybody know if something can be done about this with urllib? Or is 
this completely related to the firewall rules at http://geonb.snb.ca??

Thanks,
Bernie.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Newbie problem with urllib.request.urlopen

2017-09-26 Thread Bernie Connors
On Tuesday, September 26, 2017 at 12:32:18 PM UTC-3, Bernie Connors wrote:
> Hello,
> 
>   My first post here on C.L.P.  I have only written a few python scripts 
> in 2.7 and now I'm trying my first python 3 script.  Can you tell me why this 
> snippet won't run?
> ---
> from urllib.request import urlopen
> 
> with 
> urlopen('http://geonb.snb.ca/arcgis/rest/services/GeoNB_SNB_Parcels/MapServer/0/query?outSR=4617=JSON=PID='75385120'')
>  as conn:
> print(conn)
> ---
> Thanks,
> Bernie.

Thomas,

  The PID parameter at the end of my url must be enclosed in single quotes, 
'75385120', or the API won't execute the query.  I have the code in a python 
notebook on Azure - 
https://notebooks.azure.com/n/n31C2DSCOr8/notebooks/URLopen%20Test.ipynb

Here are the error messages I am getting:
---
HTTPError Traceback (most recent call last)
 in ()
  1 from urllib.request import urlopen
> 2 with 
urlopen("http://geonb.snb.ca/arcgis/rest/services/GeoNB_SNB_Parcels/MapServer/0/query?outSR=4617=JSON=PID='75385120'")
 as conn:
  3 print(conn)

~/anaconda3_410/lib/python3.5/urllib/request.py in urlopen(url, data, timeout, 
cafile, capath, cadefault, context)
160 else:
161 opener = _opener
--> 162 return opener.open(url, data, timeout)
163 
164 def install_opener(opener):

~/anaconda3_410/lib/python3.5/urllib/request.py in open(self, fullurl, data, 
timeout)
469 for processor in self.process_response.get(protocol, []):
470 meth = getattr(processor, meth_name)
--> 471 response = meth(req, response)
472 
473 return response

~/anaconda3_410/lib/python3.5/urllib/request.py in http_response(self, request, 
response)
579 if not (200 <= code < 300):
580 response = self.parent.error(
--> 581 'http', request, response, code, msg, hdrs)
582 
583 return response

~/anaconda3_410/lib/python3.5/urllib/request.py in error(self, proto, *args)
507 if http_err:
508 args = (dict, 'default', 'http_error_default') + orig_args
--> 509 return self._call_chain(*args)
510 
511 # XXX probably also want an abstract factory that knows when it makes

~/anaconda3_410/lib/python3.5/urllib/request.py in _call_chain(self, chain, 
kind, meth_name, *args)
441 for handler in handlers:
442 func = getattr(handler, meth_name)
--> 443 result = func(*args)
444 if result is not None:
445 return result

~/anaconda3_410/lib/python3.5/urllib/request.py in http_error_default(self, 
req, fp, code, msg, hdrs)
587 class HTTPDefaultErrorHandler(BaseHandler):
588 def http_error_default(self, req, fp, code, msg, hdrs):
--> 589 raise HTTPError(req.full_url, code, msg, hdrs, fp)
590 
591 class HTTPRedirectHandler(BaseHandler):

HTTPError: HTTP Error 403: Forbidden
--

Thanks,
Bernie.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Extracting and summing student scores from a JSON file using Python 2.7.10

2015-11-10 Thread Bernie Lazlo
On Monday, 9 November 2015 22:54:05 UTC-5, wayne@gmail.com  wrote:
> On Monday, 9 November 2015 22:27:40 UTC-5, Denis McMahon  wrote:
> > On Mon, 09 Nov 2015 15:52:45 -0800, Bernie Lazlo wrote:
> > 
> > > This should be a simple problem but I have wasted hours on it. Any help
> > > would be appreciated. [I have taken my code back to almost the very
> > > beginning.]
> > > 
> > > The student scores need to be summed.
> > > 
> > > import json import urllib url =
> > > "http://www.wickson.net/geography_assignment.json;
> > > response = urllib.urlopen(url)
> > > data = json.loads(response.read())
> > > lst1 = list(data.items())
> > > print lst1
> > 
> > I find that pprint.pprint is useful for looking at data structures.
> > 
> > Having looked at the data, and then using appropriate substitutions for 
> >  and  in the following:
> > 
> > sumscore = 0
> > students = 0
> > 
> > for dic in :
> > sumscore = sumscore + dic[]
> > students += 1
> > 
> > print 'Sum of', students, 'scores is', sumscore
> > print 'Average of', students, 'scores is', sumscore / students
> > 
> > It was trivial to generate:
> > 
> > Sum of 50 scores is 3028
> > Average of 50 scores is 60
> > 
> > -- 
> > Denis McMahon
> =
Thanks for the reply, Denis. I hope this comes as easily to me some day. :-) 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Extracting and summing student scores from a JSON file using Python 2.7.10

2015-11-10 Thread Bernie Lazlo
On Monday, 9 November 2015 18:53:06 UTC-5, Bernie Lazlo  wrote:
> This should be a simple problem but I have wasted hours on it. Any help would 
> be appreciated. [I have taken my code back to almost the very beginning.]
> 
> The student scores need to be summed.
> 
> import json
> import urllib
> url = "http://www.wickson.net/geography_assignment.json;
> response = urllib.urlopen(url)
> data = json.loads(response.read())
> lst1 = list(data.items())
> print lst1

Pete, thanks for the input. Sometimes it just takes a suggestion to break past 
the "brick wall".
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Extracting and summing student scores from a JSON file using Python 2.7.10

2015-11-09 Thread Bernie Lazlo
On Monday, 9 November 2015 20:31:52 UTC-5, MRAB  wrote:
> On 2015-11-10 01:12, Bernie Lazlo wrote:
> > On Monday, 9 November 2015 19:30:23 UTC-5, MRAB  wrote:
> >> On 2015-11-09 23:52, Bernie Lazlo wrote:
> >> > This should be a simple problem but I have wasted hours on it. Any help 
> >> > would be appreciated. [I have taken my code back to almost the very 
> >> > beginning.]
> >> > 
> >> > The student scores need to be summed.
> >> > 
> >> > import json
> >> > import urllib
> >> > url = "http://www.wickson.net/geography_assignment.json;
> >> > response = urllib.urlopen(url)
> >> > data = json.loads(response.read())
> >> > lst1 = list(data.items())
> >> > print lst1
> >> >
> >> Do it a step at a time.
> >>
> >> It's a list, so start with indexing.
> >
> > MRAB:
> >
> > I think of the file as two lists. The second list appears to be a list of 
> > tuples containing "names" and "scores". How would you index or extract 
> > those.
> >
> Right, so lst1[1] gets you closer to what you want.
> 
> Further indexing will get you even closer.
===
lst2 = lst1[1] removes first line of  instructions

printing lst2[1:2] produces essentially the list of students and scores ??

([{u'student ': u'Hannah', u'score': 77}, {u'student ': u'Emily', u'score': 
57}, {u'student ': u'Olivia', u'score': 80}, {u'student ': u'Nora', u'score': 
70},
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Extracting and summing student scores from a JSON file using Python 2.7.10

2015-11-09 Thread Bernie Lazlo
On Monday, 9 November 2015 18:53:06 UTC-5, Bernie Lazlo  wrote:
> This should be a simple problem but I have wasted hours on it. Any help would 
> be appreciated. [I have taken my code back to almost the very beginning.]
> 
> The student scores need to be summed.
> 
> import json
> import urllib
> url = "http://www.wickson.net/geography_assignment.json;
> response = urllib.urlopen(url)
> data = json.loads(response.read())
> lst1 = list(data.items())
> print lst1
==

Many thanks, MRAB!  :-)
-- 
https://mail.python.org/mailman/listinfo/python-list


Extracting and summing student scores from a JSON file using Python 2.7.10

2015-11-09 Thread Bernie Lazlo
This should be a simple problem but I have wasted hours on it. Any help would 
be appreciated. [I have taken my code back to almost the very beginning.]

The student scores need to be summed.

import json
import urllib
url = "http://www.wickson.net/geography_assignment.json;
response = urllib.urlopen(url)
data = json.loads(response.read())
lst1 = list(data.items())
print lst1
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Extracting and summing student scores from a JSON file using Python 2.7.10

2015-11-09 Thread Bernie Lazlo
On Monday, 9 November 2015 19:30:23 UTC-5, MRAB  wrote:
> On 2015-11-09 23:52, Bernie Lazlo wrote:
> > This should be a simple problem but I have wasted hours on it. Any help 
> > would be appreciated. [I have taken my code back to almost the very 
> > beginning.]
> > 
> > The student scores need to be summed.
> > 
> > import json
> > import urllib
> > url = "http://www.wickson.net/geography_assignment.json;
> > response = urllib.urlopen(url)
> > data = json.loads(response.read())
> > lst1 = list(data.items())
> > print lst1
> >
> Do it a step at a time.
> 
> It's a list, so start with indexing.

MRAB:

I think of the file as two lists. The second list appears to be a list of 
tuples containing "names" and "scores". How would you index or extract those.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread Bernie Hackett

Bernie Hackett added the comment:

Here's a chunk of the call stack from the Visual Studio debugger using the 
debug build. Py_FatalError seems to be called multiple times:

>   ucrtbased.dll!72d27f30()Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for 
ucrtbased.dll] 
[External Code] 
python35_d.dll!Py_FatalError(const char * msg) Line 1375C   
python35_d.dll!_Py_CheckRecursiveCall(const char * where) Line 733  C
python35_d.dll!PyObject_Call(_object * func, _object * arg, _object * kw) 
Line 2144 C
python35_d.dll!call_function_tail(_object * callable, _object * args) Line 
2173 C
python35_d.dll!callmethod(_object * func, const char * format, char * va, 
int is_size_t) Line 2242  C 
python35_d.dll!_PyObject_CallMethodId(_object * o, _Py_Identifier * name, 
const char * format, ...) Line 2287   C
python35_d.dll!flush_std_files() Line 488   C   
python35_d.dll!Py_FatalError(const char * msg) Line 1354C   
python35_d.dll!_Py_CheckRecursiveCall(const char * where) Line 733  C
python35_d.dll!PyObject_Call(_object * func, _object * arg, _object * kw) 
Line 2144 C
python35_d.dll!do_call(_object * func, _object * * * pp_stack, int na, int 
nk) Line 4883C   python35_d.dll!call_function(_object * * * pp_stack, 
int oparg) Line 4679   C
python35_d.dll!PyEval_EvalFrameEx(_frame * f, int throwflag) Line 3183  C
python35_d.dll!fast_function(_object * func, _object * * * pp_stack, int n, 
int na, int nk) Line 4751   C
python35_d.dll!call_function(_object * * * pp_stack, int oparg) Line 4677   
C
python35_d.dll!PyEval_EvalFrameEx(_frame * f, int throwflag) Line 3183  C
python35_d.dll!fast_function(_object * func, _object * * * pp_stack, int n, 
int na, int nk) Line 4751   C
python35_d.dll!call_function(_object * * * pp_stack, int oparg) Line 4677   
C
python35_d.dll!PyEval_EvalFrameEx(_frame * f, int throwflag) Line 3183  C
python35_d.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals, 
_object * locals, _object * * args, int argcount, _object * * kws, int kwcount, 
_object * * defs, int defcount, _object * kwdefs, _object * closure, _object * 
name, _object * qualname) Line 3962C 
python35_d.dll!fast_function(_object * func, _object * * * pp_stack, int n, 
int na, int nk) Line 4760   C

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25222>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread Bernie Hackett

Bernie Hackett added the comment:

On second thought, _Py_CheckRecursiveCall may be being called recursively 
through Py_FatalError.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25222>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread Bernie Hackett

Bernie Hackett added the comment:

> File 
> "D:\buildarea\3.4.bolen-windows10\build\lib\test\test_json\test_recursion.py",
>  line 96 in test_endless_recursion

That test (and reason for existence) is almost exactly the same as the PyMongo 
test that causes abort reported in this ticket. I'm not surprised it is also 
failing. test_pickle appears to have a similar issue. For test_json see here:

https://hg.python.org/cpython/rev/a21f5af476cb

And PyMongo's equivalent test:

https://github.com/mongodb/mongo-python-driver/blob/4bbe2133a14df716b1dffe8ab7957ed67149b2cd/test/test_bson.py#L538-L543

> I'm unable to reproduce the issue on Linux.

The abort is very rare for me on Linux, so much so that I originally thought it 
only occurred on Windows. I can't reproduce it on a local Linux machine, but it 
has happened inconsistently in our Jenkins cluster. For example (note that this 
run includes a commit that uses sys.setrecursionlimit(250) and still aborts):

https://jenkins.mongodb.com/view/Python/job/mongo-python-driver/404/extensions=without-extensions,label=linux64,mongodb_configuration=single_server,mongodb_option=noauth,mongodb_server=26-release,python_language_version=3.5/console

> First I tried with no MongoDB server running. Then I tried with a MongoDB 
> server running.

The problem only occurs for me when testing with a MongoDB instance running. 
Running background threads seem to be a key requirement for reproduction. Note 
also that this problem does not reproduce when using PyMongo's C extensions, 
only when using the pure python BSON encoder. You can run the tests like this 
from a clean git checkout:

python3.5 setup.py --no_ext test

> I don't have exactly the same version (I'm reading pymongo 3.0.3 source)

Clone master from github:

https://github.com/mongodb/mongo-python-driver

> @Bernie: Would you be able to get a C backtrace using gdb on such crash?

Not likely, since I can't reproduce it under Linux locally. But I *can* 
reproduce it consistently on a Windows 7 machine that has VS2015. I'll see what 
I can get out of the Visual Studio debugger and report back.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25222>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread Bernie Hackett

Bernie Hackett added the comment:

> Clone master from github:

You'll also have to git checkout 4bbe2133a14df716b1dffe8ab7957ed67149b2cd to 
roll back the setrecursionlimit change I added to work around this issue. 

Using 100 seems to have permanently vanquished the abort, but there's no way 
the stack is overflowing with such a low setting and Py_EnterRecursiveCall 
shouldn't cause python to abort all by itself.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25222>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-23 Thread Bernie Hackett

Bernie Hackett added the comment:

> Well, Python has no perfect protection again stack overflow. It's only best 
> effect.

That's interesting. I thought there was a stronger contract, and it appeared 
that way in all previous cpython releases back to 2.4. Again, this failure is 
new with 3.5.0.

> You should change sys.setrecursionlimit() to a lower limit to try to limit 
> the risk of a crash.

That's a great suggestion and it appears to work around the issue, thanks.

Feel free to close this won't fix, but given that this appears to be the second 
report of this issue for 3.5 (see issue22971) someone who understands 
interpreter internals may want to look into the problem a bit more first.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25222>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-23 Thread Bernie Hackett

New submission from Bernie Hackett:

While running PyMongo's test suite against python 3.5.0 the interpreter 
inconsistently aborts when we test encoding a recursive data structure like:

evil = {}
evil['evil'] = evil

The test that triggers this was added to test the use of Py_EnterRecursiveCall 
in PyMongo's C extensions and passes without issues on all previous CPython 
releases back to 2.4.x (the oldest version PyMongo supports). The interesting 
thing about this abort is that it only occurs when testing PyMongo *without* 
its C extensions. The stacktrace looks like this:

test_bad_encode (test_bson.TestBSON) ... Exception ignored in: >
RecursionError: maximum recursion depth exceeded while calling a Python object
Fatal Python error: Cannot recover from stack overflow.
 
Thread 0x0b6c (most recent call first):
  File "C:\10gen\mongo-python-driver\pymongo\periodic_executor.py", line 105 in 
_run
  File "C:\Python35\lib\threading.py", line 871 in run
  File "C:\Python35\lib\threading.py", line 923 in _bootstrap_inner
  File "C:\Python35\lib\threading.py", line 891 in _bootstrap
 
Thread 0x0690 (most recent call first):
  File "C:\Python35\lib\threading.py", line 297 in wait
  File "C:\10gen\mongo-python-driver\pymongo\thread_util.py", line 199 in wait
  File "C:\10gen\mongo-python-driver\pymongo\periodic_executor.py", line 110 in 
_run
  File "C:\Python35\lib\threading.py", line 871 in run
  File "C:\Python35\lib\threading.py", line 923 in _bootstrap_inner
  File "C:\Python35\lib\threading.py", line 891 in _bootstrap
 
Thread 0x0900 (most recent call first):
  File "C:\Python35\lib\threading.py", line 297 in wait
  File "C:\10gen\mongo-python-driver\pymongo\thread_util.py", line 199 in wait
  File "C:\10gen\mongo-python-driver\pymongo\periodic_executor.py", line 110 in 
_run
  File "C:\Python35\lib\threading.py", line 871 in run
  File "C:\Python35\lib\threading.py", line 923 in _bootstrap_inner
  File "C:\Python35\lib\threading.py", line 891 in _bootstrap
 
Current thread 0x0a20 (most recent call first):
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 653 in 
_name_value_to_bson
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 692 in 
_element_to_bson
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 433 in 
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 433 in 
_encode_mapping
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 653 in 
_name_value_to_bson
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 462 in 
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 462 in _encode_list
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 653 in 
_name_value_to_bson
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 692 in 
_element_to_bson
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 433 in 
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 433 in 
_encode_mapping
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 653 in 
_name_value_to_bson
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 462 in 
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 462 in _encode_list
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 653 in 
_name_value_to_bson
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 692 in 
_element_to_bson
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 433 in 
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 433 in 
_encode_mapping
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 653 in 
_name_value_to_bson
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 462 in 
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 462 in _encode_list
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 653 in 
_name_value_to_bson
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 692 in 
_element_to_bson
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 433 in 
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 433 in 
_encode_mapping
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 653 in 
_name_value_to_bson
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 462 in 
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 462 in _encode_list
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 653 in 
_name_value_to_bson
  File "C:\10gen\mongo-python-driver\bson\__init__.py", line 692 in 
_element_to_bson
  File "C:\10gen\mongo-

[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-23 Thread Bernie Hackett

Bernie Hackett added the comment:

I used sys.setrecursionlimit(250) - the default appears to be 1000 on all my 
test machines - and that reduced the occurrence of the abort but didn't 
completely solve the problem. There must be something more going on here.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25222>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21299] Einladung in mein Netzwerk bei LinkedIn

2014-04-18 Thread Bernie Keimel

New submission from Bernie Keimel:

LinkedIn


Ich möchte Sie zu meinem beruflichen Netzwerk auf LinkedIn hinzufügen.

- Bernard Keimel

Bernard Keimel
Business bei privat
Berlin und Umgebung, Deutschland

Bestätigen, dass Sie Bernard Keimel kennen:
https://www.linkedin.com/e/-3qcne3-hu5hbkmh-1s/isd/16078050493/NNc4mKPz/?hs=falsetok=0SvHBVq3J6v6c1

--
Sie erhalten Einladungen zum Netwerkbeitritt per E-Mail. Klicken Sie hier, wenn 
Sie kein Interesse daran haben:
http://www.linkedin.com/e/-3qcne3-hu5hbkmh-1s/z2oU7dKDzpt2G7xQz2FC2SclHmnUGzmsk0c/goo/report%40bugs%2Epython%2Eorg/20061/I6913898468_1/?hs=falsetok=35uA1JgJ56v6c1

(c) 2012 LinkedIn Corporation. 2029 Stierlin Ct., Mountain View, CA 94043, USA

--
messages: 216782
nosy: Bernie.Keimel
priority: normal
severity: normal
status: open
title: Einladung in mein Netzwerk bei LinkedIn

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21299
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18847] Einladung in mein Netzwerk bei LinkedIn

2013-08-27 Thread Bernie Keimel

New submission from Bernie Keimel:

LinkedIn


Ich möchte Sie zu meinem beruflichen Netzwerk auf LinkedIn hinzufügen.

- Bernard Keimel

Bernard Keimel
Business bei privat
Berlin und Umgebung, Deutschland

Bestätigen Sie, dass Sie Bernard Keimel kennen:
https://www.linkedin.com/e/-3qcne3-hkuqctnf-28/isd/16078050493/NNc4mKPz/?hs=falsetok=2zVN7V8rC0lBU1

--
Sie erhalten Einladungen zum Netwerkbeitritt per E-Mail. Klicken Sie hier, wenn 
Sie kein Interesse daran haben:
http://www.linkedin.com/e/-3qcne3-hkuqctnf-28/z2oU7dKDzpt2G7xQz2FC2SclHmnUGzmsk0c/goo/report%40bugs%2Epython%2Eorg/20061/I5347669664_1/?hs=falsetok=3HVMvi7QC0lBU1

(c) 2012 LinkedIn Corporation. 2029 Stierlin Ct., Mountain View, CA 94043, USA

--
messages: 196264
nosy: Bernie.Keimel
priority: normal
severity: normal
status: open
title: Einladung in mein Netzwerk bei LinkedIn

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18847
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16825] all OK!!!

2012-12-31 Thread Bernie Keimel

Changes by Bernie Keimel unowne...@gmail.com:


--
nosy: Bernie.Keimel
priority: normal
severity: normal
status: open
title: all OK!!!

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16825
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16815] Is all OK!!

2012-12-29 Thread Bernie Keimel

Changes by Bernie Keimel unowne...@gmail.com:


--
nosy: Bernie.Keimel
priority: normal
severity: normal
status: open
title: Is all OK!!

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2504] Add gettext.pgettext() and variants support

2010-05-19 Thread Bernie H. Innocenti

Bernie H. Innocenti ber...@codewiz.org added the comment:

While we're waiting for this patch to be upstreamed, what's the best way to 
emulate this functionality with the current gettext module?

I'm looking at the patch and it seems that code similar to this might work?

  def pgettext(ctx, msg):
 return gettext(ctx + \x04 + msg)

--
nosy: +bernie

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2504
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



The Python: Rag November issue available

2009-11-01 Thread Bernie
The November issue of The Python: Rag is available at:

http://www.pythonrag.org

A monthly, free, community run, Python magazine - issues are in pdf 
format, intended for anyone interested in Python.
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


The Python: Rag November issue available

2009-11-01 Thread Bernie
The November issue of The Python: Rag is available at:

http://www.pythonrag.org

A monthly, free, community run, Python magazine - issues are in pdf 
format, intended for anyone interested in Python.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Python: Rag October issue available

2009-10-04 Thread Bernie
On Sat, 03 Oct 2009 20:09:18 -0700, TerryP wrote:

 On Oct 3, 4:29 pm, Bernie edi...@pythonrag.org wrote:
 Hi, no -its just put on the website.  Unless there's a method you can
 suggest?
 
 Not to butt in, but off the top of my head, you could probably set up a
 mailing list and post the link to the file every cycle - simple but
 effective.

Yes, good suggestion - I've had a look at google groups and they seem to 
provide comprehensive facilities.  I'll set one up.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Python: Rag October issue available

2009-10-04 Thread Bernie
On Sun, 04 Oct 2009 07:37:35 -0500, Bernie wrote:

 On Sat, 03 Oct 2009 20:09:18 -0700, TerryP wrote:
 
 On Oct 3, 4:29 pm, Bernie edi...@pythonrag.org wrote:
 Hi, no -its just put on the website.  Unless there's a method you can
 suggest?
 
 Not to butt in, but off the top of my head, you could probably set up a
 mailing list and post the link to the file every cycle - simple but
 effective.
 
 Yes, good suggestion - I've had a look at google groups and they seem to
 provide comprehensive facilities.  I'll set one up.

And here it is:

http://groups.google.co.uk/group/pythonrag
-- 
http://mail.python.org/mailman/listinfo/python-list


The Python: Rag October issue available

2009-10-03 Thread Bernie

The Python: Rag October issue available


The October issue of The Python: Rag is available at:

http://www.pythonrag.org

A monthly, free, community run, Python magazine - issues are in pdf 
format, intended for anyone interested in Python, without being 
particularly serious.  If you have anything you would like to say about 
Python, please contribute.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Python: Rag October issue available

2009-10-03 Thread Bernie
On Fri, 02 Oct 2009 11:32:41 -0700, steven.oldner wrote:
Hi, no -its just put on the website.  Unless there's a method you can 
suggest?

  Cheers

 Bernie

 On Oct 2, 11:14 am, Bernie edi...@pythonrag.org wrote:
 The Python: Rag October issue available

 The October issue of The Python: Rag is available at:

 http://www.pythonrag.org

 A monthly, free, community run, Python magazine - issues are in pdf
 format, intended for anyone interested in Python, without being
 particularly serious.  If you have anything you would like to say about
 Python, please contribute.
 
 Thanks!  Any way to subscribe to it?

-- 
http://mail.python.org/mailman/listinfo/python-list


[issue6901] Runaway programs often become unresponsive to CTRL-C

2009-09-13 Thread Bernie H. Innocenti

New submission from Bernie H. Innocenti ber...@codewiz.org:

On startup, the Python interpreter changes the default behavior
of SIGINT, which results in  many Python programs to ignore the
keyboard interrupt exactly in the situations when users are
most likely to use it (i.e.: when the program becomes unresponsive).

Minimal testcase:
 $ echo void foo() { for(;;) {} } foo.c
 $ gcc -shared -o foo.so foo.c
 $ python -c 'import ctypes;ctypes.CDLL(./foo.so).foo()'
 ^C^C^C
 ^C
 ^C DAMN!
 ^C

This scenario mimics a Python program calling some blocking library
function.  It can also happen with IO-bound functions if they loop
on read() and don't abort on short reads.

One might be tempted to say this behavior of the Python intepreter
is by design and suggest users to use CTRL-\ instead of CTRL-C.
However, this non-standard behavior is very annoying for users who
expect ^C to work on UNIX systems.  In fact, no other compiled or
interpreted language I know of behaves this way, and Python should
not be the only exception.

While I see the usefulness of KeyboardInterrupt from the programmer
point of view, only a minority of programs actually need to trap
SIGINT and do something with it.  Other language runtimes require
the programmer to manually trap SIGINT when needed.  The Python
interpreter could maintain backwards compatibility by enabling
automatic SIGINT trapping when entering a  try block that would
intercept KeyboardInterrupt.

--
components: Interpreter Core
messages: 92576
nosy: bernie
severity: normal
status: open
title: Runaway programs often become unresponsive to CTRL-C
versions: Python 2.6, Python 3.0

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6901
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6901] Runaway programs often become unresponsive to CTRL-C

2009-09-13 Thread Bernie H. Innocenti

Bernie H. Innocenti ber...@codewiz.org added the comment:

 This is a fundemental behavior that will never change. If you
 dislike it, you can remove the signal handler for it with the
 signal module.

What?  We could break the syntax of print statements and
cannot change this minor detail that afftects many 1% of all
Python programs?

As a matter of fact, for 2 years I've been using this in my
/usr/lib64/python2.6/sitecustomize.py:

cut-
import signal
signal.signal(signal.SIGINT, signal.SIG_DFL)
cut-

^C has been working perfectly ever since.  So far, I have not
yet found a single Python program where restoring the default
behavior of SIGINT causes real issues, but there may certainly
be a few.

Granted, this is just a kludge, not a perfect fix, but from a
user perspective, it already improves upon the current behavior
(i.e. more pros than cons).

At least, this is my personal experience.  If you're skeptical,
please try this workaround yourself for a few months and let me
know what breaks for you.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6901
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6901] Runaway programs often become unresponsive to CTRL-C

2009-09-13 Thread Bernie H. Innocenti

Bernie H. Innocenti ber...@codewiz.org added the comment:

Ok

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6901
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: print syntax

2009-09-05 Thread Bernie
On Thu, 03 Sep 2009 12:22:14 -0400, doug wrote:

 I am new to python, working by way through 'Core Python Programming'. I
 can find no description of using print with the built-in type for
 formatting. I think I have got some [most?] of it from Chun, google, and
 python.org. My comment is - it should not be that hard to find. I would
 suggest a link from the print syntax section.
 
 What is seems to be is:
 
print format-spec % (variable-list)
 
 I assume the '%' is required token.
 
 
 
 _
 Douglas Denault
 http://www.safeport.com
 d...@safeport.com
 Voice: 301-217-9220
Fax: 301-217-9277


You say using print with the built-in type for formatting. - It's two 
separate things, print just prints a string.  You can use the formatting 
quite separately on the string first.

my_string = %s %s %s % (1, 2, 3)# creates string 1 2 3
print my_string

so you probably would find difficulty is searching for 'print 
formatting', you should be looking for string formatting.
   
-- 
http://mail.python.org/mailman/listinfo/python-list


The Python: Rag September issue available

2009-09-03 Thread Bernie
The September issue of The Python: Rag is available at:

http://www.pythonrag.org

A monthly, free, community run, Python magazine - issues are in pdf 
format, intended for anyone interested in Python, without being 
particularly serious.  If you have anything you would like to say about 
Python, please contribute.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: shelve.open call gives error

2008-02-10 Thread Bernie Woodham

Gabriel Genellina [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 En Sat, 09 Feb 2008 03:35:14 -0200, waltbrad [EMAIL PROTECTED] 
 escribi?:

 On Feb 8, 5:29 pm, Gabriel Genellina [EMAIL PROTECTED] wrote:
 En Fri, 08 Feb 2008 06:36:53 -0200, waltbrad [EMAIL PROTECTED]
 escribió:

  Working through the Mark Lutz book Programming Python 3rd Edition.
  A couple of modules in the Preview chapter give me errors. Both on a
  shelve.open call:

 shelve uses the anydbm module; anydbm tries to select the best database
 module available, but apparently fails in your system.

 But as I gain experience I'd like to return to this issue and try to
 fix it.  Can you give me advice on how to go about that?

 I'm working on a win98 system.  I have python on a linux system,
 (Kubuntu) and winxp but it's more convenient right now for me to use
 the 98 laptop.

 I've tried the example on WinXP and it runs fine. Looks like the bsddb 
 package isn't working on Windows98; I don't know if that platform is still 
 supported or not. Try submitting a bug report http://bugs.python.org

 -- 
 Gabriel Genellina


Yeah, I think you're right.  I also have no problems with it on XP.

5.1 is supposed to be the last version that get win9x support.

Thanks. 


-- 
http://mail.python.org/mailman/listinfo/python-list

ANN: SkipoleMonitor 0.4 released

2007-07-13 Thread Bernie
SkipoleMonitor is available at http://code.google.com/p/skipole-monitor/

Version 0.4 now released.
What is SkipoleMonitor?
=

SkipoleMonitor is a free network monitor for Windows and Linux. On running
the program, a GUI window appears, and hosts can be added, which Skipole
Monitor will regularly ping, showing the results via a built-in Web server.
Hosts can be grouped, so the Web server will show group symbols that the
viewer can open to inspect the hosts, or further sub-groups, within.As hosts
(and groups of hosts) change status, SkipoleMonitor can be set to send email
and syslog alerts.

Written in Python, and uses the wxPython library, it has been tested on
Windows and Linux.

License : GPL

=
Bernard Czenkusz
bernie at skipole.co.uk



-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


ANN: SkipoleMonitor0.2 released

2007-05-18 Thread Bernie
SkipoleMonitor is available at http://code.google.com/p/skipole-monitor/

Version 0.2 now released, this version adds the option to automatically send 
email alerts should the status of any monitored host change.

What is SkipoleMonitor?
=

SkipoleMonitor is a free network monitor for Windows and Linux. On running 
the program, a GUI window appears, and hosts can be added, which Skipole 
Monitor will regularly ping, showing the results via a built-in Web server. 
Hosts can be grouped, so the Web server will show group symbols that the 
viewer can open to inspect the hosts, or further sub-groups, within.

Written in Python, and uses the wxPython library, it has been tested on 
Windows and Linux.

License : GPL

=
Bernard Czenkusz
[EMAIL PROTECTED]





-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


ANN: TFTPgui1.1 released

2007-05-01 Thread Bernie
TFTPgui1.1 is available at http://code.google.com/p/tftpgui/

What is TFTPgui?
==
 TFTPgui is a TFTP server. It is intended to run as a user-initiated 
program, rather than a service daemon, and displays a GUI interface allowing 
the user to stop and start the TFTP server. It provides a simple TFTP server 
for engineers to download and upload configuration files from equipment such 
as routers and switches.

Written in Python, it has been tested on Windows and Linux.

License : GPL

==
Bernard Czenkusz
[EMAIL PROTECTED]


-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


Wow!

2005-01-26 Thread Bernie


That is clever, gives a lot of insight into how the __dict__ == the
object.


This is somewhat like the solution I am using from the Cookbook, an
Empty object copy.   This is cleaner and very much more concise.
Thank you!

-- 
http://mail.python.org/mailman/listinfo/python-list


__deepcopy__ without recursive copies?

2005-01-25 Thread Bernie
#!/usr/bin/env python
import sys
import copy

'''
How to define __deepcopy__ with out causing recursive calls to copies
of self?

Bernie Day 01/25/05

I was using deepcopy on DeviceManager and this worked well.  When I
defined
__deepcopy__, so I could have a handle to the children of the Master
device Manager
I got into trouble.
I see that there is a method using a dic to limit this, but I can't
seem to get it to work.

This is not the code I was using but should represent it well.

Thanks!
'''


class DeviceManager:
def __init__(self,devFile):
DevFile = open(devFile)
devList = [Device(line) for line in DevFile]
#etc, etc...
def __deepcopy__(self):
miniMe = copy.deepcopy(self)
miniMe.devList = tuple(devList)
return miniMe
class Device:
def __init__(self,line):
self.copyies = []
#do something with line here
def __deepcopy__(self):
miniMe = copy.deepcopy(self)
self.copyies.append(miniMe)
return miniMe

DevMan1 = DeviceManager(devfile)
devMan2 = copy.deepcopy(DevMan1)

-- 
http://mail.python.org/mailman/listinfo/python-list