36 hours ago
I'm writing a program that uses file-roller to extract an ISO file. However I keep getting a warning and I don't want to see this warning. Also file-roller hangs after this warning. Gtk-Message: GtkDialog mapped without transient parent. This is discouraged. Once this hits, file-roller will just hang and not do anything. I'm using file-roller through the command line with file-roller -e <PATH> <ISO IMAGE>. My question is simple, how can I disable the warnings and the stdout on the command and stop the process from hanging when a warning hits?
file-roller
Gtk-Message: GtkDialog mapped without transient parent. This is discouraged
file-roller -e <PATH> <ISO IMAGE>
Script:
def unzip_iso(filepath, verbose=False, directory_name="ISO_dir"): """ Unzip the ISO file into a directory :param filepath: the path to the ISO file :param verbose: verbosity output :param directory_name: the name of the ISO directory :return: True if it worked, False if it didn't """ def create_rand_dir_name(chars=string.ascii_letters, verbose=False): """ Create a random directory name """ if verbose: LOGGER.debug("Creating random directory name..") retval = set() for _ in range(8): retval.add(random.choice(chars)) return ''.join(list(retval)) dirname = create_rand_dir_name(verbose=verbose) if verbose: LOGGER.debug("Creating directory: {}/{}/*..".format(directory_name, dirname)) create_dir(directory_name + "/" + dirname) full_dir_path = os.getcwd() + "/" + directory_name + "/" + dirname if verbose: LOGGER.debug("Directory created, full path being saved to: {}..".format(full_dir_path)) cmd = "file-roller -e {} {}".format(full_dir_path, filepath) if verbose: LOGGER.debug("Starting command: {}..".format(cmd)) stdout_data = subprocess.check_call(cmd, shell=True)