Giter Site home page Giter Site logo

Comments (12)

tarekziade avatar tarekziade commented on July 17, 2024 1

We're far away from vendoring tooltool (that's the plan)
In the meantime for this bug what I propose we do is:

  • fix it here
  • copy over the new tooltool.py version in all tooltool.py instances in mozilla-central
  • bump the version number in that file, it was never changed I think

from tooltool.

bhearsum avatar bhearsum commented on July 17, 2024

At this point, 3.6 is Old (3.8.1 is already out). I don't think it's worth fixing this unless it's reproducible on 3.7 or 3.8.

from tooltool.

tarekziade avatar tarekziade commented on July 17, 2024

@mozbhearsum you should reopen this bug, it will happen on 3.7 and 3.8 as well.

The bug is that for some reason, the PY3 version is not saving the data using a binary mode. it converts for some reason the data received into text and then writes it into a text file.

But it makes the assumption that the data received can always be decoded in utf8, which is not the case all the time (and the response headers don't always give us a hint and we don't check it anyways)

We should keep the 'wb' mode for py3 too and simply write through the data received as bytes.
I got it working locally, happy to provide a PR is needed.

from tooltool.

tarekziade avatar tarekziade commented on July 17, 2024

This is my quick fix to make it work locally :)

tarek@Tareks-MacBook-Air-3 Downloads % diff tooltool.py.original tooltool.py.mine
63c63
<     open_attrs = dict(mode='w', encoding='utf-8')
---
>     open_attrs = dict(mode='wb')  #, encoding='utf-8')
740,741c740,741
<                     if PY3:
<                         indata = to_text(indata)
---
>                     #if PY3:
>                     #    indata = to_text(indata)

from tooltool.

bhearsum avatar bhearsum commented on July 17, 2024

Okay, let's reopen then :)

from tooltool.

bebef1987 avatar bebef1987 commented on July 17, 2024

This is blocking a mozproxy enhancement: https://phabricator.services.mozilla.com/D62443

Here is a try example of the error:
https://treeherder.mozilla.org/#/jobs?repo=try&selectedJob=289676975&revision=73a706c3397b0ed213c6727f2a347d3e375d6608

from tooltool.

bhearsum avatar bhearsum commented on July 17, 2024

I have a plausible fix for this in #27, although it can't be merged yet due to test failures.

If anyone is up for it, I'd appreciate any additional testing you can do with the new tooltool.py.

from tooltool.

bhearsum avatar bhearsum commented on July 17, 2024

https://lando.services.mozilla.com/D63870/ to import the fix in tree.

from tooltool.

bebef1987 avatar bebef1987 commented on July 17, 2024

@mozbhearsum looks like the import was backed out can you take a new look pls

from tooltool.

bhearsum avatar bhearsum commented on July 17, 2024

Yeah, sorry about that. I've got that fixed here, and will be updating mozilla-central again after #28 lands.

In the meantime, feel free to import the current tooltool.py into try pushes if it helps you.

from tooltool.

bhearsum avatar bhearsum commented on July 17, 2024

#28 is taking a bit longer than I thought. I opened https://phabricator.services.mozilla.com/D65139 to get the python 3 support landed in the meantime.

from tooltool.

bhearsum avatar bhearsum commented on July 17, 2024

This landed on central and stuck this time. Python 3 should work now. Please re-open or open a new issue if it's still problematic.

from tooltool.

Related Issues (16)

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.