Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3 support #615

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open

Python3 support #615

wants to merge 33 commits into from

Conversation

shortdudey123
Copy link
Member

Rebased version of #259:

This PR makes it possible to run and build Diamond with Python3.

Note that this breaks compatility with Pythons before 2.6 but that has mostly been the de facto state for a lot of the collectors even before this. (they depend on things like subprocess.check_output)

Ormod and others added 28 commits March 10, 2017 15:02
This is a first step towards achieving compatibility with
py2.6/2.7 and py3.3+ out of the same codebase.
Also get rid of basestring so tests can start to be run on py3k.
The performance impact of this should be fairly limited but it
allows to run the same code with py3k.
None of the callsites is performance critical (the ranges in question
are tiny) and this allows for the same code to be run on py3k.
The callsites seemed to all parse the config, making them just
strings instead of possibly unicode string on py2.x
We now import the most suitable StringIO to the platform from a
single place instead of from n files.
…import on py3k

The name needs to be different from the package name so the test can import the
correct name.
This is done so we can keep the existing long() typecasts in place,
though it's unclear if they're still needed. This commit just
replaces the existing logic without taking a stance on that.
We always assume a utf8 encoding which is the case almost everywhere
these days, and even in the places where it's not, the command line
tools called actually mostly return just ASCII test which converts
correctly anyway.
Also add __pycache__ files of py3k into the clean Makefile target.
Update several compat changes that were missed or added since origional commits
- StringIO
- urllib
- print function
@grobian
Copy link

grobian commented Dec 8, 2019

this needs in addition:

  • Queue -> queue in src/diamond/handler/queue.py for import Queue and Queue.Full
  • removal of paths = map(str.strip, paths) from src/diamond/utils/classes.py (to load anything)
  • use of str.encode(data) with self.socket.sendall in src/diamond/handler/graphite.py

I don't know how to add those to this PR without creating a new one. I'd be cool if we could get some traction on merging Python3 compatibility.

pedmon added a commit to fasrc/Diamond that referenced this pull request Jun 16, 2021
@vladislavkoz
Copy link

Hello guys. Any updates on this PR? Do you have some information about Python3 support?

@myroslavsok
Copy link

Oh, I need Python 3 support as well. It would be great.

@mpcathey
Copy link

Is this the best place to revive the python3 support discussion?

@vladislavkoz
Copy link

Is this the best place to revive the python3 support discussion?

Just check the number of forks. I believe everybody just doing it's own fork now and upgrading to p3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants