[issue46434] pdb help fails with AttributeError when using Windows embeddable package

2022-01-19 Thread sparrowt


New submission from sparrowt :

When running python from an embeddable windows zip file such as:
https://www.python.org/ftp/python/3.9.10/python-3.9.10-embed-amd64.zip

the `help` command within `pdb` is broken due to missing docstrings, as 
demonstrated below.

Python 3.9.10 (tags/v3.9.10:f2f3f53, Jan 17 2022, 15:14:21) [MSC v.1929 64 bit 
(AMD64)] on win32
>>> import pdb
>>> pdb.set_trace()
--Return--
> (1)()->None
(Pdb) help interact
Traceback (most recent call last):
  File "", line 1, in 
  File "bdb.py", line 92, in trace_dispatch
  File "bdb.py", line 151, in dispatch_return
  File "pdb.py", line 294, in user_return
  File "pdb.py", line 357, in interaction
  File "pdb.py", line 322, in _cmdloop
  File "cmd.py", line 138, in cmdloop
  File "pdb.py", line 422, in onecmd
  File "cmd.py", line 217, in onecmd
  File "pdb.py", line 1496, in do_help
AttributeError: 'NoneType' object has no attribute 'rstrip'
>>>
>>> print(pdb.Pdb.do_interact.__doc__)
None

--
components: Library (Lib), Windows
messages: 410970
nosy: paul.moore, sparrowt, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: pdb help fails with AttributeError when using Windows embeddable package
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

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



[issue46434] pdb help fails with AttributeError when using Windows embeddable package

2022-01-19 Thread sparrowt


sparrowt  added the comment:

Perhaps we should have a more generic check for `command.__doc__` as it appears 
this is a case not handled by the existing `sys.flags.optimize >= 2` check?

https://github.com/python/cpython/blob/v3.9.10/Lib/pdb.py#L1492-L1496

--

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



[issue46434] pdb help fails with AttributeError when using Windows embeddable package

2022-01-19 Thread sparrowt


Change by sparrowt :


--
keywords: +patch
pull_requests: +28901
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30705

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



[issue46434] pdb help fails with AttributeError when using Windows embeddable package

2022-01-20 Thread sparrowt


sparrowt  added the comment:

Thanks, yes CLA should now be working its way through the system.

I guess a side question is: is it expected for docstring to have been stripped 
from the windows embeddable distribution, and how is that done if not with -OO? 
(I found --without-doc-strings but not any build scripts using it)

This patch is still valid either way I think - better to show a helpful error 
than to explode - but I am intrigued as to the reason behind this case, 
deliberate or not. e.g. is there an assumption that the embed redistributable 
is never going to be used interactively & thus we might as well save space?

--

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



[issue46434] pdb help fails with AttributeError when using Windows embeddable package

2022-01-20 Thread sparrowt


sparrowt  added the comment:

Gottit thanks for explaining - so the existing check in `do_help` didn't catch 
this case because https://docs.python.org/3/library/sys.html#sys.flags only 
reflects command line flags, rather than whether or not it was actually 
optimised.

--

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



[issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount()

2020-03-04 Thread sparrowt


Change by sparrowt :


--
nosy: +sparrowt

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