Giter VIP home page Giter VIP logo

Comments (9)

sudipm-mukherjee avatar sudipm-mukherjee commented on June 9, 2024

@piyueh can you please paste your original offlineimap_funcs.py file also.

from offlineimap3.

piyueh avatar piyueh commented on June 9, 2024

@sudipm-mukherjee Hi, I pasted it to the Gist: https://gist.github.com/piyueh/a2d65e095ea675a2c715ad42b7b61d10

from offlineimap3.

piyueh avatar piyueh commented on June 9, 2024

I believe this is caused by the transition from Python 2 to Python 3. Handling of str, Unicode, and bytes is different in Python 2 and 3. Seems now the user-defined functions that return tokens do not have to return bytes.

from offlineimap3.

sudipm-mukherjee avatar sudipm-mukherjee commented on June 9, 2024

@piyueh yes, this is caused by Python2 vs. Python3. And this might need fixes like 9679382. Unfortunately I did not get the time to check this. @thekix might have some solution for this.

from offlineimap3.

thekix avatar thekix commented on June 9, 2024

Hello @piyueh

Thanks a lot for your issue. Yes, the problem is related to Python2/Python3 change. In Python2 bytes and strings were more or less the same, but in Python3 are different.

Some questions/things:

  1. If you return strings (str) in offlineimap_functions.py the problem is solved?
  2. In the offlineimap_functions.py file the header is "#! /usr/bin/env python" and probably should be "#! /usr/bin/env python3"

The offlineimap_functions.py file seems to be fine and I am not sure if the best for offlineimap3 is using strings instead of bytes. Now, in offlineimap_functions.py, you are creating an object, with strings, and you are converting the strings to bytes for offlineimap3.

Probably is better avoid the conversion and return the string. IMHO, "Old" Python2 scripts cannot be supported in offlineimap3, and should be updated too (like offlineimap). If you need help to update this file, I can help. In this case, IMO, we should change the documentation.

What do you think?

Best Regards,
kix

PS. Thanks a lot for your help @sudipm-mukherjee

from offlineimap3.

piyueh avatar piyueh commented on June 9, 2024

Hi @thekix

  1. Yes, if I return str, the problem is solved.
  2. I'm using Arch, and the default Python version in Arch is Python 3. So I don't explicitly use python3 in the header.

I also believe the best way is to return str because that's how Python 3 works by default. Then, I think only the documentation should be changed.

from offlineimap3.

thekix avatar thekix commented on June 9, 2024

Thanks a lot @piyueh

I am trying to find it in the documentation, but I cannot find it. Where is it?

Thanks a lot,
Regards.
kix

from offlineimap3.

piyueh avatar piyueh commented on June 9, 2024

Hi @thekix, I think the fix is addressed in PR #77

from offlineimap3.

nicolas33 avatar nicolas33 commented on June 9, 2024

Correct. Do never use the "go back in history" button in the browser while making PRs on github...

from offlineimap3.

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.