Giter VIP home page Giter VIP logo

Comments (7)

fdw avatar fdw commented on August 26, 2024 1

I just tested the new version, and it works perfectly! :)

Thank you!

from clipster.

mrichar1 avatar mrichar1 commented on August 26, 2024

This is a unicode issue - there are many of them, and they almost all originate in python2. (See #1)

I can't immediately replicate this issue with my own unicode tests (though I did find yet another one while looking!) - perhaps you can provide some more debugging (clipboard history, debug output etc) ?

Otherwise, I can only suggest running clipster with python3 and seeing if this fixes the problem.

from clipster.

fdw avatar fdw commented on August 26, 2024

I think it is enough to copy one of the common umlauts (ü, ö, ä) to break roficlip. I have not found anything more "advanced" in my history.

Logging at debug level only yields the same error:

DEBUG:Connecting to server to query history.
DEBUG:Sending request to server.
DEBUG:Received data from server.
DEBUG:Received data from server.
DEBUG:Received data from server.
Traceback (most recent call last):
  File "/usr/local/bin/clipster", line 854, in <module>
    main()
  File "/usr/local/bin/clipster", line 837, in main
    print(client.output(), end='')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 1103: ordinal not in range(128)

Happily, forcing clipster to Python 3 solves the problem :)

from clipster.

mrichar1 avatar mrichar1 commented on August 26, 2024

Hi,

Thanks for the reply. I can't get clipster to break using simple accented characters, but then it may be an extra interaction with roficlip that means I'm not seeing it. Can you confirm that you're using the latest clipster from the master branch?

If so, then I'm a bit stuck as to where in the code this issue lies, and I might just have to 'chicken out' of doing any more debugging on this, and just keep 'use python 3' as the solution!

from clipster.

fdw avatar fdw commented on August 26, 2024

I just tried it again with the latest version (I was on the July version beforehand), but the behavior has not changed. What I find very interesting is that the command clipster -c -o -n 500 -0 can be called correctly from the console, but if roficlip calls it, it ends in the described error.
Could it be that the execution from the console has some environment variable that the call from roficlip is missing? But how would Python 3 change that?

In any case, thanks for your help and the clipboard manager! :)

from clipster.

mrichar1 avatar mrichar1 commented on August 26, 2024

OK - that's good to know - and doubly useful to know it's aroficlip/clipster interaction bug, and that it works fine from the console. That should help with my debugging!

from clipster.

mrichar1 avatar mrichar1 commented on August 26, 2024

OK - I figured it out. I was wrongly assuming that the issue was with clipster interacting with the clipboard buffers, or between the client and the server.

Turns out that it was actually down to the print method's behaviour when run non-interactively, it looks like it doesn't know what terminal it is interacting with, and assumes everything is ascii, and crashes.

Explicitly converting the output to utf-8 before printing seems to have fixed this issue.

Let me know if you are still seeing this problem with the latest version.

from clipster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.