Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use resources loader to handle non-filesystem situations (#120)
* Use a resources loader if possible * Remove logic duplication
- Loading branch information
Showing
1 changed file
with
27 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a9ab4b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Lukasa could you revert back this commit?
It broke Python 2 via
open(where(), "r", encoding="ascii")
, there is noencoding
argument for Python 2. If you need "encoding", please useio.open
.It produces strange errors:
a9ab4b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't care about breaking Python 2 (it's EOL, time to move on), but the Python 3.7 error is problematic. @adferrand, any idea what the heck is going on here? I'm going to back this out and ship a patch release to revert to the previously working state.
a9ab4b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a9ab4b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alex done
a9ab4b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to remove https://github.com/certifi/python-certifi/blob/master/setup.py#L57:59 lines if this package is not compatible with Python 2 & 3. To be honest, I don't see any reason why you should drop Python 2. A lot of packages depend on
certifi
. Also, a lot of people use different tools which depend onrequests
which depends oncertifi
. These users ARE NOT PYTHON DEVELOPERS. So, they just use Python which is shipped with OS or was installed before.I'm on a user's side. Yes, we should use Python 3. However, package maintainers are responsible for the smooth transition. Our project @platformio is much much much more complex and we still maintain Python 2 and Python 3. I would be happy if we can drop Python 2 tomorrow.
a9ab4b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Lukasa what is the reason dropping Python 2? Do you depend on API from Python 3 which is not available in Python 2? We are developers and package maintainers. I still do not understand. Sorry.
a9ab4b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already done.
Agreed. The original sunset date of Python 2 was announced in 2008 as 2015. In 2014 that sunset date was extended five years, to 2020. I believe six years was plenty of time to put together a transition plan. Certifi has supported Python 3 since at least 2014, so it has been possible for dependencies to support Python 3 throughout that time. We managed our transition period, and it was at least six years long. This just simply does not seem to be our problem.
On top of this, however, the reason to want certifi is because you want to maintain the security of your infrastructure. Python 2 is no longer receiving security patches. It's a by-definition insecure platform. Complaining about certifi not supporting Python 2 is like complaining about the fact that your door locks don't work when your house's walls are falling apart. To stretch the metaphor: get out of the building.
a9ab4b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not about me. Over 1M developers use PlatformIO and people use different Pythons. Most of them are embedded developers. We have good rating of our extension https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide&ssr=false#review-details
People write bad reviews very often due to cases where problems are linked with similar dependencies like certifi. So, if something does not work, they think that the whole PlatformIO is bad.
We notify them that we will drop Python 2 soon. We also install Python 3 by default on Windows. However, we can "kill" 500K developers because of Python 2 EOL.
Nevertheless, it's your repository. We will just drop dependency on this package and will use raw cacert.pem.
Thanks for your work!
a9ab4b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the moment this conversation is moot: I have pushed an update that reverted this commit and therefore restores Python 2 function. I am not planning to ship a new release at this time, nor instruct pip to refuse to install.
However, things are rapidly coming to a place where Python 2 and Python 3 support represents an entirely unreasonable maintenance burden. Python 2 support is going to start vanishing. People need to get on board.
a9ab4b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's up to you. I would be thankful if you inform about dropping Python 2 to PSF. See https://github.com/psf/requests/blob/master/setup.py#L48
a9ab4b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we have reverted this patch and that @dstufft has suggested that he can provide an alternative that does not regress Python 2 support, this should not be necessary in the near term. But I am expressly not committing to a minimum time bound on supporting Python 2. I'm supporting it as long as it's practical, and then there must either be a discussion about those who need Python 2 support stepping up to do the work of keeping it running or I'm dropping that support. One of those two must happen.
a9ab4b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't 3e58560 break Python 2 compatibility already by using the
encoding
argument?