diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 9d7dce15b..f8c0d33a3 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,10 +1,10 @@
+
+
+
+
{{ _('Set this if you keep running into rate limiting issues. See here for how to obtain a token.', url="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token") }}
diff --git a/src/octoprint/plugins/softwareupdate/version_checks/git_commit.py b/src/octoprint/plugins/softwareupdate/version_checks/git_commit.py
index 1fa0e3591..734beac81 100644
--- a/src/octoprint/plugins/softwareupdate/version_checks/git_commit.py
+++ b/src/octoprint/plugins/softwareupdate/version_checks/git_commit.py
@@ -38,9 +38,7 @@ def _git(args, cwd, hide_stderr=False):
else:
return None, None
- stdout = p.communicate()[0].strip()
- if sys.version >= "3":
- stdout = stdout.decode()
+ stdout = p.communicate()[0].strip().decode()
if p.returncode != 0:
return p.returncode, None
diff --git a/src/octoprint/server/util/__init__.py b/src/octoprint/server/util/__init__.py
index 0de7c6a9a..20c3efff5 100644
--- a/src/octoprint/server/util/__init__.py
+++ b/src/octoprint/server/util/__init__.py
@@ -6,7 +6,7 @@ import base64
import logging
import sys
-PY3 = sys.version_info[0] == 3 # should now always be true, kept for plugins
+PY3 = sys.version_info >= (3, 0) # should now always be True, kept for plugins
import flask as _flask
import flask_login
diff --git a/src/octoprint/server/util/flask.py b/src/octoprint/server/util/flask.py
index 6e552650d..c8eb0aee9 100644
--- a/src/octoprint/server/util/flask.py
+++ b/src/octoprint/server/util/flask.py
@@ -265,7 +265,7 @@ class ReverseProxiedEnvironment:
# sensible defaults
if header_prefix is None:
- header_prefix = ["x-script-name"]
+ header_prefix = ["x-script-name", "x-forwarded-prefix"]
if header_scheme is None:
header_scheme = ["x-forwarded-proto", "x-scheme"]
if header_host is None:
diff --git a/src/octoprint/util/__init__.py b/src/octoprint/util/__init__.py
index e1f3f3074..00ca0bd23 100644
--- a/src/octoprint/util/__init__.py
+++ b/src/octoprint/util/__init__.py
@@ -77,7 +77,7 @@ def to_unicode(
s_or_u: Union[str, bytes], encoding: str = "utf-8", errors: str = "strict"
) -> str:
"""
- Make sure ``s_or_u`` is a unicode string (str).
+ Make sure ``s_or_u`` is a string (str).
Arguments:
s_or_u (str or bytes): The value to convert
@@ -202,7 +202,6 @@ def warning_factory(warning_type):
"__dict__",
"__doc__",
"__str__",
- "__unicode__",
"__repr__",
"__getattribute__",
"__setattr__",
@@ -1618,7 +1617,7 @@ class CaseInsensitiveSet(Set):
"""
Basic case insensitive set
- Any str or unicode values will be stored and compared in lower case. Other value types are left as-is.
+ Any str values will be stored and compared in lower case. Other value types are left as-is.
"""
def __init__(self, *args):
diff --git a/src/octoprint/util/gcodeInterpreter.py b/src/octoprint/util/gcodeInterpreter.py
index dfb4d612d..03ab7deee 100644
--- a/src/octoprint/util/gcodeInterpreter.py
+++ b/src/octoprint/util/gcodeInterpreter.py
@@ -587,8 +587,13 @@ class gcode:
else:
e = 0
+ # calculate 3d arc length
+ arcLengthXYZ = math.sqrt(
+ (oldPos.z - pos.z) ** 2 + ((endAngle - startAngle) * r) ** 2
+ )
+
# move time in x, y, z, will be 0 if no movement happened
- moveTimeXYZ = abs((oldPos - pos).length / feedrate)
+ moveTimeXYZ = abs(arcLengthXYZ / feedrate)
# time needed for extruding, will be 0 if no extrusion happened
extrudeTime = abs(e / feedrate)