[issue11494] Confusing error message from warnings.warn

2011-03-14 Thread Gerrit Holl
New submission from Gerrit Holl : When accidentally passing a string to warnings.warn where one should pass a Warning-class, the error message is rather confusing: $ ./python Python 2.7.1+ (release27-maint:88766, Mar 8 2011, 16:51:59) [GCC 4.4.5] on linux2 Type "help",

[issue10563] Spurious newline in time.ctime

2010-11-28 Thread Gerrit Holl
New submission from Gerrit Holl : When the time passed to time.ctime is large, it adds a newline: >>> import time >>> time.ctime(2<<36) 'Wed Apr 8 17:04:32 6325' >>> time.ctime(2<<37) 'Wed Jul 14 08:09:04 10680\n' -- c

[issue10563] Spurious newline in time.ctime

2010-11-28 Thread Gerrit Holl
Gerrit Holl added the comment: I'm on a 64bit system (kubuntu lucid lynx) $ uname -a Linux sjisjka 2.6.32-25-generic #45-Ubuntu SMP Sat Oct 16 19:52:42 UTC 2010 x86_64 GNU/Linux -- ___ Python tracker <http://bugs.python.org/is

[issue10563] Spurious newline in time.ctime

2010-11-28 Thread Gerrit Holl
Gerrit Holl added the comment: Yes, this solves the issue: $ ./python Python 3.1.3 (r313:86834, Nov 28 2010, 17:34:23) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import time

[issue44168] Wrong syntax error hint when spurious colon present in function keyword comprehension assignment

2021-05-18 Thread Gerrit Holl
New submission from Gerrit Holl : In Python 3.9.4, in a function call, when assigning a comprehension to a keyword argument, and the comprehension contains a spurious colon (if a list or set comprehension) or a missing value (when a dict comprehension), the syntax error message gives a hint

[issue39419] Core dump when trying to use workaround for custom warning category (Fatal Python error: init_sys_streams: can't initialize sys standard streams)

2020-01-22 Thread Gerrit Holl
New submission from Gerrit Holl : Pythons commandline warning filter cannot currently handle custom warning categories. See https://bugs.python.org/issue22543 I tried a workaround as suggested on Stack Overflow <https://stackoverflow.com/a/53538033/974555> to filter on a warning ca

[issue40449] multi-line f-string, syntaxerror points to wrong line

2020-04-30 Thread Gerrit Holl
New submission from Gerrit Holl : When there is a syntax error in a multi-line f-string, the arrow in the reported syntax error points to the wrong line: $ cat mwe.py s = ("apricot " "pineapple" f"shallot{") $ python mwe.py File &quo

[issue29672] `catch_warnings` context manager should reset warning registry to previous state upon exiting, to prevent warnings from being reprinted

2017-07-18 Thread Gerrit Holl
Gerrit Holl added the comment: I get bitten by this frequently, and find myself patching many libraries just to avoid them from calling .catch_warnings. Does anyone know whether to fix this it would suffice to edit warnings.py, or would I need to dig into _warnings.c as well

[issue29672] `catch_warnings` context manager causes all warnings to be printed every time, even after exiting

2017-07-18 Thread Gerrit Holl
Changes by Gerrit Holl : -- title: `catch_warnings` context manager should reset warning registry to previous state upon exiting, to prevent warnings from being reprinted -> `catch_warnings` context manager causes all warnings to be printed every time, even after exit

[issue22543] -W option cannot use non-standard categories

2018-11-29 Thread Gerrit Holl
Gerrit Holl added the comment: There is a thread on StackOverflow related to this problem: https://stackoverflow.com/q/42495641/974555 The (currently only and accepted) answer proposes as a workaround to set the PYTHONPATH variable, as the contents of those apparently *are* already in

[issue36079] pdb on setuptools "ValueError: underlying buffer has been detached"

2019-02-22 Thread Gerrit Holl
New submission from Gerrit Holl : I am unable to use `pdb` to debug a problem I have with the `python-hdf4` installer. The exception in the program to be debugged is printed twice, followed by an exception in pdb itself, ending with `ValueError: underlying buffer has been detached`. See

[issue4180] warnings.simplefilter("always") does not make warnings always show up

2017-04-18 Thread Gerrit Holl
Gerrit Holl added the comment: I believe this fix causes this bug: http://bugs.python.org/issue29672 -- nosy: +Gerrit.Holl ___ Python tracker <http://bugs.python.org/issue4

[issue30616] Cannot use functional API to create enum with zero values

2017-06-09 Thread Gerrit Holl
New submission from Gerrit Holl: The OO API allows to create empty enums, i.e. without any values. However, the functional API does not, as this will result in an IndexError as shown below: In [1]: import enum In [2]: class X(enum.IntFlag): pass In [3]: Y = enum.IntFlag(&q

[issue34487] enum _sunder_ names mix metaclass and enum class attributes

2018-08-24 Thread Gerrit Holl
New submission from Gerrit Holl : In the [`enum` module](https://docs.python.org/3/library/enum.html#supported-sunder-names) documentation, some of the `_sunder_` names are on `EnumMeta`, whereas others are on the produced `Enum` class: > 8.13.15.3.2. Supported `_sunder_` names > * `

[issue21728] Confusing error message when initialising type inheriting object.__init__

2014-06-11 Thread Gerrit Holl
New submission from Gerrit Holl: When I initialise a class that doesn't define its own __init__, but I still pass arguments, the error message is confusing: >>> class A: pass ... >>> A(42) Traceback (most recent call last): File "", line 1, in TypeEr

[issue21798] Allow adding Path or str to Path

2014-06-17 Thread Gerrit Holl
New submission from Gerrit Holl: It would be great if we could "add" either str or Path to Path objects. Currently, we can join paths only by adding a directory, or by replacing the suffix. But sometimes we want to build up a path more directly. With strings we can do that

[issue20314] Potentially confusing formulation in 6.1.4. Template strings

2014-01-20 Thread Gerrit Holl
New submission from Gerrit Holl: The standard library documentation “6.1. string — Common string operations” describes string formatting through the `.format` method and the corresponding mini-language, and the `Template` class. In the part describing the `Template` class (6.1.4) is the text

[issue20503] super behavioru and abstract base classes (either implementation or documentation/error message is wrong)

2014-02-03 Thread Gerrit Holl
New submission from Gerrit Holl: When using an abstract base class, super(type, obj) throws a TypeError stating "obj must be an instance (...) of type", even though isinstance(obj, type) returns True. I'm not sure what is supposed to happen here, but either the error

[issue23680] Sporadic freeze in test_interrupted_write_retry_text

2017-01-04 Thread Gerrit Holl
Gerrit Holl added the comment: I experience this problem when trying to build/test Python 3.6 on the [JASMIN Analysis Platform](http://www.jasmin.ac.uk/services/jasmin-analysis-platform/) which runs Red Hat Enterprise Linux Server release 6.8 on a machine with 48 × Intel(R) Xeon(R) CPU E7

[issue29154] 5 failures in test_doctest: ModuleNotFoundError: No module named 'IPython'

2017-01-04 Thread Gerrit Holl
New submission from Gerrit Holl: I am building and testing Python 3.6 on the JASMIN Analysis Platform <http://www.jasmin.ac.uk/services/jasmin-analysis-platform/>, which runs Red Hat Enterprise Linux Server release 6.8 on a machine with 48 × Intel(R) Xeon(R) CPU E7-4860 v2 @ 2.60GHz,

[issue29154] 5 failures in test_doctest: ModuleNotFoundError: No module named 'IPython'

2017-01-04 Thread Gerrit Holl
Gerrit Holl added the comment: I get the same failure cause in test_pdb and test_zipimport_support, also in situations with tests based on doctest, again getting an unexpected `*** ModuleNotFoundError: No module named 'IPython'` --

[issue29155] test.test_spwd.TestSpwdNonRoot failure with FileNotFoundError:

2017-01-04 Thread Gerrit Holl
Changes by Gerrit Holl : -- versions: +Python 3.6 ___ Python tracker <http://bugs.python.org/issue29155> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29155] test.test_spwd.TestSpwdNonRoot failure with FileNotFoundError:

2017-01-04 Thread Gerrit Holl
New submission from Gerrit Holl: I am building and testing Python 3.6 on the JASMIN Analysis Platform <http://www.jasmin.ac.uk/services/jasmin-analysis-platform/>, which runs Red Hat Enterprise Linux Server release 6.8 on a machine with 48 × Intel(R) Xeon(R) CPU E7-4860 v2 @ 2.60GHz,

[issue29401] Python3.6 docs should not have a "what's new in Python 3.7" page

2017-01-31 Thread Gerrit Holl
New submission from Gerrit Holl: I believe this page is not supposed to exist: https://docs.python.org/3.6/whatsnew/3.7.html Nor this one: https://docs.python.org/3.5/whatsnew/3.6.html Neither are maintained, nor would I expect them to be. -- assignee: docs@python components

[issue29672] `catch_warnings` context manager causes warnings to be reprinted

2017-02-27 Thread Gerrit Holl
New submission from Gerrit Holl: Entering the `catch_warnings` context manager is causing warnings to be printed over and over again, rather than just once as it should. Without such a context manager, the behaviour is as expected: $ cat ./mwe.py #!/usr/bin/env python3.5

[issue29672] `catch_warnings` context manager causes warnings to be reprinted

2017-02-27 Thread Gerrit Holl
Gerrit Holl added the comment: I suppose this is a consequence of the change in: http://bugs.python.org/issue4180 and although I can see why the warnings filter would be reset when entering the context manager, I don't think it is desirable to have side effects for modules that are ent

[issue29672] `catch_warnings` context manager causes warnings to be reprinted

2017-02-27 Thread Gerrit Holl
Gerrit Holl added the comment: To clarify, this behaviour crosses module boundaries. So even if some piece of code many layers deep buried in a module uses this context manager, it has global consequences. -- ___ Python tracker <h

[issue29672] `catch_warnings` context manager should reset warning registry to previous state upon exiting, to prevent warnings from being reprinted

2017-02-28 Thread Gerrit Holl
Changes by Gerrit Holl : -- title: `catch_warnings` context manager causes warnings to be reprinted -> `catch_warnings` context manager should reset warning registry to previous state upon exiting, to prevent warnings from being reprin

[issue29672] `catch_warnings` context manager should reset warning registry to previous state upon exiting, to prevent warnings from being reprinted

2017-02-28 Thread Gerrit Holl
Gerrit Holl added the comment: To resolve this, the `catch_warnings` context manager upon exiting should not only reset `filters`, but also `_filters_version`, and perhaps an associated dictionary? Not sure if I'm understanding the code in `warnings.c` correctly, and whether, for this c

[issue29677] 'round()' accepts a negative integer for ndigits

2017-02-28 Thread Gerrit Holl
Gerrit Holl added the comment: >>> round(21345, -2) 21300 Desired and useful to me. -- nosy: +Gerrit.Holl ___ Python tracker <http://bugs.python.or

[issue29677] 'round()' accepts a negative integer for ndigits

2017-02-28 Thread Gerrit Holl
Changes by Gerrit Holl : -- pull_requests: +304 ___ Python tracker <http://bugs.python.org/issue29677> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24538] os.setxattr PermissionError on panfs propagates up causing `copystat`, `copytree`, and `pip install .` to fail unhepfully

2015-06-30 Thread Gerrit Holl
Changes by Gerrit Holl : -- type: -> crash ___ Python tracker <http://bugs.python.org/issue24538> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue24538] os.setxattr PermissionError on panfs propagates up causing `copystat`, `copytree`, and `pip install .` to fail unhepfully

2015-06-30 Thread Gerrit Holl
New submission from Gerrit Holl: `shutil.copystat` fails on [panfs](https://en.wikipedia.org/wiki/Panasas#PanFS) if the source file lacks u+w, because setting extended attributes results in a `PermissionError`. This leads to higher end functions such as `shutil.copytree` to fail. More

[issue24538] os.setxattr PermissionError on panfs propagates up causing `copystat`, `copytree`, and `pip install .` to fail unhepfully

2015-06-30 Thread Gerrit Holl
Gerrit Holl added the comment: Perhaps the solution would be some kind of flag, at least for copytree and possibly others, on what to do when attributes cannot be completely copied — a bit like numpys options to raise, warn, or ignore

[issue25415] I can create instances of io.IOBase

2015-10-15 Thread Gerrit Holl
New submission from Gerrit Holl: According to the [documentation](https://docs.python.org/3/library/io.html#io.IOBase), `io.IOBase` has no public constructors. Yet I can create objects from it: $ python3.5 Python 3.5.0 (default, Sep 13 2015, 17:20:05) [GCC 4.4.7 20120313 (Red Hat 4.4.7-16

[issue25415] I can create instances of io.IOBase

2015-10-15 Thread Gerrit Holl
Gerrit Holl added the comment: When the documentation says there is no public constructor, I expected it would be impossible to create instances, as in: TypeError: cannot create 'builtin_function_or_method' instances Perhaps I misunderstand the doc

[issue23832] pdb's `longlist` shows only decorator if that one contains a lambda

2015-03-31 Thread Gerrit Holl
New submission from Gerrit Holl: When a decorater contains a `lambda` declaration, using the pdb command `longlist` will show only the definition of the decorator. The definition of the function itself is not shown: cat mini.py #!/usr/bin/python3.4 def foo(x, y=None): return x @foo