• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 8470
0%
main: 91%

Build:
Build:
LAST BUILD BRANCH: add/support-nested-gitignores
DEFAULT BRANCH: main
Ran 04 Jan 2016 01:30PM UTC
Jobs 8
Files 0
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
8470

push

travis-ci

ericzundel
Handle BUILD files with non-ascii characters more gracefully

If a BUILD file contained a non-ascii character, pants gave the following error:

```
./pants run src/java/hello

Exception message: 'ascii' codec can't decode byte 0xe2 in position 41: ordinal not in range(128)
```

On further inspection, this exception was trying to print some formatted context for the error, but string handling was failing for the same reason the BUILD file failed to parse.  Changed the logic to convert from utf-8 to ascii and to escape the non-ascii characters.

Now the error looks like:

```
$ ./pants run src/java/hello

Exception message: While parsing FilesystemBuildFile(/Users/zundel/Src/cookbook/src/java/hello/BUILD):
    1: # src/java/hello/BUILD
*   2: jvm_binary(name = \u2018hello\u2019,
                         ^ SyntaxError: invalid syntax (BUILD, line 2)

    3:   main = 'org.pantsbuild.example.hello.simple.HelloWorld',
    4:   dependencies = [
    5:     ':lib',
    6:   ],

 Loading addresses from 'src/java/hello' failed.
```

Testing Done:
CI green at https://travis-ci.org/pantsbuild/pants/builds/99732176
Added unit test.

Bugs closed: 2760

Reviewed at https://rbcommons.com/s/twitter/r/3287/
Jobs
ID Job ID Ran Files Coverage
1 8470.1 (CI_FLAGS="-cjlpn 'Various pants self checks'") 04 Jan 2016 01:32PM UTC 0
Travis Job 8470.1
4 8470.4 (CI_FLAGS="-fkmsrcjlp 'Python contrib tests'") 04 Jan 2016 01:40PM UTC 0
Travis Job 8470.4
5 8470.5 (CI_FLAGS="-fkmsrjlpn -i 0/6 'Python integration tests for pants - shard 1'") 04 Jan 2016 01:30PM UTC 0
Travis Job 8470.5
6 8470.6 (CI_FLAGS="-fkmsrjlpn -i 1/6 'Python integration tests for pants - shard 2'") 04 Jan 2016 01:41PM UTC 0
Travis Job 8470.6
7 8470.7 (CI_FLAGS="-fkmsrjlpn -i 2/6 'Python integration tests for pants - shard 3'") 04 Jan 2016 01:38PM UTC 0
Travis Job 8470.7
8 8470.8 (CI_FLAGS="-fkmsrjlpn -i 3/6 'Python integration tests for pants - shard 4'") 04 Jan 2016 01:41PM UTC 0
Travis Job 8470.8
9 8470.9 (CI_FLAGS="-fkmsrjlpn -i 4/6 'Python integration tests for pants - shard 5'") 04 Jan 2016 01:42PM UTC 0
Travis Job 8470.9
10 8470.10 (CI_FLAGS="-fkmsrjlpn -i 5/6 'Python integration tests for pants - shard 6'") 04 Jan 2016 01:52PM UTC 0
Travis Job 8470.10
Source Files on build 8470
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #8470
  • 9a212ad5 on github
  • Prev Build on master (#8468)
  • Next Build on master (#8471)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc