[issue45957] _tkinter.TclError: expected boolean value but got ""

2021-12-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Or use python.org installer ;-).

--

___
Python tracker 

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



[issue45957] _tkinter.TclError: expected boolean value but got ""

2021-12-06 Thread Ned Deily


Ned Deily  added the comment:

> How does one go about upgrading their tkinter version?

Since, based on your path names, you appear to be using a Python from 
miniconda, you should check with that project. Perhaps they have a newer 
version available. Good luck!

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45957] _tkinter.TclError: expected boolean value but got ""

2021-12-06 Thread Ali Amin-Nejad


Ali Amin-Nejad  added the comment:

It seems like it must be a mac-specific issue just on 8.6.11 then if ned 
couldn't reproduce on 8.6.12. How does one go about upgrading their tkinter 
version? Thanks

--

___
Python tracker 

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



[issue45957] _tkinter.TclError: expected boolean value but got ""

2021-12-06 Thread E. Paine


E. Paine  added the comment:

I cannot reproduce on Ubuntu 21.10 (Tk 8.6.11), so I believe we can close this 
issue.

--
type: behavior -> crash

___
Python tracker 

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



[issue45957] _tkinter.TclError: expected boolean value but got ""

2021-12-03 Thread E. Paine


E. Paine  added the comment:

> Do we still use Tk 8.6.11 on any platform with Python 3.9+

No, none of the python.org installers include it now. On Linux, according to 
https://pkgs.org/download/tk, several distros still use 8.6.11 (most notably 
Ubuntu 21.04). I'll see if I can reproduce it on Linux using 8.6.11 and then we 
can decide whether or not a workaround is required.

--

___
Python tracker 

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



[issue45957] _tkinter.TclError: expected boolean value but got ""

2021-12-03 Thread Alex Waygood


Change by Alex Waygood :


--
type: crash -> behavior

___
Python tracker 

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



[issue45957] _tkinter.TclError: expected boolean value but got ""

2021-12-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It looks like a bug in Tk 8.6.11. It is expected that the implementation of "wm 
overrideredirect" returns an empty string if pass the boolean argument. The 
returned value is an empty string, but its type is not cleared. Seems it keeps 
the type of previous result.

I think that we can add a workaround for this bug, although it may be 
inconvenient to test it. Do we still use Tk 8.6.11 on any platform with Python 
3.9+? Note that Python 3.8 only takes security fixes, so any changes can only 
be made in 3.9+.

--
nosy: +epaine, terry.reedy

___
Python tracker 

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



[issue45957] _tkinter.TclError: expected boolean value but got ""

2021-12-02 Thread Ali Amin-Nejad


Ali Amin-Nejad  added the comment:

Thanks Serhiy, the output is:

['StateSpec']
['']

--

___
Python tracker 

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



[issue45957] _tkinter.TclError: expected boolean value but got ""

2021-12-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you Ali. It confirms my guess, but it is still not clear why we get a 
Tcl_Obj rather of None or empty string.

Please examine what is the output of the following code:

res = root.tk.call('wm', 'overrideredirect', root._w, True)
print([res.typename])
print([res.string])

If the first print crashes comment out it.

--

___
Python tracker 

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



[issue45957] _tkinter.TclError: expected boolean value but got ""

2021-12-02 Thread Ali Amin-Nejad


Ali Amin-Nejad  added the comment:

@serhiy.storchaka I tried that command, the returned value is not an empty 
string, it is an object of type . However including 
that line in my script immediately after creating the `root` object actually 
fixes the problem - no more error and the button appears and is responsive.

@ned.deily I am on tkinter 8.6.11. The output from the second command is:

```
/Users/ali/miniconda3/envs/bitfount/lib/python3.8/lib-dynload/_tkinter.cpython-38-darwin.so:
@rpath/libtcl8.6.dylib (compatibility version 8.6.0, current version 
8.6.11)
@rpath/libtk8.6.dylib (compatibility version 8.6.0, current version 
8.6.11)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 1213.0.0)
```

I have just tried the same script in a separate python 3.9 environment with 
python 3.9.6 and tkinter 8.6.10 and the error is not there so it seems like it 
is introduced in 8.6.11. Happy to try on 8.6.12 but I'm not sure how to upgrade 
to it.

--

___
Python tracker 

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



[issue45957] _tkinter.TclError: expected boolean value but got ""

2021-12-02 Thread Ned Deily


Ned Deily  added the comment:

I am not able to reproduce this failure with various macOS Pythons from 
python.org that are built with either Tk 8.6.8 or 8.6.12. Perhaps it's an issue 
with the Tk provided with your Miniconda Python?  Besides answering Serhiy's 
question, it would be helpful to know the exact patch level of Tk that is being 
used and also the path to the Tk library.

The output from

/path/to/your/python -m test.pythoninfo

and

otool -L $(/path/to/your/python -c "import _tkinter;print(_tkinter.__file__)")

will give those answers.

--

___
Python tracker 

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



[issue45957] _tkinter.TclError: expected boolean value but got ""

2021-12-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

What is the result of

   root.tk.call('wm', 'overrideredirect', root._w, True)

?

Is it not an empty string?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue45957] _tkinter.TclError: expected boolean value but got ""

2021-12-01 Thread Ali Amin-Nejad


New submission from Ali Amin-Nejad :

On macOS, the following minimal example:

```
import tkinter as tk

root = tk.Tk()
button = tk.Button(root, text="Exit", command=root.destroy)
button.pack()
root.wm_overrideredirect(True)

root.mainloop()
```

yields the following stack trace:

```
Traceback (most recent call last):
  File "blah.py", line 6, in 
root.wm_overrideredirect(True)
  File "/Users/ali/miniconda3/envs/bitfount/lib/python3.8/tkinter/__init__.py", 
line 2176, in wm_overrideredirect
return self._getboolean(self.tk.call(
  File "/Users/ali/miniconda3/envs/bitfount/lib/python3.8/tkinter/__init__.py", 
line 1448, in _getboolean
return self.tk.getboolean(string)
_tkinter.TclError: expected boolean value but got ""
```

--
components: Tkinter, macOS
messages: 407494
nosy: amin-nejad, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: _tkinter.TclError: expected boolean value but got ""
type: crash
versions: Python 3.8

___
Python tracker 

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