[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 that incorrectly suggests that the expression cannot 
contain an assignment:

$ python
Python 3.9.4 | packaged by conda-forge | (default, May 10 2021, 22:13:33)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> f(a={x: for x in {}})
  File "", line 1
f(a={x: for x in {}})
  ^
SyntaxError: expression cannot contain assignment, perhaps you meant "=="?

I certainly didn't mean "==" here.  The syntax is correct if I either remove 
the :, or add a value after the :, such as:

>>> f(a={x:x for x in {}})
>>> f(a={x for x in {}})

(correct syntax, succeeds if f is defined).

The problem here has nothing to do with assignments being in the wrong place, 
so the message reported by cpython is incorrect.

In Python 3.8.10 Python simply and correctly states that the syntax is 
incorrect:

>>> f(a={x: for x in {}})
  File "", line 1
f(a={x: for x in {}})
^
SyntaxError: invalid syntax

I have not tried Python 3.10b1.

--
components: Parser
messages: 393865
nosy: Gerrit.Holl, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Wrong syntax error hint when spurious colon present in function keyword 
comprehension assignment
versions: Python 3.9

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



[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 "mwe.py", line 1
s = ("apricot "
^
SyntaxError: f-string: expecting '}'

Tested with Python 3.7.4 and 3.8.2.

--
components: Interpreter Core
messages: 367753
nosy: Gerrit.Holl
priority: normal
severity: normal
status: open
title: multi-line f-string, syntaxerror points to wrong line
versions: Python 3.7, Python 3.8

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



[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 category 
defined in pandas.errors.__init__.py (DtypeWarning):

PYTHONPATH=/media/nas/x21324/miniconda3/envs/py37e/lib/python3.7/site-packages/pandas/
 python -Werror::errors.DtypeWarning

However, this results in a Fatal Python error and core dump:

Fatal Python error: init_sys_streams: can't initialize sys standard streams
AttributeError: module 'io' has no attribute 'OpenWrapper'

Current thread 0x7f7bb3be76c0 (most recent call first):
Aborted (core dumped)

--
messages: 360469
nosy: Gerrit.Holl
priority: normal
severity: normal
status: open
title: Core dump when trying to use workaround for custom warning category 
(Fatal Python error: init_sys_streams: can't initialize sys standard streams)
type: crash
versions: Python 3.7

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



[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 below, in particular the lower part:

$ python -mpdb setup.py install

python -mpdb setup.py install   
 
> /panfs/e/vol0/gholl/checkouts/python-hdf4/setup.py(11)()  
>  
-> """  
 
(Pdb) cont  
 
running install 
 
running bdist_egg   
 
running egg_info
 
running build_src   
 
build_src   
 
building extension "pyhdf._hdfext" sources  
 
build_src: building npy-pkg config files
   
writing python_hdf4.egg-info/PKG-INFO   
 
writing dependency_links to python_hdf4.egg-info/dependency_links.txt   

writing top-level names to python_hdf4.egg-info/top_level.txt   

reading manifest file 'python_hdf4.egg-info/SOURCES.txt'
 
writing manifest file 'python_hdf4.egg-info/SOURCES.txt'
   
installing library code to build/bdist.linux-x86_64/egg
running install_lib 

running build_py   
running build_ext   
 
customize UnixCCompiler 
  
customize UnixCCompiler using build_ext 

  
building 'pyhdf._hdfext' extension  
  
compiling C sources  
C compiler: gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -fPIC

  
compile options: 
'-I/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/numpy/core/include 
-I/panfs/e/vol0/gholl/venv/py36/include 
-I/hpc/rhome/software/python/3.6.5/include/python3.6m -c'
extra options: '-DNOSZIP'   

Traceback (most recent call last):  
  
  File "/hpc/rhome/software/python/3.6.5/lib/python3.6/pdb.py", line 1667, in 
main
pdb._runscript(mainpyfile)  

  File "/hpc/rhome/software/python/3.6.5/lib/python3.6/pdb.py", line 1548, in 
_runscript 
self.run(statement) 
   
  File "/hpc/rhome/software/python/3.6.5/lib/python3.6/bdb.py", line 434, in 
run  
exec(cmd, globals, locals)  
  
  File "", line 1, in   
 
  File "/panfs/e/vol0/gholl/checkouts/python-hdf4/setup.py", line 11, in 

""" 
   
  File 
"/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/numpy/distutils/core.py",
 line 171, in setup
return old_setup(**new_attr)
   

[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 
sys.path at the time warnings._processoptions is called, unlike site-packages.  
So manually adding site-packages to the PYTHONPATH variable does circumvent 
this problem (tested in Python 3.7.1).

--
nosy: +Gerrit.Holl
versions: +Python 3.6, Python 3.7

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



[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

> * `_name_` – name of the member
> * `_value_` – value of the member; can be set / modified in __new__
> * `_missing_` – a lookup function used when a value is not found; may be 
> overridden
> * `_ignore_` – a list of names, either as a list() or a str(), that will not 
> be transformed into members, and will be removed from the final class
> * `_order_` – used in Python 2/3 code to ensure member order is consistent 
> (class attribute, removed during class creation)
> * `_generate_next_value_` – used by the Functional API and by auto to get an 
> appropriate value for an enum member; may be overridden

Experimentally, it appears `_name_` and `_value_` are on the `Enum` class, 
whereas the others are all on the `EnumMeta` class:

In [272]: class Test(enum.Enum): a = 0

In [273]: Test.a._name_
Out[273]: 'a'

In [274]: Test._name
---
AttributeErrorTraceback (most recent call last)
 in ()
> 1 Test._name

/group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/envs/FCDR37a/lib/python3.7/enum.py
 in __getattr__(cls, name)
344 return cls._member_map_[name]
345 except KeyError:
--> 346 raise AttributeError(name) from None
347 
348 def __getitem__(cls, name):

AttributeError: _name

In [275]: Test.a._value_
Out[275]: 0

In [276]: Test._value
---
AttributeErrorTraceback (most recent call last)
 in ()
> 1 Test._value

/group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/envs/FCDR37a/lib/python3.7/enum.py
 in __getattr__(cls, name)
344 return cls._member_map_[name]
345 except KeyError:
--> 346 raise AttributeError(name) from None
347 
348 def __getitem__(cls, name):

AttributeError: _value

In [277]: Test.a._missing_
Out[277]: >

In [278]: Test._missing_
Out[278]: >


This is not clear from the documentation.

--
assignee: docs@python
components: Documentation
messages: 324003
nosy: Gerrit.Holl, docs@python
priority: normal
severity: normal
status: open
title: enum _sunder_ names mix metaclass and enum class attributes
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

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



[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 <gerrit.h...@gmail.com>:


--
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 exiting

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



[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?

--

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



[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("Y", [])
---
IndexErrorTraceback (most recent call last)
 in ()
> 1 Y = enum.IntFlag("Y", [])

~/lib/python3.6/enum.py in __call__(cls, value, names, module, qualname, type, 
start)
291 return cls.__new__(cls, value)
292 # otherwise, functional API: we're creating a new Enum type
--> 293 return cls._create_(value, names, module=module, 
qualname=qualname, type=type, start=start)
294 
295 def __contains__(cls, member):

~/lib/python3.6/enum.py in _create_(cls, class_name, names, module, qualname, 
type, start)
382 if isinstance(names, str):
383 names = names.replace(',', ' ').split()
--> 384 if isinstance(names, (tuple, list)) and isinstance(names[0], 
str):
385 original_names, names = names, []
386 last_values = []

IndexError: list index out of range

--
messages: 295559
nosy: Gerrit.Holl
priority: normal
severity: normal
status: open
title: Cannot use functional API to create enum with zero values
versions: Python 3.6

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



[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 <rep...@bugs.python.org>
<http://bugs.python.org/issue4180>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-02-28 Thread Gerrit Holl

Changes by Gerrit Holl <gerrit.h...@gmail.com>:


--
pull_requests: +304

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



[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 <rep...@bugs.python.org>
<http://bugs.python.org/issue29677>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 change, it would suffice to change `warnings.py` or 
whether `warnings.c` would need to be updated as well.

--

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



[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 <gerrit.h...@gmail.com>:


--
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 reprinted

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



[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 <rep...@bugs.python.org>
<http://bugs.python.org/issue29672>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 entirely unrelated.

--

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



[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

import warnings

for i in range(3):
try:
print(i, __warningregistry__)
except NameError:
print(i, "first warning")
warnings.warn("I don't like this.", UserWarning)
print(i, __warningregistry__)
#with warnings.catch_warnings():
#pass
print(i, __warningregistry__)
warnings.warn("I don't like this.", UserWarning)
$ ./mwe.py 
0 first warning
./mwe.py:10: UserWarning: I don't like this.
  warnings.warn("I don't like this.", UserWarning)
0 {'version': 0, ("I don't like this.", , 10): True}
0 {'version': 0, ("I don't like this.", , 10): True}
./mwe.py:15: UserWarning: I don't like this.
  warnings.warn("I don't like this.", UserWarning)
1 {'version': 0, ("I don't like this.", , 15): True, 
("I don't like this.", , 10): True}
1 {'version': 0, ("I don't like this.", , 15): True, 
("I don't like this.", , 10): True}
1 {'version': 0, ("I don't like this.", , 15): True, 
("I don't like this.", , 10): True}
2 {'version': 0, ("I don't like this.", , 15): True, 
("I don't like this.", , 10): True}
2 {'version': 0, ("I don't like this.", , 15): True, 
("I don't like this.", , 10): True}
2 {'version': 0, ("I don't like this.", , 15): True, 
("I don't like this.", , 10): True}

Uncommenting the context manager causes the warning to be printed every time:

$ ./mwe.py 
0 first warning
./mwe.py:10: UserWarning: I don't like this.
  warnings.warn("I don't like this.", UserWarning)
0 {'version': 0, ("I don't like this.", , 10): True}
0 {'version': 0, ("I don't like this.", , 10): True}
./mwe.py:15: UserWarning: I don't like this.
  warnings.warn("I don't like this.", UserWarning)
1 {'version': 2, ("I don't like this.", , 15): True}
./mwe.py:10: UserWarning: I don't like this.
  warnings.warn("I don't like this.", UserWarning)
1 {'version': 2, ("I don't like this.", , 15): True, 
("I don't like this.", , 10): True}
1 {'version': 2, ("I don't like this.", , 15): True, 
("I don't like this.", , 10): True}
./mwe.py:15: UserWarning: I don't like this.
  warnings.warn("I don't like this.", UserWarning)
2 {'version': 4, ("I don't like this.", , 15): True}
./mwe.py:10: UserWarning: I don't like this.
  warnings.warn("I don't like this.", UserWarning)
2 {'version': 4, ("I don't like this.", , 15): True, 
("I don't like this.", , 10): True}
2 {'version': 4, ("I don't like this.", , 15): True, 
("I don't like this.", , 10): True}
./mwe.py:15: UserWarning: I don't like this.
  warnings.warn("I don't like this.", UserWarning)

I think this is undesirable.  There is code deep inside a module that I'm using 
that is using the context manager, and as a consequence, I get warnings printed 
every time that should be printed only once.

See also on Stack Overflow: http://stackoverflow.com/q/42496579/974555

--
messages: 288677
nosy: Gerrit.Holl
priority: normal
severity: normal
status: open
title: `catch_warnings` context manager causes warnings to be reprinted
versions: Python 3.5

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



[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: Documentation
messages: 286549
nosy: Gerrit.Holl, docs@python
priority: normal
severity: normal
status: open
title: Python3.6 docs should not have a "what's new in Python 3.7" page
versions: Python 3.5, Python 3.6

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



[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, 2 TiB RAM, and a PanFSⓇ 
<http://www.panasas.com/products/panfs> distributed file system.  
test.test_spwd.TestSpwdNonRoot is failing with FileNotFoundError.  Below is the 
full verbose output of `./python -m test -v test_spwd`:

== CPython 3.6.0 (default, Jan 4 2017, 14:11:04) [GCC 4.4.7 20120313 (Red Hat 
4.4.7-17)]
==   Linux-2.6.32-642.6.2.el6.x86_64-x86_64-with-redhat-6.8-Santiago 
little-endian
==   hash algorithm: siphash24 64bit
==  cwd: /home/users/gholl/src/Python-3.6.0/build/test_python_40357
==  encodings: locale=UTF-8, FS=utf-8
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
Run tests sequentially
0:00:00 [1/1] test_spwd
test_getspnam_exception (test.test_spwd.TestSpwdNonRoot) ... ERROR
test_getspall (test.test_spwd.TestSpwdRoot) ... skipped 'root privileges 
required'
test_getspnam (test.test_spwd.TestSpwdRoot) ... skipped 'root privileges 
required'

==
ERROR: test_getspnam_exception (test.test_spwd.TestSpwdNonRoot)
--
Traceback (most recent call last):
  File "/home/users/gholl/src/Python-3.6.0/Lib/test/test_spwd.py", line 67, in 
test_getspnam_exception
spwd.getspnam(name)
FileNotFoundError: [Errno 2] No such file or directory

--
Ran 3 tests in 0.002s

FAILED (errors=1, skipped=2)
test_spwd failed

1 test failed:
test_spwd

Total duration: 66 ms
Tests result: FAILURE

--
messages: 284651
nosy: Gerrit.Holl
priority: normal
severity: normal
status: open
title: test.test_spwd.TestSpwdNonRoot  failure with FileNotFoundError:

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



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

2017-01-04 Thread Gerrit Holl

Changes by Gerrit Holl <gerrit.h...@gmail.com>:


--
versions: +Python 3.6

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



[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'`

--

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



[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, 2 TiB RAM, and a PanFSⓇ 
<http://www.panasas.com/products/panfs> distributed file system.  I am 
experiencing failures in test_doctest, specifically with `ModuleNotFoundError: 
No module named 'IPython'`.  I don't know why it comes up with IPython at all.

Below is the non-verbose test output.  Attached is the verbose test output.


$ ./python -m test test_doctest
Run tests sequentially
0:00:00 [1/1] test_doctest
**
File "/dev/shm/gerrit/Python-3.6.0/Lib/test/test_doctest.py", line 1841, in 
test.test_doctest.test_debug
Failed example:
try: doctest.debug_src(s)
finally: sys.stdin = real_stdin
Expected:
> (1)()
(Pdb) next
12
--Return--
> (1)()->None
(Pdb) print(x)
12
(Pdb) continue
Got:
*** ModuleNotFoundError: No module named 'IPython'
> (1)()
(Pdb) next
12
--Return--
> (1)()->None
(Pdb) print(x)
12
(Pdb) continue
**
File "/dev/shm/gerrit/Python-3.6.0/Lib/test/test_doctest.py", line 1885, in 
test.test_doctest.test_pdb_set_trace
Failed example:
try: runner.run(test)
finally: sys.stdin = real_stdin
Expected:
--Return--
> (1)()->None
-> import pdb; pdb.set_trace()
(Pdb) print(x)
42
(Pdb) continue
TestResults(failed=0, attempted=3)
Got:
--Return--
*** ModuleNotFoundError: No module named 'IPython'
> (1)()->None
-> import pdb; pdb.set_trace()
(Pdb) print(x)
42
(Pdb) continue
TestResults(failed=0, attempted=3)
**
File "/dev/shm/gerrit/Python-3.6.0/Lib/test/test_doctest.py", line 1914, in 
test.test_doctest.test_pdb_set_trace
Failed example:
try:
runner.run(test)
finally:
sys.stdin = real_stdin
Expected:
--Return--
> (3)calls_set_trace()->None
-> import pdb; pdb.set_trace()
(Pdb) print(y)
2
(Pdb) up
> (1)()
-> calls_set_trace()
(Pdb) print(x)
1
(Pdb) continue
TestResults(failed=0, attempted=2)
Got:
--Return--
*** ModuleNotFoundError: No module named 'IPython'
> (3)calls_set_trace()->None
-> import pdb; pdb.set_trace()
(Pdb) print(y)
2
(Pdb) up
> (1)()
-> calls_set_trace()
(Pdb) print(x)
1
(Pdb) continue
TestResults(failed=0, attempted=2)
**
File "/dev/shm/gerrit/Python-3.6.0/Lib/test/test_doctest.py", line 1952, in 
test.test_doctest.test_pdb_set_trace
Failed example:
try: runner.run(test)
finally: sys.stdin = real_stdin
# doctest: +NORMALIZE_WHITESPACE
Expected:
--Return--
> (3)g()->None
-> import pdb; pdb.set_trace()
(Pdb) list
  1 def g(x):
  2 print(x+3)
  3  -> import pdb; pdb.set_trace()
[EOF]
(Pdb) next
--Return--
> (2)f()->None
-> g(x*2)
(Pdb) list
  1 def f(x):
  2  -> g(x*2)
[EOF]
(Pdb) next
--Return--
> (1)()->None
-> f(3)
(Pdb) list
  1  -> f(3)
[EOF]
(Pdb) continue
**
File "foo-...@baz.py", line 7, in foo-bar@baz
Failed example:
f(3)
Expected nothing
Got:
9
TestResults(failed=1, attempted=3)
Got:
--Return--
*** ModuleNotFoundError: No module named 'IPython'
> (3)g()->None
-> import pdb; pdb.set_trace()
(Pdb) list
  1 def g(x):
  2 print(x+3)
  3  -> import pdb; pdb.set_trace()
[EOF]
(Pdb) next
--Return--
> (2)f()->None
-> g(x*2)
(Pdb) list
  1 def f(x):
  2  -> g(x*2)
[EOF]
(Pdb) next
--Return--
> (1)()->None
-> f(3)
(Pdb) list
  1  -> f(3)
[EOF]
(Pdb) continue
**
File "foo-...@baz.py", line 7, in foo-bar@baz
Failed example:
f(3)
Expected nothing
Got:
9
TestResults(failed=1, attempted=3)
File "/dev/shm/gerrit/Python-3.6.0/Lib/test/test_doctest.py", line 2025, in 
test.test_doctest.test_pdb_set_trace_nested
Failed example:
try:
runner.run(test)
finally:
sys.stdin = real_stdin
# doctest: +REPORT_NDIFF
Differences (ndiff with -expected +actual):
+ *** Mo

[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-4860 v2 @ 2.60GHz, 2 TiB RAM, and a 
[PanFSⓇ](http://www.panasas.com/products/panfs) distributed file system.  I 
experience this problem regardless whether I build/test Python 3.6 from within 
a PanFS filesystem or otherwise.

./python -m test -v test_io
== CPython 3.6.0 (default, Jan 4 2017, 15:08:07) [GCC 4.4.7 20120313 (Red Hat 
4.4.7-17)]
==   Linux-2.6.32-642.6.2.el6.x86_64-x86_64-with-redhat-6.8-Santiago 
little-endian
==   hash algorithm: siphash24 64bit
==  cwd: /dev/shm/gerrit/Python-3.6.0/build/test_python_34342
==  encodings: locale=UTF-8, FS=utf-8
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
Run tests sequentially
0:00:00 [1/1] test_io
[…snip many lines…]
test_interrupted_write_retry_text (test.test_io.CSignalsTest) ...

after which there is no more output.

--
nosy: +Gerrit.Holl

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



[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 documentation.

--

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



[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 topjakl...@gmail.com:


--
type:  - crash

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24538
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 seriously, it leads to `pip install .` to 
fail, as I [reported here](https://github.com/pypa/pip/issues/2941):

In [55]: shutil.copystat(/src/on/panfs, /tmp/fubar)
---
PermissionError   Traceback (most recent call last)
ipython-input-55-139c9fc77184 in module()
 1 
shutil.copystat(/home/users/gholl/checkouts/pyatmlab/.git/objects/pack/pack-c1449559ec4287b3830efe2913608dddf2f21391.pack,
 /tmp/fubar)

/home/users/gholl/lib/python3.4/shutil.py in copystat(src, dst, 
follow_symlinks)
211 else:
212 raise
-- 213 _copyxattr(src, dst, follow_symlinks=follow)
214
215 def copy(src, dst, *, follow_symlinks=True):

/home/users/gholl/lib/python3.4/shutil.py in _copyxattr(src, dst, 
follow_symlinks)
151 try:
152 value = os.getxattr(src, name, 
follow_symlinks=follow_symlinks)
-- 153 os.setxattr(dst, name, value, 
follow_symlinks=follow_symlinks)
154 except OSError as e:
155 if e.errno not in (errno.EPERM, errno.ENOTSUP, 
errno.ENODATA):

PermissionError: [Errno 13] Permission denied: '/tmp/fubar'

This occurs for any source file where the user write bit is not set.

Now, I'm not sure if this should be addressed in `pip`, `shutil.copytree`, 
`shutil.copystat`, `setxattr`, `panfs`, or in none of the above.  I'm reporting 
it in different places; please close this issue if this is the wrong place.

--
components: Library (Lib)
messages: 245985
nosy: Gerrit.Holl
priority: normal
severity: normal
status: open
title: os.setxattr PermissionError on panfs propagates up causing `copystat`, 
`copytree`, and `pip install .` to fail unhepfully
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24538
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24538
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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(foo, lambda a:a)
def spam():
0+0
1+1
1/0

spam()
$ python3.4 -mpdb mini.py   


 /tmp/mini.py(3)module()
- def foo(x, y=None):
(Pdb) cont
Traceback (most recent call last):
  File /usr/lib64/python3.4/pdb.py, line 1661, in main
pdb._runscript(mainpyfile)
  File /usr/lib64/python3.4/pdb.py, line 1542, in _runscript
self.run(statement)
  File /usr/lib64/python3.4/bdb.py, line 431, in run
exec(cmd, globals, locals)
  File string, line 1, in module
  File /tmp/mini.py, line 3, in module
def foo(x, y=None):
  File /tmp/mini.py, line 10, in spam
1/0
ZeroDivisionError: division by zero
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
 /tmp/mini.py(10)spam()
- 1/0
(Pdb) longlist
  6 @foo(foo, lambda a:a)
(Pdb) 


The last line illustrates the problem.  `longlist` should show the definition 
of `spam`, not just the decorator.

--
messages: 239749
nosy: Gerrit.Holl
priority: normal
severity: normal
status: open
title: pdb's `longlist` shows only decorator if that one contains a lambda
type: behavior
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23832
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 simply by concatenating strings.  It would be great if we could 
do the same with Path objects, like this:

In [2]: b = pathlib.Path(/tmp/some_base)

In [3]: b + _name.dat
---
TypeError Traceback (most recent call last)
ipython-input-3-939467ea0aa5 in module()
 1 b + _name.dat

TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str'

In [4]: b + pathlib.Path(_name.dat)
---
TypeError Traceback (most recent call last)
ipython-input-4-460bf8ac7710 in module()
 1 b + pathlib.Path(_name.dat)

TypeError: unsupported operand type(s) for +: 'PosixPath' and 'PosixPath'

In [11]: b.with_name(b.name + _name.dat)  # desired effect
Out[11]: PosixPath('/tmp/some_base_name.dat')

--
components: Library (Lib)
messages: 220893
nosy: Gerrit.Holl
priority: normal
severity: normal
status: open
title: Allow adding Path or str to Path
type: enhancement
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21798
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 stdin, line 1, in module
TypeError: object() takes no parameters

Although it is correct that object() takes no parameters, it would be more 
correct to state that A() does not take any parameters.

--
components: Interpreter Core
messages: 220313
nosy: Gerrit.Holl
priority: normal
severity: normal
status: open
title: Confusing error message when initialising type inheriting object.__init__
type: behavior
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21728
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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:

 Instead of the normal %-based substitutions, Templates support $-based 
 substitutions, using the following rules:

This is potentially confusing.  The documentation in this section has not made 
any mention of %-based substitutions.  Rather, a novel reader may, at this 
point, think that {}-based substitution is normal.  I would suggest to resolve 
this issue by simply not mentioning %-based substitutions, replacing the 
sentence above by:

 Templates support $-based substitutions, using the following rules:

--
assignee: docs@python
components: Documentation
messages: 208553
nosy: Gerrit.Holl, docs@python
priority: normal
severity: normal
status: open
title: Potentially confusing formulation in 6.1.4. Template strings
type: enhancement
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20314
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11494] Confusing error message from warnings.warn

2011-03-14 Thread Gerrit Holl

New submission from Gerrit Holl topjakl...@gmail.com:

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, copyright, credits or license for more information.
  import warnings
  warnings.warn(aaa, bbb)
 Traceback (most recent call last):
   File stdin, line 1, in module
 TypeError: issubclass() arg 1 must be a class

It would be better for the error message to say TypeError: warnings must be 
classes inherited from ... or something like that.

--
components: Interpreter Core, Library (Lib)
messages: 130800
nosy: Gerrit.Holl
priority: normal
severity: normal
status: open
title: Confusing error message from warnings.warn
type: behavior
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11494
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10563] Spurious newline in time.ctime

2010-11-28 Thread Gerrit Holl

New submission from Gerrit Holl topjakl...@gmail.com:

When the time passed to time.ctime is large, it adds a newline:

 import time
 time.ctime(236)
'Wed Apr  8 17:04:32 6325'
 time.ctime(237)
'Wed Jul 14 08:09:04 10680\n'

--
components: Library (Lib)
messages: 122665
nosy: Gerrit.Holl
priority: normal
severity: normal
status: open
title: Spurious newline in time.ctime
versions: Python 2.6, Python 2.7, Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10563
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10563] Spurious newline in time.ctime

2010-11-28 Thread Gerrit Holl

Gerrit Holl topjakl...@gmail.com 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 rep...@bugs.python.org
http://bugs.python.org/issue10563
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10563] Spurious newline in time.ctime

2010-11-28 Thread Gerrit Holl

Gerrit Holl topjakl...@gmail.com 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
 time.ctime(240)
'Fri Apr 10 03:12:32 71654'

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10563
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com