Support for both Python 2 and 3 yaml package?
See original GitHub issueWould it be possible to change this line: https://github.com/caronc/apprise/blob/6aa52c37dd98e45d53e3b84536d4dd5b9ff4893f/apprise/config/ConfigBase.py#L29
For this:
try:
import yaml
except ImportError:
if six.PY3:
import yaml3 as yaml
else:
import yaml2 as yaml
This would give the possibility to run the same code on Bazarr side with apprise and yaml included either with Python 2.7 and 3.7.
What do you think about this? You have another idea?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
PyYAML is a YAML parser and emitter for Python.
support for all types from the YAML types repository. A simple extension API is provided. both pure-Python and fast LibYAML-based parsers and emitters....
Read more >How do I install the yaml package for Python? - Stack Overflow
There are three YAML capable packages. Syck ( pip install syck ) which implements the YAML 1.0 specification from 2002; PyYAML ( pip...
Read more >Differences with PyYAML - ruamel.yaml - Read the Docs
ruamel.yaml re-integrates the Python 2 and 3 sources, running on Python 2.7 (CPython, PyPy), 3.3, 3.4, 3.5 and 3.6 (support for 2.6 has...
Read more >Cheat Sheet: Writing Python 2-3 compatible code
This notebook shows you idioms for writing future-proof code that is compatible with both versions of Python: 2 and 3. It accompanies Ed...
Read more >Mixing and matching python 2 and python 3 environments ...
It does work, however, if I call python3 from within the py27 environment and load yaml . It appears to me that the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hehe, yes you can close it. I had to have 2 additional directories to keep copies of both version of module when required. Using six.PY3, I append the required directory to sys.path. Not the cleanest solution but it work fine! 😃
Thanks for your time!
2 questions for you:
p.s. i’m more interested in the answer to the first question though! 🙂