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",
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
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
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
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
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
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
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
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
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
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
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
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
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
> * `
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
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
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
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
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
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,
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'`
--
Changes by Gerrit Holl :
--
versions: +Python 3.6
___
Python tracker
<http://bugs.python.org/issue29155>
___
___
Python-bugs-list mailing list
Unsubscribe:
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,
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
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
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
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
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
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
Gerrit Holl added the comment:
>>> round(21345, -2)
21300
Desired and useful to me.
--
nosy: +Gerrit.Holl
___
Python tracker
<http://bugs.python.or
Changes by Gerrit Holl :
--
pull_requests: +304
___
Python tracker
<http://bugs.python.org/issue29677>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Gerrit Holl :
--
type: -> crash
___
Python tracker
<http://bugs.python.org/issue24538>
___
___
Python-bugs-list mailing list
Unsubscrib
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
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
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
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
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
37 matches
Mail list logo