Git Product home page Git Product logo

Comments (4)

timothycrosley avatar timothycrosley commented on August 15, 2024

Thanks for reporting this issue! The problem has been verified and it will be resolved in the next point release

from isort.

GuoJing avatar GuoJing commented on August 15, 2024

cool! that's what I wanner talking about. 🎯

from isort.

timothycrosley avatar timothycrosley commented on August 15, 2024

This has been fixed in release 1.3.1, Thanks!

from isort.

jmfederico avatar jmfederico commented on August 15, 2024

Hi!

Sorry to re-open such an old thread.

I just ran into this problem when running isort on OSX yosemite, with python 3.4.2 and isort 3.9.4

The problems seems to be that OSX doesn't have LANG set to anything by default, so when isort opens the file to check (line 94), it doesn't specify an encoding, which then default to "ASCII" on OSX.

If LANG is set to something like en_US.UTF-8 the problem goes away, but will break in systems where for any reason changing the locale is not an option.

The second link I put here talks about a “Unicode sandwich” approach. That might solve the problem.

http://robjwells.com/post/61198832297/get-your-us-ascii-out-of-my-face
http://nedbatchelder.com/text/unipain.html

Traceback (most recent call last):
  File "/Users/fjm/Development/acora_dj/venv/bin/isort", line 11, in <module>
    sys.exit(main())
  File "/Users/fjm/Development/acora_dj/venv/lib/python3.4/site-packages/isort/main.py", line 119, in main
    incorrectly_sorted = SortImports(file_name, **arguments).incorrectly_sorted
  File "/Users/fjm/Development/acora_dj/venv/lib/python3.4/site-packages/isort/isort.py", line 95, in __init__
    file_contents = file_to_import_sort.read()
  File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2709: ordinal not in range(128)

from isort.

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.