New submission from daniel hahler python-b...@thequod.de:
This patch fixes the vimrc example file to use matchadd() instead of :match,
so that the second match does not overwrite the first one.
This resulted in leading tabs not highlighted as BadWhitespace.
--
components: Demos
Changes by daniel hahler python-b...@thequod.de:
--
keywords: +patch
Added file: http://bugs.python.org/file17773/python-vimrc-use-matchadd.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9084
New submission from daniel hahler:
posix.unsetenv fails to clear the environment if there's an entry with an empty
key.
TEST CASE:
Python 2.7.6 (default, Jan 6 2014, 17:05:19)
[GCC 4.8.1] on linux2
Type help, copyright, credits or license for more information.
import os
daniel hahler added the comment:
Please note that I have noticed this not because of setting it via
`os.environ`, but because a program using `os.environ.clear()` crashed:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/1281086
I cannot say how this unusual entry was added
daniel hahler added the comment:
It would help to know if the key was set manually by apport, or if it comes
from the real environment. The environment looks correct:
It comes from the real environment.
I wanted to use apport, but could not from the current shell, because of this
bug.
I
New submission from daniel hahler:
The following code fails on Arch Linux:
import ctypes.util
print(ctypes.util.find_library("ncurses"))
It first looks at "ldconfig -p" (via _findSoname_ldconfig), which only
contains:
libncursesw.so.6 (libc6,x86-64) => /u
New submission from daniel hahler:
Given the following file `t-expected-indent.py`:
```
if 1:
foo
```
python t-expected-indent.py reports:
```
File "t-expected-indent.py", line 2
foo
^
IndentationError: expected an indented block
```
However, it should get reported fo
New submission from daniel hahler :
I was not aware of `python -m test -m …`, but think that supporting `python -m
test test.module.class.name` should be supported for selecting a single test.
--
components: Tests
messages: 320325
nosy: blueyed
priority: normal
pull_requests: 7489
New submission from daniel hahler :
With "." in sys.path the "__file__" attribute will be a relative path, and
therefore cannot be used after "chdir".
This likely affects relative paths in general, but have not tested it.
```
import os
import sys
sys.pa
daniel hahler <python-b...@thequod.de> added the comment:
Just for reference: https://github.com/python/cpython/pull/6233 is about fixing
this.
--
keywords: +patch
nosy: +blueyed
pull_requests: +5995
stage: needs patch -> patch review
_
Change by daniel hahler :
--
nosy: +blueyed
___
Python tracker
<https://bugs.python.org/issue35137>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by daniel hahler :
--
keywords: +patch
pull_requests: +9833
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35270>
___
___
Py
New submission from daniel hahler :
When `parseline` returns `None` for `cmd` (like pdb++ might cause it when
changing a cmd "disable" to "!disable"), the following will cause a TypeError:
> compfunc = getattr(self, 'complete_' + cmd)
"None" should be a
New submission from daniel hahler :
It seems like the "debug" command is not properly handled with "post_mortem()".
It appears due to using `sys.settrace(self.trace_dispatch)` in the end of
`do_debug`, although no tracing is installed with post_mortem in the first
place.
Change by daniel hahler :
--
keywords: +patch
pull_requests: +12431
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36388>
___
___
Py
Change by daniel hahler :
--
keywords: +patch
pull_requests: +12622
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue14841>
___
___
Py
daniel hahler added the comment:
Created a PR at https://github.com/python/cpython/pull/12697.
It prefers stdin and stderr over stdout.
I think stdin is most likely connected to a terminal, and wondered why ncurses
uses stderr/stdout first, and only then stdin.
stdin handling was added
daniel hahler added the comment:
Discovered via / relevant for coverage's PyTracer:
https://github.com/nedbat/coveragepy/issues/787.
--
___
Python tracker
<https://bugs.python.org/issue36
New submission from daniel hahler :
A RecursionError causes the trace function set via `sys.settrace` to get
removed/unset.
Given the following script:
```
import sys
def trace(*args):
print("trace", args)
return trace
sys.settrace(trace)
def f():
f()
print(sy
New submission from daniel hahler :
bdb.Bdb.set_trace should set "f_trace_lines = True" on frames explicitly.
Otherwise they might be skipped if something else has set it to False already,
e.g. via a suggested change for coverage.py to set this for performance reasons
(https://
Change by daniel hahler :
--
keywords: +patch
pull_requests: +12572
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36494>
___
___
Py
Change by daniel hahler :
--
components: +Library (Lib)
title: bdb: should set f_trace_lines = True -> bdb.Bdb.set_trace: should set
f_trace_lines = True
type: -> behavior
___
Python tracker
<https://bugs.python.org/i
New submission from daniel hahler :
pdb should try (hard) to avoid creating unnecessary exceptions, e.g.
``AttributeError`` when looking up commands, since this will show up in
exception chains then (as "'Pdb' object has no attribute 'do_foo'").
See https://github.com/python/cp
Change by daniel hahler :
--
keywords: +patch
pull_requests: +12643
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36550>
___
___
Py
Change by daniel hahler :
--
nosy: blueyed
priority: normal
severity: normal
status: open
title: pdbrc home twice
___
Python tracker
<https://bugs.python.org/issue36
New submission from daniel hahler :
If $HOME is $PWD, .pdbrc is read twice.
This confused me when seeing intentional errors from there twice during tests.
It should be only read once.
--
components: +Library (Lib)
title: pdbrc home twice -> pdbrc is read twice if current direct
Change by daniel hahler :
--
keywords: +patch
pull_requests: +12654
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36563>
___
___
Py
daniel hahler added the comment:
Re-opening: it currently still crashes with a NameError when using "debug
doesnotexist", or "debug doesnotexist()".
Will create a new PR for this.
--
status: closed -> open
___
daniel hahler added the comment:
I can confirm that this fixes cursor keys not working properly after "debug
foo()" (recursive debugging) with pdb.
--
nosy: +blueyed
versions: +Python 3.8
___
Python tracker
<https://bugs.python.o
Change by daniel hahler :
--
pull_requests: +12109
stage: resolved -> patch review
___
Python tracker
<https://bugs.python.org/issue35931>
___
___
Python-
Change by daniel hahler :
--
keywords: +patch
pull_requests: +12347
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36335>
___
___
Py
daniel hahler added the comment:
Just as a sidenote: the other day I was checking Python's source to see how to
override a user's home (in tests, when os.path.expanduser` is used in code),
and found it easy to just set $HOME in the environment in the end.
I guess this change will cause
New submission from daniel hahler :
In https://bugs.python.org/issue36130 is_skipped_module was changed to handle
frames without __name__, but I think it makes sense being able to skip e.g.
frames on frame.f_code.co_name then.
Factoring out is_skipped_frame allows for this.
The default
Change by daniel hahler :
--
pull_requests: +12238
___
Python tracker
<https://bugs.python.org/issue13120>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from daniel hahler :
This is similar to https://bugs.python.org/issue13120.
I have a patch for a fix already, but no test - will add a PR for it.
Fixed in pdbpp in https://github.com/antocuni/pdb/pull/143, which also has a
test that demonstrates it.
--
components
daniel hahler added the comment:
Just for reference: there is a similar issue with `interaction`:
https://bugs.python.org/issue36250.
--
nosy: +blueyed
___
Python tracker
<https://bugs.python.org/issue13
Change by daniel hahler :
--
keywords: +patch
pull_requests: +12239
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36250>
___
___
Py
daniel hahler added the comment:
Bumping.
The first (merged) patch is not sufficient, and causes even an API breakage,
because it disallows passing in a code object (via compile()) anymore.
A better fix is waiting at https://github.com/python/cpython/pull/12103, and
should also get
daniel hahler added the comment:
Example of the API breakage:
```
/opt/python/3.8-dev/lib/python3.8/pdb.py:321: in _cmdloop
self.cmdloop()
/opt/python/3.8-dev/lib/python3.8/cmd.py:138: in cmdloop
stop = self.onecmd(line)
/opt/python/3.8-dev/lib/python3.8/pdb.py:418: in onecmd
Change by daniel hahler :
--
versions: +Python 3.7, Python 3.8, Python 3.9
___
Python tracker
<https://bugs.python.org/issue24565>
___
___
Python-bugs-list mailin
New submission from daniel hahler :
`debug print(` will make pdb crash with a SyntaxError:
% python -c '__import__("pdb").set_trace()'
--Return--
> (1)()->None
(Pdb) print(
*** SyntaxError: unexpected EOF while parsing
(Pdb) debug print(
EN
Change by daniel hahler :
--
keywords: +patch, patch
pull_requests: +11767, 11768
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by daniel hahler :
--
keywords: +patch
pull_requests: +11767
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35931>
___
___
Py
daniel hahler added the comment:
Thanks for the review and backport!
--
___
Python tracker
<https://bugs.python.org/issue35931>
___
___
Python-bugs-list mailin
daniel hahler added the comment:
> In that case the proposed change builds an implicit stack of trace functions
> that is increased each time the interpreter executes this hard breakpoint
Very valid and good point.
Would it work to store it on the class then (once)?
FWIW: pdbp
daniel hahler added the comment:
I've just found that I've created an issue with regard to `do_debug` for this
already (https://bugs.python.org/issue36388), and a PR:
https://github.com/python/cpython/pull/12479.
--
___
Python tracker
<ht
daniel hahler added the comment:
>From my initial comment:
> I've done this via monkeypatching for pdbpp's tests, which resulted in an
> easy 2% coverage gain (https://github.com/antocuni/pdb/pull/253).
It will also affect running tests with coverage (in general, or using tools
li
daniel hahler added the comment:
Just for reference: I've just spent quite some time debugging missing coverage
with pytest, and it turned out that part of it is because of this issue. Most
of the pdb related tests run in a subprocess (via pexpect), but not all of them.
I am using
New submission from daniel hahler :
I'd like to make running compileall optionally during installation, since it
takes quite a while by itself (with lots of output), and gets a bit into the
way when installing often (e.g. with git-bisect).
AFAIK it should not be required, because the files
daniel hahler added the comment:
This can be closed as per
https://github.com/python/cpython/commit/1a2dd82f56bd813aacc570e172cefe55a8a41504.
--
nosy: +blueyed
___
Python tracker
<https://bugs.python.org/issue36
daniel hahler added the comment:
Thanks for this great improvement!
Was about to suggest having something more futureproof when noticing this with
pdbpp, found this, and submitted PRs to use it for ipython and hypothesis also.
--
nosy: +blueyed
daniel hahler added the comment:
Duplicate of https://bugs.python.org/issue10933.
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from daniel hahler :
bdb/pdb currently uses `sys.settrace(None)` when uninstalling its trace
function (trace_dispatch), but should rather store the original trace function
in the beginning and use this instead of `None`.
While typically pdb is not used in tests, it is just
Change by daniel hahler :
--
versions: +Python 3.8
___
Python tracker
<https://bugs.python.org/issue37011>
___
___
Python-bugs-list mailing list
Unsubscribe:
daniel hahler added the comment:
Looks great, thanks!
--
___
Python tracker
<https://bugs.python.org/issue37011>
___
___
Python-bugs-list mailing list
Unsub
New submission from daniel hahler :
Given:
```
class BadRepr:
def __repr__(self):
raise Exception('repr_exc')
obj = BadRepr()
__import__('pdb').set_trace()
```
```
(Pdb) p obj
(Pdb) pp obj
(Pdb)
```
Possible patch - clumsy due to `self._getval` both printing any error already
daniel hahler added the comment:
Thanks for the feedback.
What do you think of refactoring the common block (also used in other places)
into a method?
+except:
+exc_info = sys.exc_info()[:2]
+self.error(traceback.format_exception_only(*exc_info)[-1].strip
New submission from daniel hahler :
With a program like the following, `args` will not display the keyword-only
argument:
```
def f1(arg=None, *, kwonly=None):
__import__('pdb').set_trace()
f1()
```
```
(Pdb) args
arg = 'arg'
kw = 'kw'
```
Related code:
https://github.com/python
daniel hahler added the comment:
It was added in 477c8d5e702 (a huge svn merge commit), with this reference:
r45955 | georg.brandl | 2006-05-10 19:13:20 +0200 (Wed, 10 May 2006) | 4
lines
Patch #721464: pdb.Pdb instances can now be given explicit stdin and
stdout
daniel hahler added the comment:
Just for reference and searchability: this causes tab completion to not work
with `debug foo()` also.
--
___
Python tracker
<https://bugs.python.org/issue31
daniel hahler added the comment:
> I think a good alternative patch might be:
This however makes it behave different in tests, where stdout might be
mocked/wrapped intentionally.
Therefore I think using the parent's `use_rawinput` is the better fix for this
(the originally proposed pa
New submission from daniel hahler :
Currently Pdb.user_exception does not store the traceback in "user_exception",
but only passes it to `interaction`:
def user_exception(self, frame, exc_info):
"""This function is called if an exception occurs,
b
daniel hahler added the comment:
I think this issue itself might be fixed already / changed since 3.5.
I've came up with something similar in this area though, which is only
triggered when using Ctrl-C while pdb is waiting for the next statement:
https://github.com/python/cpython/pull/12880
New submission from daniel hahler :
Without this, and additional SIGINT while waiting for the next statement
(e.g. during `time.sleep`) will stop at `sigint_handler`.
With this patch:
> …/t-pdb-sigint-in-sleep.py(10)()
-> sleep()
(Pdb) c
^C
Program interrupted. (Use
Change by daniel hahler :
--
keywords: +patch
pull_requests: +12804
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36667>
___
___
Py
daniel hahler added the comment:
Would be nice to have this indeed.
Please consider creating a PR with an updated patch then for easier review.
--
nosy: +blueyed
___
Python tracker
<https://bugs.python.org/issue22
daniel hahler added the comment:
Please see https://bugs.python.org/issue36667 for a followup.
It does not look like moving it to `interaction` is relevant for fixing the
leak, is it?
I think it should be restored in both places.
--
nosy: +blueyed
daniel hahler added the comment:
I seems like http.cookiejar should be used for clients, which includes more
relaxed parsing of cookies. This is mentioned in the docs at
https://github.com/python/cpython/blame/443fe5a52a3d6a101795380227ced38b4b5e0a8b/Doc/library/http.cookies.rst#L63-L65
Change by daniel hahler :
--
nosy: +blueyed
___
Python tracker
<https://bugs.python.org/issue23163>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by daniel hahler :
--
nosy: +blueyed
___
Python tracker
<https://bugs.python.org/issue21281>
___
___
Python-bugs-list mailing list
Unsubscribe:
daniel hahler added the comment:
This is a good idea.
I am currently leaning towards using a threading.Lock around `Pdb.interaction`,
or `pdb.set_trace` with pdb++.
This would at least mitigate the issue where `pdb.set_trace` is used in some
code that gets executed again, and two pdb
daniel hahler added the comment:
https://github.com/python/cpython/pull/14316 has a fix.
--
nosy: +blueyed
versions: +Python 3.7, Python 3.8, Python 3.9
___
Python tracker
<https://bugs.python.org/issue26
daniel hahler added the comment:
Another example of a value that fails to parse is if "-" is used instead of
"GMT", which is the case with GitHub:
> Set-Cookie: has_recent_activity=1; path=/; expires=Mon, 22 Apr 2019 23:27:18
> -
So using a regular exp
daniel hahler added the comment:
http.cookiejar parses this correctly, using http2time:
>>> import http.cookiejar
>>> http.cookiejar.parse_ns_headers(["has_recent_activity=1; path=/;
expires=Mon, 22 Apr 2019 23:27:18 -"])
[[('has_re
daniel hahler added the comment:
@Andrei
That is something different, caused by "y" only being defined later.
But it would be nice if it would work. Should be a separate/new issue though.
--
nosy: +blueyed
___
Python track
daniel hahler added the comment:
This works however (Python 3.7), but is just buggy in pdbpp (another project).
--
___
Python tracker
<https://bugs.python.org/issue5
Change by daniel hahler :
--
nosy: +blueyed
___
Python tracker
<https://bugs.python.org/issue9633>
___
___
Python-bugs-list mailing list
Unsubscribe:
daniel hahler added the comment:
Georg, please consider re-opening.
This patch here appears to fix this after all.
--
nosy: +blueyed
versions: +Python 3.6, Python 3.7, Python 3.8, Python 3.9
___
Python tracker
<https://bugs.python.org/issue21
Change by daniel hahler :
--
keywords: +patch
pull_requests: +14925
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/15193
___
Python tracker
<https://bugs.python.org/issu
New submission from daniel hahler :
The long options passed to `getopt.getopt` should not include the leading
dashes:
% python -m pdb --help
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__ma
Change by daniel hahler :
--
pull_requests: +14926
pull_request: https://github.com/python/cpython/pull/15194
___
Python tracker
<https://bugs.python.org/issue21
New submission from daniel hahler :
With e.g. DeprecationWarnings for "invalid escape sequence" the "module" part
is the file name (with ".py" removed), because it calls
PyErr_WarnExplicitObject directly:
https://github.com/python/cpython/blob/3cba3d3c55f230a59
daniel hahler added the comment:
Note that "module" might also be the filename (with ".py" removed).
I've just created issue37634 - might be worth including in your PR if it makes
sense to only document this.
--
nosy: +blueyed
__
daniel hahler added the comment:
This was fixed / can be closed (https://github.com/python/cpython/pull/12064).
--
nosy: +blueyed
___
Python tracker
<https://bugs.python.org/issue36
New submission from daniel hahler :
The following will not stop for debugging:
python3.8 -c 'import pdb; pdb.Pdb(skip=["__main__"]).set_trace()'
The example is contrived, the real case would be to have some "noisy" module
being excluded in general, but when you add an
Change by daniel hahler :
--
keywords: +patch
pull_requests: +16668
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/17159
___
Python tracker
<https://bugs.python.org/issu
daniel hahler added the comment:
The PR appears to need a better test according to
https://github.com/python/cpython/pull/3419#issuecomment-350570083.
--
nosy: +blueyed
___
Python tracker
<https://bugs.python.org/issue17
daniel hahler added the comment:
This is likely covered by existing/linked issues already, but wanted to leave
it here nonetheless:
Given t-pdb.py:
```
import sys
def main():
sys.stdout.write("main...\n")
assert 0
if __name__ == "__main__":
main()
```
daniel hahler added the comment:
The test for issue9815 passes since bbd3cf8f1e (bpo-23890).
It seems like `traceback.clear_frames(tb)` should probably removed altogether?
--
nosy: +vstinner
___
Python tracker
<https://bugs.python.org/issue39
New submission from daniel hahler :
I was a bit surprised to find that unittest's assertRaises clears the locals on
the traceback, which e.g. prevents pytest to display them in case of failures.
This was done via https://bugs.python.org/issue9815
(https://github.com/python/cpython/commit
Change by daniel hahler :
--
keywords: +patch
pull_requests: +17564
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/18180
___
Python tracker
<https://bugs.python.org/issu
New submission from daniel hahler :
It does:
```
if '__args__' in frame.f_locals:
args = frame.f_locals['__args__']
else:
args = None
if args:
s += reprlib.repr(args)
else:
s += '()'
```
However that appears
Change by daniel hahler :
--
keywords: +patch
pull_requests: +17907
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/18531
___
Python tracker
<https://bugs.python.org/issu
daniel hahler added the comment:
Sure: https://github.com/python/cpython/pull/18531
--
___
Python tracker
<https://bugs.python.org/issue39649>
___
___
Python-bug
daniel hahler added the comment:
> And changing this to have to check every time import runs if an entry in
> sys.path is absolute would be costly (that's not a insignificant number of
> stat calls which we always try to avoid during import when possible).
This could be done when
Change by daniel hahler :
--
keywords: +patch
pull_requests: +17276
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/17855
___
Python tracker
<https://bugs.python.org/issu
New submission from daniel hahler :
Exceptions within `__repr__` methods of captured locals
(e.g. via the `capture_locals` argument of `TracebackException`) are not
handled:
```
import traceback
class CrashingRepr:
def __repr__(self):
raise RuntimeError("
New submission from daniel hahler :
I've noticed that `warnings.WarningMessage` is not documented, i.e. it does not
show up in the intersphinx object list.
I'm not sure how to document it best, but maybe just describing its attributes?
Ref:
https://github.com/blueyed/cpython/blob
New submission from daniel hahler :
`Bdb.reset` calls `linecache.checkcache`, which will clear the cache for any
updated source files.
This however might result in displayed source code being different from the
actual code, in case you are editing the file being currently debugged.
I think
Change by daniel hahler :
--
keywords: +patch
pull_requests: +18360
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/19013
___
Python tracker
<https://bugs.python.org/issu
1 - 100 of 123 matches
Mail list logo