Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 459996 - net-im/pidgin /usr/bin/purple-remote, line 75, """ SyntaxError
Summary: net-im/pidgin /usr/bin/purple-remote, line 75, """ SyntaxError
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-02 16:01 UTC by Ted Marston
Modified: 2019-04-02 12:29 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info '=net-im/pidgin-2.10.6' | gzip > pidgin.info.gz (pidgin.info.gz,2.78 KB, application/x-gzip)
2013-03-02 16:01 UTC, Ted Marston
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ted Marston 2013-03-02 16:01:13 UTC
Created attachment 340766 [details]
emerge --info '=net-im/pidgin-2.10.6' | gzip > pidgin.info.gz

net-im/pidgin-2.10.6 + sys-power/hibernate-script-2.0-r6 report:

on hibernation:
hibernate: [19] Executing LogoutPidgin ...
Logging out ted's Pidgin using D-Bus session bus address
  File "/usr/bin/purple-remote", line 75
    """ % sys.argv[0]
      ^
SyntaxError: invalid syntax

and on resumption:
hibernate: [19] Executing LoginPidgin ...
Logging back (to status ) ted's Pidgin using D-Bus session bus address
  File "/usr/bin/purple-remote", line 75
    """ % sys.argv[0]
      ^
SyntaxError: invalid syntax

Its possibly a simple thing, but I cant spot it.
Comment 1 Jared B. 2013-10-01 14:18:41 UTC
I just ran into this problem.  It appears to be related to the default version of python on the system.  When python3 is set by default, any attempt to use purple-remote fails with with the error shown in the original description:

  File "/usr/bin/purple-remote", line 75
    """ % sys.argv[0]
      ^
SyntaxError: invalid syntax

If I run 'sudo eselect python set 1' (where 1 is the instaled python2 interpreter) and then run the same command, it works.

purple-remote is nothing more than a python script, with the interpreter set to:
#!/usr/bin/env python

Changing that python to python2 fixes the problem for me.  pidgin already depends specifically on python 2.7, so it seems like simply patching that line during src_prepare() to specifically reference python2 would be an easy way to get this fixed.
Comment 2 Jared B. 2013-10-01 14:21:05 UTC
(In reply to Jared B. from comment #1)
> purple-remote is nothing more than a python script, with the interpreter set
> to:
> #!/usr/bin/env python
> 
> Changing that python to python2 fixes the problem for me.

Just to clarify, if I make that above change and set my default system python interpreter back to python3, purple-remote still works.  Didn't want any confusion over whether I remember to set that back.  :-)
Comment 3 A.J. 2017-10-12 17:05:12 UTC
This bit me today, a whole 4+ years later, with pidgin-2.12.0.  I was able to temporarily switch python versions with eselect in order to run purple-remote, then switch back.  I can also confirm that editing the shebang line to use python2 is also a working solution.
Comment 4 Ted Marston 2018-10-13 15:44:25 UTC
net-im/pidgin-2.13.0 gives a different error message that is fixed with same hack.

  File "/usr/bin/purple-remote", line 6, in <module>
    import dbus
ImportError: No module named 'dbus'

Changing the shebang line of purple-remote to use python2 provides a working solution again.
Comment 5 Larry the Git Cow gentoo-dev 2019-04-02 12:29:12 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=edc73a669e7ef0525ffad215fea70cb24876d6cf

commit edc73a669e7ef0525ffad215fea70cb24876d6cf
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2019-04-02 12:27:42 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2019-04-02 12:29:04 +0000

    net-im/pidgin: Revbump adding python3 support
    
    and use [${PYTHON_USEDEP}] for dev-python/dbus-python package
    
    Closes: https://bugs.gentoo.org/459996
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 .../files/pidgin-2.13.0-python3_support.patch      |  37 +++
 net-im/pidgin/pidgin-2.13.0-r1.ebuild              | 285 +++++++++++++++++++++
 2 files changed, 322 insertions(+)