Coder Social home page Coder Social logo

Auth script about autoflashgui HOT 2 CLOSED

alfonsocaponi avatar alfonsocaponi commented on July 26, 2024
Auth script

from autoflashgui.

Comments (2)

mswhirl avatar mswhirl commented on July 26, 2024

Hi Alfonso,

You need the following line at the start of your program to fix the exception handling routine:
import traceback

The problem you are hitting with 'TypeError: Can't convert 'bytes' object to str implicitly' is that a string and bytes are treated differently. Strings needed to be encoded/decoded to bytes (i.e. unicode to binary storage) but for your simple script you should be able to add the 'b' prefix to the username and password as required i.e.
username = b'user'
password = b'pass'

The original calling program uses .encode() on strings from the config and GUI as required when calling the library:
res = libautoflashgui.mainScript(self.host.get(), self.username.get().encode(), self.password.get().encode(), self.flashfirmware.get(), self.firmwarefile.get(), self.flashSleepDelay, self.methodAction.get(), self.command.get(), self.splitActive.get(), self.ddnsService.get(), self.connectRetryDelay, self.interCommandDelay)

Can you please try defining your username and password with b'' and see if it fixes your error?

Regards,
Mark.

from autoflashgui.

mswhirl avatar mswhirl commented on July 26, 2024

Closing, please re-open if you need more help. :)
Cheers,
Mark.

from autoflashgui.

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.