[issue45217] ConfigParser does not accept "No value" reversely to the doc

2021-09-16 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +26809 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28396 ___ Python tracker <https://bugs.python.org/issu

[issue45216] Remove redundand information from difflib docstrings

2021-09-18 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch nosy: +sobolevn nosy_count: 2.0 -> 3.0 pull_requests: +26848 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28445 ___ Python tracker <https://bugs.python.org/i

[issue45254] HAS_SHMEM detection logic is duplicated in implementation and tests

2021-09-21 Thread Nikita Sobolev
New submission from Nikita Sobolev : `HAS_SHMEM` is defined in `multiprocessing.managers` module https://github.com/python/cpython/blob/0bfa1106acfcddc03590e1f5d6789dbad3affe70/Lib/multiprocessing/managers.py#L35-L40 Later the same logic is duplicated in `_test_multiprocessing`: https

[issue45254] HAS_SHMEM detection logic is duplicated in implementation and tests

2021-09-21 Thread Nikita Sobolev
Change by Nikita Sobolev : -- components: +Tests versions: +Python 3.10, Python 3.11, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue45

[issue45254] HAS_SHMEM detection logic is duplicated in implementation and tests

2021-09-21 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +26883 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28487 ___ Python tracker <https://bugs.python.org/issu

[issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2021-09-21 Thread Nikita Sobolev
Nikita Sobolev added the comment: Happened to me today: https://dev.azure.com/Python/cpython/_build/results?buildId=88208&view=logs&j=c83831cd-3752-5cc7-2f01-8276919eb334&t=5a421c4a-0933-53d5-26b9-04b36ad165eb ``` test_sendfile_close_peer_in_the_middle_

[issue45269] c_make_encoder() has uncovered error: "argument 1 must be dict or None"

2021-09-23 Thread Nikita Sobolev
New submission from Nikita Sobolev : Looks like we never test error that `markers` are limited to `None` and `dict` types. Here: https://github.com/python/cpython/blob/main/Modules/_json.c#L1252-L1255 Coverage report: https://app.codecov.io/gh/python/cpython/blob/master/Modules/_json.c line

[issue45269] c_make_encoder() has uncovered error: "argument 1 must be dict or None"

2021-09-24 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +26924 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28540 ___ Python tracker <https://bugs.python.org/issu

[issue45280] Empty typing.NamedTuple creation is not tested

2021-09-24 Thread Nikita Sobolev
New submission from Nikita Sobolev : While working on `mypy` support of `NamedTuple`s (https://github.com/python/mypy/issues/11047), I've noticed that currently when testing `typing.NamedTuple` cases like: 1. `N = NamedTuple('N')` and 2. ```python class N(NamedTuple):

[issue45281] Make `is_attribute` and `module` arguments to `ForwardRef` kw-only

2021-09-24 Thread Nikita Sobolev
New submission from Nikita Sobolev : After https://github.com/python/cpython/pull/28279 and https://bugs.python.org/issue45166 `ForwardRef` and `_type_check` now have `is_class` kw-only argument. It is now inconsistent with `is_argument` and `module` arguments. It would be quite nice to make

[issue45283] Top / function argument level ClassVar should not be allowed during `get_type_hints()`

2021-09-24 Thread Nikita Sobolev
New submission from Nikita Sobolev : This code currently does not raise any issues: ```python # contents of `ex.py` from typing import ClassVar a: ClassVar[int] = 1 def b(c: ClassVar[int]): ... ``` And then: 1. Module: `python -c 'import ex; from typing import get_type_hints;

[issue45275] Make argparse print description of subcommand when invoke help doc on subcommand

2021-09-25 Thread Nikita Sobolev
Nikita Sobolev added the comment: Hi! >From your description it is not clear how exactly you create your subcommand. >From my experience, it works. Demo: ``` import argparse parser = argparse.ArgumentParser(description='Process some integers.') subparsers = parse

[issue45280] Empty typing.NamedTuple creation is not tested

2021-09-25 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +26942 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28559 ___ Python tracker <https://bugs.python.org/issu

[issue45283] Top / function argument level ClassVar should not be allowed during `get_type_hints()`

2021-09-25 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +26946 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28563 ___ Python tracker <https://bugs.python.org/issu

[issue45283] Top / function argument level ClassVar should not be allowed during `get_type_hints()`

2021-09-25 Thread Nikita Sobolev
Nikita Sobolev added the comment: Just to bring in some context for this discussion: https://github.com/python/cpython/pull/28279 We have dicussed in the PR above that current implementation depends on existing of `__future__` import of `annotations`. With `from __future__ import

[issue45283] Top / function argument level ClassVar should not be allowed during `get_type_hints()`

2021-09-25 Thread Nikita Sobolev
Nikita Sobolev added the comment: Thank you, Ken Jin! Very clear explanation! > It seems the current consensus is to use that import for code with purely > static typing, and not use it with runtime typing libraries. Is it an official position? Or just a common usage pattern? What can

[issue45366] dataclass init=False field with default works but default_factory does not

2021-10-05 Thread Nikita Sobolev
Nikita Sobolev added the comment: Right now `dataclasses.py` has this explanation: https://github.com/python/cpython/blame/07cf10bafc8f6e1fcc82c10d97d3452325fc7c04/Lib/dataclasses.py#L962-L966 ``` if isinstance(getattr(cls, f.name, None), Field): if f.default is MISSING

[issue45520] Frozen dataclass deep copy doesn't work with __slots__

2021-10-22 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch nosy: +sobolevn nosy_count: 3.0 -> 4.0 pull_requests: +27423 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29147 ___ Python tracker <https://bugs.python.org/i

[issue45125] Improve tests and docs of how `pickle` works with `SharedMemory` obejcts

2021-10-22 Thread Nikita Sobolev
Nikita Sobolev added the comment: Thanks everyone. It is now fixed -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45566] `test_frozen_pickle` does not use all possible `pickle` protocols

2021-10-22 Thread Nikita Sobolev
New submission from Nikita Sobolev : While working on https://github.com/python/cpython/pull/29147 I've noticed that `test_frozen_pickle` does not use all possible `pickle` protocols: https://github.com/python/cpython/blob/276468dddb46c54980c782c09cdb53bd90755752/Lib/test/test_dataclass

[issue45566] `test_frozen_pickle` does not use all possible `pickle` protocols

2021-10-22 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +27427 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29150 ___ Python tracker <https://bugs.python.org/issu

[issue45524] Cross-module dataclass inheritance breaks get_type_hints

2021-10-22 Thread Nikita Sobolev
Nikita Sobolev added the comment: I had some time to debug this. It happens because we treat classes and functions differently. The difference between `get_type_hints(B)` and `get_type_hints(B.__init__)` is that we use different `global` contexts there: - For `B` we use `__mro__` entries

[issue45524] Cross-module dataclass inheritance breaks get_type_hints

2021-10-22 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +27433 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29158 ___ Python tracker <https://bugs.python.org/issu

[issue45574] Warning: ‘print_escape’ defined but not used

2021-10-22 Thread Nikita Sobolev
New submission from Nikita Sobolev : Recently, GitHub started to show a new warning: > Check warning on line 999 in Parser/tokenizer.c > GitHub Actions / Address sanitizer > Parser/tokenizer.c#L999 > ‘print_escape’ defined but not used [-Wunused-function] Link: https://githu

[issue45577] Make `test_zoneinfo.py` to check all pickle protocols

2021-10-22 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now it only uses a default one. Examples: - `3.9`: https://github.com/python/cpython/blob/aa8c3446c085175e65e736b0d2e32719c4d2/Lib/test/test_zoneinfo/test_zoneinfo.py#L1407 - `3.10`: https://github.com/python/cpython/blob

[issue45577] Make `test_zoneinfo.py` to check all pickle protocols

2021-10-22 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +27440 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29167 ___ Python tracker <https://bugs.python.org/issu

[issue45574] Warning: ‘print_escape’ defined but not used

2021-10-22 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +27445 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29172 ___ Python tracker <https://bugs.python.org/issu

[issue45574] Warning: ‘print_escape’ defined but not used

2021-10-22 Thread Nikita Sobolev
Change by Nikita Sobolev : -- components: +Parser nosy: +lys.nikolaou, pablogsal type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 ___ Python tracker <https://bugs.python.org/issu

[issue45524] Cross-module dataclass inheritance breaks get_type_hints

2021-10-22 Thread Nikita Sobolev
Nikita Sobolev added the comment: I completelly agree that the exable above is out of scope. Because it requires `locals()` to be modified. While this issue is focused on `globals()`. -- ___ Python tracker <https://bugs.python.org/issue45

[issue45580] argparse.ArgumentParser.add_mutually_exclusive_group : metavar create parenthesis undefined behavior

2021-10-23 Thread Nikita Sobolev
Nikita Sobolev added the comment: I confirm this happens on all recent Python versions. The source of this problem is that `argparse` uses `regex` module to replace some substrings. Direct link: https://github.com/python/cpython/blame/8ce20bbdd6d2b1277a5e74154fcdcef2cb0fee49/Lib/argparse.py

[issue45580] argparse.ArgumentParser.add_mutually_exclusive_group : metavar create parenthesis undefined behavior

2021-10-23 Thread Nikita Sobolev
Nikita Sobolev added the comment: Maybe instead we can show users something like: ``` usage: ex.py [-h] (-p '/var/www/html' | -r 'http)s(://Host:Port') [--last-args LAST_ARGS] ``` ? -- components: +Library (Lib) -Parser type: -> behavior versions: +P

[issue45524] Cross-module dataclass inheritance breaks get_type_hints

2021-10-24 Thread Nikita Sobolev
Nikita Sobolev added the comment: In my opinion, it is never a bad thing to create a new issue :) сб, 23 окт. 2021 г. в 22:46, Sergei Lebedev : > > Sergei Lebedev added the comment: > > Is it worth filing a separate issue for locals()? > > In my experience local classes ar

[issue45604] multiprocessing.log_to_stderr missing documentation for parameter

2021-10-26 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch nosy: +sobolevn nosy_count: 2.0 -> 3.0 pull_requests: +27490 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29226 ___ Python tracker <https://bugs.python.org/i

[issue45604] multiprocessing.log_to_stderr missing documentation for parameter

2021-10-28 Thread Nikita Sobolev
Nikita Sobolev added the comment: Thanks, Łukasz! чт, 28 окт. 2021 г. в 23:04, Łukasz Langa : > > Change by Łukasz Langa : > > > -- > resolution: -> fixed > stage: patch review -> resolved > status: open -> closed > versions: +Python 3.10,

[issue45666] Warning: "'swprintf' : format string '%s' requires an argument of type 'unsigned short *', but variadic argument 1 has type 'const char *'"

2021-10-29 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now GitHub emmits this warning: ``` GitHub Actions / Windows (x64) Programs/_testembed.c#L1735 'swprintf' : format string '%s' requires an argument of type 'unsigned short *', but variadic argument 1 has type 'c

[issue45666] Warning: "'swprintf' : format string '%s' requires an argument of type 'unsigned short *', but variadic argument 1 has type 'const char *'"

2021-10-29 Thread Nikita Sobolev
Change by Nikita Sobolev : -- components: +Build -Library (Lib) ___ Python tracker <https://bugs.python.org/issue45666> ___ ___ Python-bugs-list mailin

[issue45666] Warning: "'swprintf' : format string '%s' requires an argument of type 'unsigned short *', but variadic argument 1 has type 'const char *'"

2021-10-29 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +27576 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29307 ___ Python tracker <https://bugs.python.org/issu

[issue45672] Mutation tests results of typing.py

2021-10-29 Thread Nikita Sobolev
New submission from Nikita Sobolev : I've decided to test `typing.py` with `cosmic-ray` mutation testing framework. It identified 3 potential problems. Config: ``` [cosmic-ray] module-path = "Lib/typing.py" timeout = 15.0 excluded-modules = [] test-command = "./p

[issue45672] Mutation tests results of typing.py

2021-10-29 Thread Nikita Sobolev
Nikita Sobolev added the comment: I can send a PR to have 100% mutation coverage for `typing.py`. I think that a single test can do that. -- ___ Python tracker <https://bugs.python.org/issue45

[issue45578] Missing tests for the dis module

2021-10-30 Thread Nikita Sobolev
Nikita Sobolev added the comment: I would like to work on it! :) Going to send a PR today. -- nosy: +sobolevn ___ Python tracker <https://bugs.python.org/issue45

[issue45578] Missing tests for the dis module

2021-10-30 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +27600 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29332 ___ Python tracker <https://bugs.python.org/issu

[issue45578] Missing tests for the dis module

2021-10-30 Thread Nikita Sobolev
Nikita Sobolev added the comment: Looks like `findlabels` is documented: https://docs.python.org/3/library/dis.html#dis.findlabels -- ___ Python tracker <https://bugs.python.org/issue45

[issue45679] typing.Literal[True] is implicitly converted to typing.Literal[1]

2021-10-30 Thread Nikita Sobolev
Nikita Sobolev added the comment: This happens to all `lru_cache` calls, where we deal with container types. Example: ``` from functools import lru_cache @lru_cache(typed=True) def test(arg): return str(arg) print(test((1, 'a'))) # (1, 'a') print(test((Tr

[issue45679] typing.Literal[True] is implicitly converted to typing.Literal[1]

2021-10-30 Thread Nikita Sobolev
Nikita Sobolev added the comment: I see several ways of solving this: 1. Make `lru_cache(typed=True)` to look into iterable internals. This might be slow. And very slow for large iterables. Maybe even infinite for infinite ones 2. Adapt `Literal` / possibly other types to be treated

[issue45679] typing.Literal[True] is implicitly converted to typing.Literal[1]

2021-10-30 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +27601 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29333 ___ Python tracker <https://bugs.python.org/issu

[issue45679] typing.Literal[True] is implicitly converted to typing.Literal[1]

2021-10-31 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +27605 pull_request: https://github.com/python/cpython/pull/29339 ___ Python tracker <https://bugs.python.org/issue45

[issue45666] Warning: "'swprintf' : format string '%s' requires an argument of type 'unsigned short *', but variadic argument 1 has type 'const char *'"

2021-10-31 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +27608 pull_request: https://github.com/python/cpython/pull/29341 ___ Python tracker <https://bugs.python.org/issue45

[issue45701] Add tuple tests to `functools.lru_cache`

2021-11-03 Thread Nikita Sobolev
New submission from Nikita Sobolev : Context: https://bugs.python.org/issue45679 We need to add tests that `tuple` works as expected with `functools.lru_cache`, including `1` / `1.0` / `True` and `0` / `0.0` / `False` special cases. PR: https://github.com/python/cpython/pull/29339

[issue45701] Add tuple tests to `functools.lru_cache`

2021-11-03 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +27641 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29339 ___ Python tracker <https://bugs.python.org/issu

[issue45578] Missing tests for the dis module

2021-11-03 Thread Nikita Sobolev
Nikita Sobolev added the comment: Only `findlabels` tests are left! -- ___ Python tracker <https://bugs.python.org/issue45578> ___ ___ Python-bugs-list mailin

[issue45615] Missing test for type of error when printing traceback for non-exception

2021-11-04 Thread Nikita Sobolev
Nikita Sobolev added the comment: For me something different happens now: ``` Python 3.11.0a1+ (heads/main-dirty:e03e50377d, Nov 4 2021, 13:09:20) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license" fo

[issue45708] PEP 515-style formatting with underscores does not seem to work for Decimal

2021-11-04 Thread Nikita Sobolev
Nikita Sobolev added the comment: It is not hard to fix (https://github.com/python/cpython/blob/2c045bd5673d56c3fdde7536da9df1c7d6f270f0/Modules/_decimal/libmpdec/io.c#L857-L863): ```c /* thousands separator */ if (*cp == ',' || *cp == '_') { spec->dot

[issue45615] Missing test for type of error when printing traceback for non-exception

2021-11-04 Thread Nikita Sobolev
Nikita Sobolev added the comment: Yes, I would love to! Thanks :) I will wait for GH-29207 to be merged first. чт, 4 нояб. 2021 г. в 14:02, Irit Katriel : > > Irit Katriel added the comment: > > Nikita, if you want to work on this go head, but I would wait until PR > 29207 i

[issue45708] PEP 515-style formatting with underscores does not seem to work for Decimal

2021-11-04 Thread Nikita Sobolev
Nikita Sobolev added the comment: More context Original commit with `_` format: https://github.com/python/cpython/commit/89e1b1aae0775341735de6bc5e97b3c1e9cea0fa -- ___ Python tracker <https://bugs.python.org/issue45

[issue45615] Missing test for type of error when printing traceback for non-exception

2021-11-05 Thread Nikita Sobolev
Nikita Sobolev added the comment: Thanks! пт, 5 нояб. 2021 г. в 12:47, Irit Katriel : > > Irit Katriel added the comment: > > It's been merged now, so go ahead. > > Note that there are two traceback printing functions - in the interpreter > in traceback.c and in t

[issue45708] PEP 515-style formatting with underscores does not seem to work for Decimal

2021-11-06 Thread Nikita Sobolev
Nikita Sobolev added the comment: > We do need to think about the implications of making local changes to our > copy of the externally-maintained libmpdec library, though. It looks like quite similar changes have already been made: https://github.com/python/cpython/

[issue45615] Missing test for type of error when printing traceback for non-exception

2021-11-06 Thread Nikita Sobolev
Nikita Sobolev added the comment: Couple of thoughts. 1. You have to create quite complex structural "clone" of `Exception` for python-based `traceback`: ```python def test_non_exception_subtype(self): class RegularObject: __tracebac

[issue45615] Missing test for type of error when printing traceback for non-exception

2021-11-07 Thread Nikita Sobolev
Nikita Sobolev added the comment: 1. Thanks! Yes, this is exactly the case I am talking about. Right now, this test won't pass: ``` def test_print_exception_bad_type_python(self): with self.assertRaises(TypeError): traceback.print_exception(42) ``` Why? Becau

[issue45878] Use `self.assertRaises` instead of `try/except` in `ctypes/test_functions.py::test_mro`

2021-11-23 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now this test uses `try: ... except TypeError: ...` to ensure that mro is consistent. This has a flaw: code in `try` might not ever raise and this test would still pass. I will refactor it to use `self.assertRaises` to be 100% sure

[issue45878] Use `self.assertRaises` instead of `try/except` in `ctypes/test_functions.py::test_mro`

2021-11-23 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +27957 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29721 ___ Python tracker <https://bugs.python.org/issu

[issue45878] Use `self.assertRaises` instead of `try/except` in `ctypes/test_functions.py::test_mro`

2021-12-02 Thread Nikita Sobolev
Change by Nikita Sobolev : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45756] mock raises exception when using a spec with an attribute that raises exception on access

2021-12-03 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch nosy: +sobolevn nosy_count: 3.0 -> 4.0 pull_requests: +28125 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29901 ___ Python tracker <https://bugs.python.org/i

[issue41768] unittest.mock spec calls class properties

2021-12-03 Thread Nikita Sobolev
Nikita Sobolev added the comment: Related PR: https://github.com/python/cpython/pull/29901 -- nosy: +sobolevn ___ Python tracker <https://bugs.python.org/issue41

[issue45993] Main branch of CPython does not build anymore on macOS

2021-12-06 Thread Nikita Sobolev
New submission from Nikita Sobolev : New version of `main` branch does not build for me anymore. Command: `make -j` System information: - macOS 10.14.6 - Apple clang version 11.0.0 (clang-1100.0.33.16) I am also attaching resulting Makefile. Output: ``` » make -j gcc -L/usr/local/opt

[issue45993] Main branch of CPython does not build anymore on macOS

2021-12-06 Thread Nikita Sobolev
Nikita Sobolev added the comment: Looks like removing cache worked. Thanks! -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

<    1   2   3   4