Coder Social home page Coder Social logo

Port to 3.5 about pycomm HOT 6 OPEN

ruscito avatar ruscito commented on July 26, 2024
Port to 3.5

from pycomm.

Comments (6)

bpaterni avatar bpaterni commented on July 26, 2024 2

Hi all,

A functioning(*) pycomm3 library should now be available at https://github.com/bpaterni/pycomm3

  • The changes made are only the bare minimum necessary in order to get this running via python3.5. Most of it is just changing string literals/operations to their 'byte' counterparts in python3. There are likely lingering bugs on a few code paths through the library, but I thought I would publish my work so far in order to jump start migration of pycomm to python3.

Hopefully others find this useful, and if you're able, please help in making pycomm3 more complete.
:)

edit: Instead of a completely new repo (pycomm3), I forked the current ruscito/pycomm to https://github.com/bpaterni/pycomm and created a branch under it (pycomm3) to contain the changes mentioned above

from pycomm.

patrickjmcd avatar patrickjmcd commented on July 26, 2024

I believe the Python 3 issues have to do with changes to the struct library, specifically the types of returned variables.

Compare the Python 2 Documentation with the Python 3 Documentation for the struct package. You'll see that in python 2, pack returns a string, but in python 3, pack returns a bytes object. Similarly, unpack in python 2 takes a string as a parameter, but a bytes object in python 3.

I'm going to try to work on a fix for this that will work for both python 2 and python 3. @INTERCEPTOR27 How far have you gotten? It would probably be good to start this on a new branch.

from pycomm.

ruscito avatar ruscito commented on July 26, 2024

Actually pack and unpack should be the only problem; I don't recall other
issue when I tried to run the lib under python 3

On Fri, Nov 11, 2016 at 5:27 PM, Patrick McDonagh [email protected]
wrote:

I believe the Python 3 issues have to do with changes to the struct
library, specifically the types of returned variables.

Compare the Python 2 Documentation
https://docs.python.org/2/library/struct.html with the Python 3
Documentation https://docs.python.org/3/library/struct.html for the
struct package. You'll see that in python 2, pack returns a string, but in
python 3, pack returns a bytes object. Similarly, unpack in python 2 takes
a string as a parameter, but a bytes object in python 3.

I'm going to try to work on a fix for this that will work for both python
2 and python 3. @INTERCEPTOR27 https://github.com/INTERCEPTOR27 How far
have you gotten? It would probably be good to start this on a new branch.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#16 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABL5ocDfULS6aiYG68VDs-Ao71hHbIv-ks5q9PnogaJpZM4KcE3E
.

from pycomm.

patrickjmcd avatar patrickjmcd commented on July 26, 2024

Yeah, I admittedly don't understand the mechanics of the request/response within CIP yet to understand it all, but it didn't seem to work when I edited the pack/unpack functions. It would only get closer to working when I used encode/decode on the results of the pack/unpack functions. I'll keep investigating on Monday

from pycomm.

two7 avatar two7 commented on July 26, 2024

@patrickjmcd I've got it working as far as the 2.7 version is working. I was actually talking to a colleague at work about putting the code up here as my first contribution on GitHub.

I'll tidy up the changes I've made and upload it when I'm back in the office this week. What's the best way to do it?

I would then like to take it further and get strings working as per the code previously posted.

from pycomm.

ruscito avatar ruscito commented on July 26, 2024

@INTERCEPTOR27 as Patrick pointed the best way will be start a new branch so that we can keep up with the two libraries. How much did you had to change?

from pycomm.

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.