[issue40329] Faulty dict arg gives ValueError but mostly TypeError

2020-04-19 Thread Tomas Nordin


Tomas Nordin  added the comment:

Serhiy Storchaka  writes:

> Serhiy Storchaka  added the comment:
>
> It is all correct. Note that set is unordered, so "element #0" can be 1, and 
> can be "one". If it is 1, you get a type error. If it is "one", which is a 
> sequence with length 3, you get a value error.

Yes! Thanks, sorry for the noise.

--

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



[issue40329] Faulty dict arg gives ValueError but mostly TypeError

2020-04-19 Thread Tomas Nordin


New submission from Tomas Nordin :

Hello Python bug tracker

Trying to create a dict with a top level set pair will fail, but how
will it fail?

Here comes a terminal session to reproduce the behavior. The same
command is just repeated.

--8<--
$ python3 -c 'd = dict({1, "one"})'
Traceback (most recent call last):
  File "", line 1, in 
TypeError: cannot convert dictionary update sequence element #0 to a sequence

# Understand, can't convert 1 to sequence.

$ python3 -c 'd = dict({1, "one"})'
Traceback (most recent call last):
  File "", line 1, in 
ValueError: dictionary update sequence element #0 has length 3; 2 is required

# Not so helpful to me, don't understand.

$ python3 -c 'd = dict({1, "one"})'
Traceback (most recent call last):
  File "", line 1, in 
TypeError: cannot convert dictionary update sequence element #0 to a sequence

# OK, thanks

$ python3 -c 'd = dict({1, "one"})'
Traceback (most recent call last):
  File "", line 1, in 
TypeError: cannot convert dictionary update sequence element #0 to a sequence

$ python3 -c 'd = dict({1, "one"})'
Traceback (most recent call last):
  File "", line 1, in 
TypeError: cannot convert dictionary update sequence element #0 to a sequence

$ python3 -c 'd = dict({1, "one"})'
Traceback (most recent call last):
  File "", line 1, in 
ValueError: dictionary update sequence element #0 has length 3; 2 is required

# Again?
-->8--

I searched the bug tracker on "dict typeerror valueerror" but couldn't
find something similar. What do you think about this?

$ python3 --version
Python 3.7.3

Best regards
--
Tomas

--
components: Library (Lib)
messages: 366781
nosy: tomnor
priority: normal
severity: normal
status: open
title: Faulty dict arg gives ValueError but mostly TypeError
type: behavior
versions: Python 3.7

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



[issue24524] python crash using Tkinter

2015-07-05 Thread Tomas Nordin

Tomas Nordin added the comment:

I have not experienced this problem on windoze. The problem seem to have 
appeared when upgrading my operating system from Debian wheezy to jessie, I 
think with python going from 2.7.3 to 2.7.9. And I have a stomach feeling it is 
related to the environment. I have filed a bug report at debian too, or I am 
working on it.

With the initial description I have been wanting to say that just opening the 
root window and closing it does not crash python. But open it, use 
askopenfilename and then close the root window lead to a crash.

--

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



[issue24524] python crash using Tkinter

2015-06-28 Thread Tomas Nordin

New submission from Tomas Nordin:

$ python
Python 2.7.9 (default, Mar  1 2015, 18:22:53) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
The readline tab completion thing should be loaded. (pythonstartup.py @home)
>>> import Tkinter as tk
>>> import tkFileDialog as tfd
>>> tk.Tk()

>>> tk.Tk()

>>> tfd.askopenfilename()
u'/home/tomas/.emacs'
>>> # closing the root window
... 
>>> alloc: invalid block: 0x99ddcd8: 88 9
Aborted
$

$ uname -a
Linux debian 3.2.0-4-686-pae #1 SMP Debian 3.2.68-1+deb7u1 i686 GNU/Linux

See also #22810

--
components: Tkinter
messages: 245917
nosy: tomnor
priority: normal
severity: normal
status: open
title: python crash using Tkinter
type: crash
versions: Python 2.7

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