Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Not getting past writing colors in save_file #40

Closed
Aerol opened this issue Jul 8, 2017 · 12 comments
Closed

Not getting past writing colors in save_file #40

Aerol opened this issue Jul 8, 2017 · 12 comments

Comments

@Aerol
Copy link

Aerol commented Jul 8, 2017

Seems to be getting stuck at writing colors or something, when i run
wal -i ~/wallpapers/16.9/
never exits and when I hit ^c twice

~
❯ wal -i ~/wallpapers/16.9    
image: Using image /home/aerol/wallpapers/16.9/FVgljW7.jpg
colors: Generating a colorscheme...
colors: Generated colorscheme
wallpaper: Set the new wallpaper
Gtk-Message: Failed to load module "gail"
Gtk-Message: Failed to load module "atk-bridge"
^C^CKeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/wal", line 9, in <module>
    load_entry_point('pywal==0.3.6', 'console_scripts', 'wal')()
  File "/usr/local/lib/python3.6/dist-packages/pywal-0.3.6-py3.6.egg/pywal/__main__.py", line 118, in main
    process_args(args)
  File "/usr/local/lib/python3.6/dist-packages/pywal-0.3.6-py3.6.egg/pywal/__main__.py", line 105, in process_args
    sequences.send_sequences(colors_plain, args.t)
  File "/usr/local/lib/python3.6/dist-packages/pywal-0.3.6-py3.6.egg/pywal/sequences.py", line 51, in send_sequences
    [util.save_file("".join(sequences), term) for term in terminals]
  File "/usr/local/lib/python3.6/dist-packages/pywal-0.3.6-py3.6.egg/pywal/sequences.py", line 51, in <listcomp>
    [util.save_file("".join(sequences), term) for term in terminals]
  File "/usr/local/lib/python3.6/dist-packages/pywal-0.3.6-py3.6.egg/pywal/util.py", line 59, in save_file
    file.write(colors)
KeyboardInterrupt

Running Maui Linux 17.03, Ubuntu 16.04 based.
Odd thing is, it doesn't always happen, but it happens more so than not.

@dylanaraps dylanaraps added the bug label Jul 8, 2017
@dylanaraps
Copy link
Owner

Does it hang when the -n flag is used?

@Aerol
Copy link
Author

Aerol commented Jul 8, 2017

Yes it does

@dylanaraps
Copy link
Owner

Can you send me the output of ls /dev/pts?

@Aerol
Copy link
Author

Aerol commented Jul 8, 2017

❯ ls /dev/pts
0  1  10  11  12  13  14  15  16  17  18  2  3  4  5  6  7  8  9  ptmx

@dylanaraps
Copy link
Owner

Can you try and install these packages? Then let me know if this changes anything.

apt-get install libatk-adaptor libgail-common

@Aerol
Copy link
Author

Aerol commented Jul 8, 2017

No change in end result, other than the errors about atk and gail modules are gone.

@dylanaraps
Copy link
Owner

What about ls -l /dev/pts? This could be a permissions issue.

@Aerol
Copy link
Author

Aerol commented Jul 8, 2017

❯ ls -l /dev/pts
total 0
crw--w---- 1 aerol tty  136, 0 Jul  8 16:38 0
crw--w---- 1 aerol tty  136, 1 Jul  8 08:33 1
crw--w---- 1 aerol tty  136, 2 Jul  7 08:11 2
crw--w---- 1 aerol tty  136, 3 Jul  8 16:38 3
crw--w---- 1 aerol tty  136, 4 Jul  8 16:38 4
crw--w---- 1 aerol tty  136, 7 Jul  8 16:38 7
crw--w---- 1 aerol tty  136, 8 Jul  8 16:38 8
c--------- 1 root  root   5, 2 Jul  6 19:47 ptmx

Doing some testing, I closed down all tmux windows and tmux server, ran wal outside of tmux and it ran fine some 30 times, started tmux and it ran fine continually again....
and now it seems no matter what I try I can't get wal to hang again

@ghost
Copy link

ghost commented Jul 13, 2017

I have this issue too with arch linux where the /dev/pts/* files are owned by nobody instead of the current user, and it causes this same problem. Not sure what's changing the owership of my ttys.

@dylanaraps
Copy link
Owner

I'll add a check to the code so that we only write to the files if they're writable. If they're not writable we can at least display a helpful message on how to fix the issue.

From googling you can just chmod the files to fix them. (chmod a+rw /dev/pts/1)

@dylanaraps
Copy link
Owner

Closing this.

If you come across the issue again feel free to reopen the issue.

@Xunius
Copy link

Xunius commented Sep 22, 2017

I got the similar issue that pywal hangs when tring to write data to /dev/ptsX, e.g.:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/wal", line 11, in <module>
    load_entry_point('pywal==0.6.9', 'console_scripts', 'wal')()
  File "/usr/lib/python3.6/site-packages/pywal/__main__.py", line 144, in main
    process_args(args)
  File "/usr/lib/python3.6/site-packages/pywal/__main__.py", line 127, in process_args
    sequences.send(colors_plain, args.t)
  File "/usr/lib/python3.6/site-packages/pywal/sequences.py", line 80, in send
    util.save_file(sequences, term)
  File "/usr/lib/python3.6/site-packages/pywal/util.py", line 66, in save_file
    file.write(data)
KeyboardInterrupt

I'm on Manjaro cinnamon and my pywal installed from AUR is 0.6.9.
I greped the ps aux output and found a tmux session is still alive, killed it and now pywal runs OK.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants