prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Updated Error on Version File Missing
  4XX errors are client errors. In that case, if the file is not on the server, the client is not guilty
  Raise error instead of returning 404 on __version__ if version file is missing
  https://github.com/Kinto/kinto/blame/master/kinto/core/views/version.py#L49
  
  suggested by @peterbe 
  
  4XX errors are client errors. In that case, if the file is not on the server, the client is not guilty ;)
  
  </issue>
  <code>
  [start of kinto/core/views/version.py]
  1 import json
  2 import os
  3 
  4 import colander
  5 from pyramid import httpexceptions
  6 from pyramid.security import NO_PERMISSION_REQUIRED
  7 from kinto.core import Service
  8 
  9 HERE = os.path.dirname(__file__)
  10 ORIGIN = os.path.dirname(HERE)
  11 
  12 
  13 class VersionResponseSchema(colander.MappingSchema):
  14     body = colander.SchemaNode(colander.Mapping(unknown="preserve"))
  15 
  16 
  17 version_response_schemas = {
  18     "200": VersionResponseSchema(description="Return the running Instance version information.")
  19 }
  20 
  21 
  22 version = Service(name="version", path="/__version__", description="Version")
  23 
  24 
  25 @version.get(
  26     permission=NO_PERMISSION_REQUIRED,
  27     tags=["Utilities"],
  28     operation_id="__version__",
  29     response_schemas=version_response_schemas,
  30 )
  31 def version_view(request):
  32     try:
  33         return version_view.__json__
  34     except AttributeError:
  35         pass
  36 
  37     location = request.registry.settings["version_json_path"]
  38     files = [
  39         location,  # Default is current working dir.
  40         os.path.join(ORIGIN, "version.json"),  # Relative to the package root.
  41         os.path.join(HERE, "version.json"),  # Relative to this file.
  42     ]
  43     for version_file in files:
  44         if os.path.exists(version_file):
  45             with open(version_file) as f:
  46                 version_view.__json__ = json.load(f)
  47                 return version_view.__json__  # First one wins.
  48 
  49     raise httpexceptions.HTTPNotFound()
  50
  [end of kinto/core/views/version.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/kinto/core/views/version.py b/kinto/core/views/version.py
  --- a/kinto/core/views/version.py
  +++ b/kinto/core/views/version.py
  @@ -2,7 +2,6 @@
   import os
   
   import colander
  -from pyramid import httpexceptions
   from pyramid.security import NO_PERMISSION_REQUIRED
   from kinto.core import Service
   
  @@ -46,4 +45,4 @@
                   version_view.__json__ = json.load(f)
                   return version_view.__json__  # First one wins.
   
  -    raise httpexceptions.HTTPNotFound()
  +    raise FileNotFoundError("Version file missing from {}".format(files.join(",")))
  
verification_info: {"golden_diff": "diff --git a/kinto/core/views/version.py b/kinto/core/views/version.py\n--- a/kinto/core/views/version.py\n+++ b/kinto/core/views/version.py\n@@ -2,7 +2,6 @@\n import os\n \n import colander\n-from pyramid import httpexceptions\n from pyramid.security import NO_PERMISSION_REQUIRED\n from kinto.core import Service\n \n@@ -46,4 +45,4 @@\n                 version_view.__json__ = json.load(f)\n                 return version_view.__json__  # First one wins.\n \n-    raise httpexceptions.HTTPNotFound()\n+    raise FileNotFoundError(\"Version file missing from {}\".format(files.join(\",\")))\n", "issue": "Updated Error on Version File Missing\n4XX errors are client errors. In that case, if the file is not on the server, the client is not guilty\nRaise error instead of returning 404 on __version__ if version file is missing\nhttps://github.com/Kinto/kinto/blame/master/kinto/core/views/version.py#L49\r\n\r\nsuggested by @peterbe \r\n\r\n4XX errors are client errors. In that case, if the file is not on the server, the client is not guilty ;)\n", "before_files": [{"content": "import json\nimport os\n\nimport colander\nfrom pyramid import httpexceptions\nfrom pyramid.security import NO_PERMISSION_REQUIRED\nfrom kinto.core import Service\n\nHERE = os.path.dirname(__file__)\nORIGIN = os.path.dirname(HERE)\n\n\nclass VersionResponseSchema(colander.MappingSchema):\n    body = colander.SchemaNode(colander.Mapping(unknown=\"preserve\"))\n\n\nversion_response_schemas = {\n    \"200\": VersionResponseSchema(description=\"Return the running Instance version information.\")\n}\n\n\nversion = Service(name=\"version\", path=\"/__version__\", description=\"Version\")\n\n\n@version.get(\n    permission=NO_PERMISSION_REQUIRED,\n    tags=[\"Utilities\"],\n    operation_id=\"__version__\",\n    response_schemas=version_response_schemas,\n)\ndef version_view(request):\n    try:\n        return version_view.__json__\n    except AttributeError:\n        pass\n\n    location = request.registry.settings[\"version_json_path\"]\n    files = [\n        location,  # Default is current working dir.\n        os.path.join(ORIGIN, \"version.json\"),  # Relative to the package root.\n        os.path.join(HERE, \"version.json\"),  # Relative to this file.\n    ]\n    for version_file in files:\n        if os.path.exists(version_file):\n            with open(version_file) as f:\n                version_view.__json__ = json.load(f)\n                return version_view.__json__  # First one wins.\n\n    raise httpexceptions.HTTPNotFound()\n", "path": "kinto/core/views/version.py"}]}