[issue34861] Improve cProfile standard output

2022-03-23 Thread Daniël van Noord

Daniël van Noord  added the comment:

I have resubmitted the patch that changes the default sorting order in 
https://github.com/python/cpython/pull/31929 as it was asked to separate that 
from the original patch by Anders.

I also added documentation changes that follow from changing the default 
sorting order.

--
nosy: +danielnoord

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



[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2022-03-18 Thread Daniël van Noord

Daniël van Noord  added the comment:

@Bayard Randel, do you want to make this patch into a GitHub PR? If not, I 
could help by doing so and try to get this landed.

--
nosy: +danielnoord

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



[issue16845] warnings.simplefilter should validate input

2022-03-18 Thread Daniël van Noord

Daniël van Noord  added the comment:

I have submitted the path by @berker.peksag with one additional test case in a 
new PR.

@nanjekyejoannah I saw you responded to the other PR, but that died down. Would 
you mind taking a look at mine? I'm happy to help land this :)

--
nosy: +danielnoord

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



[issue2604] doctest.DocTestCase fails when run repeatedly

2022-03-16 Thread Daniël van Noord

Daniël van Noord  added the comment:

I have created a PR that combines the patch here with the patch from issue9736.

--
nosy: +danielnoord

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



[issue35212] Expressions with format specifiers in f-strings give wrong code position in AST

2022-03-16 Thread Daniël van Noord

Daniël van Noord  added the comment:

This was fixed by https://github.com/python/cpython/pull/27729.

On 3.10:
```console
>>> ast.parse("f'{a}'").body[0].value.values[0].value.col_offset
3
>>> ast.parse("f'{a:b}'").body[0].value.values[0].value.col_offset
3
```

The other issue also no longer reproduces.

--
message_count: 3.0 -> 4.0
nosy: +danielnoord
nosy_count: 5.0 -> 6.0
pull_requests: +30022
pull_request: https://github.com/python/cpython/pull/27729

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



[issue25804] Make Profile.print_stats support sorting by mutiple values

2022-03-16 Thread Daniël van Noord

Daniël van Noord  added the comment:

@wdv4758h, do you think you will be able to resubmit the patch to Github? This 
would probably still be a useful addition and some review has already been done.

If not, I could pick up the patch and re-submit, but I don't want to take 
credit for your work unnecessarily.

--
nosy: +danielnoord

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



[issue46507] enabling cProfile to profile code given as an argument "à la" timeit

2022-03-16 Thread Daniël van Noord

Daniël van Noord  added the comment:

There were some comments on the (now closed) PR associated to this report.

One was about requiring a new flag to tell cProfile to consider the code in 
question code instead of a file path. `-c` was proposed, I presume abbreviating 
`--code`. Is this indeed the way to go? Allow `cProfile` to profile code 
directly by supplying the `-c` or `--code` argument, which indicates that the 
last argument should be considered code instead of a file path?

--
nosy: +danielnoord

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



[issue18795] pstats - allow stats sorting by cumulative time per call and total time per call

2022-03-15 Thread Daniël van Noord

Daniël van Noord  added the comment:

I resubmitted the original patch and updated it with documentation and news 
item changes.

This would still be a valuable addition imo, as it can help single out 
expensive calls in your module/script.

--
nosy: +danielnoord

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



[issue46241] importlib.utils.find_spec() has issues with "tests" folder

2022-01-05 Thread Daniël van Noord

Daniël van Noord  added the comment:

Thanks Brett for that explanation!

Makes sense actually now that I think about it. I also wondered how astroid got 
onto my sys.path, but that's something for another time :)

--

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



[issue46241] importlib.utils.find_spec() has issues with "tests" folder

2022-01-03 Thread Daniël van Noord

Change by Daniël van Noord :


--
components: +Library (Lib)

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



[issue46241] importlib.utils.find_spec() has issues with "tests" folder

2022-01-03 Thread Daniël van Noord

New submission from Daniël van Noord :

Affected folder structure:
── module_loader
│   ├── __init__.py
├── pyproject.toml
├── setup.cfg
└── tests
└── test_module_loader.py

```console
❯ cat 
'/Users/daniel/DocumentenLaptop/Programming/Test/module_loader/module_loader/__init__.py'
from importlib import util


def load_a_spec(modname):
return util.find_spec(modname)
```

```console
❯ cat 
'/Users/daniel/DocumentenLaptop/Programming/Test/module_loader/tests/test_module_loader.py'
from module_loader import load_a_spec


def test_me():
load_a_spec("tests")
```

When I run `pytest` from within the `module_loader` directory and inspect what 
`load_a_spec` returns I find that it returns:

ModuleSpec(name='tests', loader=<_frozen_importlib_external.SourceFileLoader 
object at 0x10a4b4820>, 
origin='/Users/daniel/DocumentenLaptop/Programming/Github/astroid/tests/__init__.py',
 
submodule_search_locations=['/Users/daniel/DocumentenLaptop/Programming/Github/astroid/tests'])

It seems to take the `tests` folder from another project, in this case astroid, 
and returns its spec. 
This is my `sys.path`, which might be relevant:

```console
for i in sys.path:print(i)
/Users/daniel/DocumentenLaptop/Programming/Test/module_loader/tests
/usr/local/bin
/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python39.zip
/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9
/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload
/Users/daniel/Library/Python/3.9/lib/python/site-packages
/usr/local/lib/python3.9/site-packages
/Users/daniel/DocumentenLaptop/Programming/Github/astroid
/Users/daniel/DocumentenLaptop/Programming/Github/DanielNoord/docstringformatter
/Users/daniel/DocumentenLaptop/Programming/Test/module_loader
/usr/local/Cellar/pybind11/2.8.1/libexec/lib/python3.9/site-packages
```

Let me know if I'm doing anything wrong, but I would expect the returned spec 
to be from `module_loader` instead of another project.

--
files: module_loader.zip
messages: 409579
nosy: brett.cannon, danielnoord
priority: normal
severity: normal
status: open
title: importlib.utils.find_spec() has issues with "tests" folder
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50538/module_loader.zip

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