Giter VIP home page Giter VIP logo

Comments (7)

miracle2k avatar miracle2k commented on May 14, 2024

I don't have any plans, but I would certainly accept patches. If I did it myself I might even drop support for Py2 completely, since to me this was never really intended to be used as a library, but maybe then its a good thing to keep Py2 support as well.

from android2po.

kruton avatar kruton commented on May 14, 2024

I've added Python 3 support in my fork and have it running in Travis-CI to make sure it doesn't break.

from android2po.

miracle2k avatar miracle2k commented on May 14, 2024

Do you want to submit a PR?

from android2po.

kruton avatar kruton commented on May 14, 2024

This should be closed.

from android2po.

richq avatar richq commented on May 14, 2024

Hey, nice to see this evolve - I've just tried the latest master with python3.5 and I get an error due to colors:

Traceback (most recent call last):
  File "/home/richq/src/android2po/scripts/a2po", line 3, in <module>
    android2po.run()
  File "/home/richq/src/android2po/android2po/program.py", line 227, in run
    sys.exit(main(sys.argv) or 0)
  File "/home/richq/src/android2po/android2po/program.py", line 217, in main
    writer.finish()
  File "/home/richq/src/android2po/android2po/utils.py", line 260, in finish
    action.done('failed')
  File "/home/richq/src/android2po/android2po/utils.py", line 165, in done
    self.writer._print_action(self)
  File "/home/richq/src/android2po/android2po/utils.py", line 297, in _print_action
    self._print_action_header(action)
  File "/home/richq/src/android2po/android2po/utils.py", line 323, in _print_action_header
    self.stdout.write(colored("%*s" % (self.max_event_len, tag), attrs=['bold',], **style))
  File "/usr/lib/python3.5/codecs.py", line 377, in write
    self.stream.write(data)
TypeError: write() argument must be str, not bytes

Seems like the output to stdout is binary with the ANSI escape codes embedded, but stdout wants a string.

from android2po.

richq avatar richq commented on May 14, 2024

FWIW, this hack in utils.py Writer.__init__ makes things work - just write direct to stdout instead of wrapping it in a codec. My $LANG is en_US.utf8 by the way, nothing exotic.

        # Create a codec writer wrapping stdout
        #isatty = sys.stdout.isatty() \
        #    if hasattr(sys.stdout, 'isatty') else False
        #self.stdout = codecs.getwriter(
        #    sys.stdout.encoding
        #        if isatty
        #        else locale.getpreferredencoding())(sys.stdout)
        self.stdout = sys.stdout

from android2po.

miracle2k avatar miracle2k commented on May 14, 2024

I'm closing this. Let's address any problems with Python 3 support in a new pull request.

from android2po.

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.