question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for both Python 2 and 3 yaml package?

See original GitHub issue

Would 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:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
morpheus65535commented, Sep 27, 2019

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!

0reactions
caronccommented, Sep 27, 2019

2 questions for you:

  1. Did you have any luck figuring out your issue?
  2. Are you okay if I close this ticket off?

p.s. i’m more interested in the answer to the first question though! 🙂

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found