Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I had pastie working for the longest time on Ubuntu 11.04, working great, I love the little bugger :) I still have it working on my laptop (same system).

Recently I ran upgrade on all packages in my Ubuntu 11 system. Now pastie doesn't work, this is the error I get:

Traceback (most recent call last):
  File "/usr/bin/pastie", line 96, in <module>
    clipboard_protector = protector.ClipboardProtector()
  File "/usr/lib/pymodules/python2.7/pastielib/protector.py", line 72, in __init__
    self.history.set_payload(self.recover_history())
  File "/usr/lib/pymodules/python2.7/pastielib/protector.py", line 138, in recover_history
    history_tree = tree.parse(input_file)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1177, in parse
    tree.parse(source, parser)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 653, in parse
    parser.feed(data)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1624, in feed
    self._raiseerror(v)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1488, in _raiseerror
    raise err
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 2, column 380

Anyone know what to do to get this thing to work again or what the heck all those error's mean? I'm not a python guy. I tried apt-get purge pastie and re-install but no go.

share|improve this question
1  
I know this doesn't solve your problem, but here's an explanation of what's going on when you see that message. –  SirCharlo Sep 7 '12 at 20:00
    
Actually that might just be it! EUREKA!! Thanks, something tell's me it's in the XML config file, let me look into that first and see. You see, it did help, it help's to know how python think's ha ha –  jfreak53 Sep 7 '12 at 20:04
    
Keep me posted ;) –  SirCharlo Sep 7 '12 at 20:05
1  
GOT IT!!! After going through the protector.py file that was being called I found out that the clipboard history file is located in ~/.local/share/pastie. Come to find out it was choking on something I copied in the past and was just sitting in that history file. So I deleted the file and WALLA!! It work's! Thanks –  jfreak53 Sep 7 '12 at 20:15

1 Answer 1

up vote 3 down vote accepted

For those looking in the future for this same problem as Pastie doesn't help any at all! :)

The answer was hinted on by SirCharlo. By looking through the code I found that Pastie uses a clipboard history file in XML, the code for this is in the main Pastie file and protector.py.

Running a find in my home directory I found that Pastie stores this history file in ~/.local/share/pastie, it's called clipboard_history.

Basically something that was copied in the past had a character that Python didn't like or wasn't escaped right by the software code. So it was choking on that line of XML in the history file.

So just go to that directory and erase the file completely and restart pastie, works like a charm. If your using an older version of Pastie the file is located at ~/.clipboard_history

share|improve this answer
    
Good for you! Now if you want, you can also mark your answer as accepted. Until next time! ;) –  SirCharlo Sep 7 '12 at 21:15
    
I'd like to, but it doesn't let me for 2 more days ha ha –  jfreak53 Sep 7 '12 at 21:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.