Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need root privilege to run this program! #61

Closed
Firef0x opened this issue Oct 6, 2014 · 7 comments
Closed

Need root privilege to run this program! #61

Firef0x opened this issue Oct 6, 2014 · 7 comments

Comments

@Firef0x
Copy link

Firef0x commented Oct 6, 2014

Hello, @sole

I am using Arch Linux and have installed aafm from the package aafm-git in Arch User Repository.

It works good in the previous version.(20120414-4, which is built last year) However, after I updated the package aafm-git to the latest version 20140930-1, it needs root privilege to run this program. Otherwise, it outputs the following error message:

$ aafm

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/aafm/aafm-gui.py", line 5, in <module>
    import gtk
  File "/usr/lib/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 40, in <module>
    from gtk import _gtk
  File "/usr/lib/python3.4/site-packages/cairo/__init__.py", line 2
SyntaxError: Non-ASCII character '\xc2' in file /usr/lib/python3.4/site-packages/cairo/__init__.py on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

This makes aafm.desktop useless for ordinary users.

What's more, the package maintainer Cyber Way said :

I seldom use that desktop file.If it's not working, consider file an issue at the Github project page clearing describing the problem. It's better to fix issues in upstream project than in this PKGBUILD file.

So I decide to report this issue to you. Could you tell me how to run this program without root privilege? Or make the aafm.desktop execute the program with root privilege?

Hope for your reply!

Yours, sincerely

@sole
Copy link
Owner

sole commented Oct 6, 2014

I have no idea why that needs "root privileges". Moreover I don't use that .desktop file myself either.
It looks as if it's an error on Cairo, not on aafm.

Not closing the issue just in case someone can help, but this is definitely super odd.

Sorry I can't solve your problem. The last time I used this in Arch I just ran python aafm-gui.py, if that helps.

@cb474
Copy link

cb474 commented Oct 7, 2014

Firef0x,

I don't know anything about .desktop files and I'm afraid this isn't going to be helpful. However, I'm also on Arch and I installed aafm-git from AUR and I do not have this problem. It runs fine without root, if I execute it from the applications menu. If I execute from a terminal it also runs fine without root.

I get:

$ aafm
EXECUTE ('adb', 'devices')
EXECUTE ('adb', '-s', '0064596052180e13', 'shell', 'cat', '/system/build.prop')
EXECUTE ('adb', '-s', '0064596052180e13', 'shell', 'ls', '--help')
EXECUTE ('adb', 'devices')
EXECUTE ('adb', '-s', '0064596052180e13', 'shell', 'cat', '/system/build.prop')
EXECUTE ('adb', '-s', '0064596052180e13', 'shell', 'ls', '-l', '-a', '/mnt/sdcard/')
EXECUTE ('adb', '-s', '0064596052180e13', 'shell', 'df', '/mnt/sdcard/')

@Firef0x
Copy link
Author

Firef0x commented Oct 7, 2014

It looks as if it's an error on Cairo, not on aafm.

@sole I also use gimp, medit, arandr, bleachbit and gtk-recordmydesktop, all of them use pygtk and pycairo, and none of them need root privilege to run. So, I suspect that it is an aafm-specific error rather than a general error.

Hope for your reply!

Yours, sincerely

@sole
Copy link
Owner

sole commented Oct 7, 2014

I already told you what I knew. I cannot reproduce this because I do not have access to an ArchLinux machine.

@muflone
Copy link
Contributor

muflone commented Oct 11, 2014

@Firef0x I use aafm-git without any issue from both command line and desktop file (which is the same command).
You could try to install the android-udev package to properly detect android devices.

The python cairo error seems unrelated to aafm, you should test this using:

python2 -c "import pygtk; pygtk.require('2.0'); import gtk; print gtk"
python2 /usr/lib/python2.7/site-packages/aafm/aafm-gui.py

@Firef0x
Copy link
Author

Firef0x commented Oct 11, 2014

Hello, @muflone !

You could try to install the android-udev package to properly detect android devices.

Yes, I've installed android-udev of course, and I've contributed info of my phone to https://github.com/M0Rf30/android-udev-rules too. That means, it's not related to android-udev at all.

The python cairo error seems unrelated to aafm

I'm not sure of that, but I think it's probably correct after reading your reply.
I'll try to take this to the Arch Linux community to see whether it is correct.

Thanks and regards!

@Firef0x
Copy link
Author

Firef0x commented Oct 14, 2014

@sole I'm so sorry to disturb you. I think I've found what problem it is. It's related to powerline/powerline#298 .
Powerline installer told me to add PYTHONPATH=/usr/lib/python3.3/site-packages long before, and I didn't notice that it would break some of the Python2 apps (aafm in my case) until discussing in https://bbs.archlinuxcn.org/viewtopic.php?pid=20459#p20459 . Now it's all set.
@cb474 and @muflone Thx for your instructions too.

BTW, maybe we should have a Troubleshooting or FAQ to clarify this kind of problem in README.md . And you should have pushed the tag r5 to GitHub.

Thanks and regards!

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

No branches or pull requests

4 participants