question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't work with tkinter.filedialog.askdirectory

See original GitHub issue
  • bleak version: 0.12.0
  • Python version: 3.9.5
  • Operating System: Win10 2004 (OS Build 19041.1052)

Description

when using import bleak and tkinter.filedialog.askdirectory will make program stop respond

What I Did

import bleak  # Even I didn't use anything, just import bleak, still cause problem
import tkinter as tk
from tkinter import filedialog

root = tk.Tk()
dest_path = filedialog.askdirectory()

If remove the line

import bleak

it will work just fine.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
dlechcommented, Jun 25, 2021

import winrt calls RoInitialize with the default RO_INIT_MULTITHREADED. Most GUI toolkits on Windows need a single thread apartment instead. I think it is just by luck that the other dialogs worked without locking up.

1reaction
dlechcommented, Jun 25, 2021

Does this work?

import bleak
import tkinter as tk
from tkinter import filedialog
from winrt import _winrt

_winrt.uninit_apartment()

root = tk.Tk()
dest_path = filedialog.askdirectory()
Read more comments on GitHub >

github_iconTop Results From Across the Web

Tkinter filedialog.askdirectory() can't find external drives
In one answer someone recommended to write your own folder selection dialog somewhere, but I have not yet found guidance how to do...
Read more >
Tkinter filedialog askdirectory() to show dialog window to ...
We can call this dialog box by using askdirectory () and this function return the selected path as ... Your browser can't play...
Read more >
tkinter filedialog - Python Tutorial
Python Tkinter (and TK) offer a set of dialogs that you can use when working with files. By using these you don't have...
Read more >
File Dialog? - Reallusion Forum
... fried) and for the life of me I can't get a simple file dialog box to work as it works in Blender....
Read more >
Python Tkinter filedialog using askopenfile() - Plus2net
Browse and upload file to Tkinter GUI window by using filedialog module askopenfile() ... Tkinter filedialog askdirectory() to show dialog window to select ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found