prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [package] all: "Access is denied" in os.rename() on Windows
  ### Package and Environment Details (include every applicable attribute)
    * Package Name/Version: **almost all packages affected**
    * Operating System+version: **Windows 10**
    * Compiler+version: **MSVC 16**
    * Conan version: **conan 1.35.2**
    * Python version: **Python 3.8.7**
  
  
  ### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
  ```
  [settings]
  os_build=Windows
  os=Windows
  arch=x86_64
  arch_build=x86_64
  compiler=Visual Studio
  compiler.version=16
  compiler.runtime=MD
  build_type=Release
  ```
  
  ### Steps to reproduce (Include if Applicable)
  
  This is a known issue. Solution provided by https://github.com/conan-io/conan/pull/6774
  However most recipes still use `os.rename()` and not `tools.rename()`. 
  
  ### Log
  ```
  b2/4.2.0: Configuring sources in C:\Users\xxx\.conan\data\b2\4.2.0\_\_\source
  ERROR: b2/4.2.0: Error in source() method, line 58
  os.rename(extracted_dir, "source")
  PermissionError: [WinError 5] Access is denied: 'build-4.2.0' -> 'source'
  ```
  
  
  </issue>
  <code>
  [start of recipes/zulu-openjdk/all/conanfile.py]
  1 from conans import ConanFile, tools
  2 from conans.errors import ConanInvalidConfiguration
  3 import os, glob
  4 
  5 
  6 class ZuluOpenJDK(ConanFile):
  7     name = "zulu-openjdk"
  8     url = "https://github.com/conan-io/conan-center-index/"
  9     description = "A OpenJDK distribution"
  10     homepage = "https://www.azul.com"
  11     license = "https://www.azul.com/products/zulu-and-zulu-enterprise/zulu-terms-of-use/"
  12     topics = ("java", "jdk", "openjdk")
  13     settings = "os", "arch"
  14 
  15     @property
  16     def _source_subfolder(self):
  17         return "source_subfolder"
  18 
  19     @property
  20     def _jni_folder(self):
  21         folder = {"Linux": "linux", "Macos": "darwin", "Windows": "win32"}.get(str(self.settings.os))
  22         return os.path.join("include", folder)
  23 
  24     def configure(self):
  25         if self.settings.arch != "x86_64":
  26             raise ConanInvalidConfiguration("Unsupported Architecture.  This package currently only supports x86_64.")
  27         if self.settings.os not in ["Windows", "Macos", "Linux"]:
  28             raise ConanInvalidConfiguration("Unsupported os. This package currently only support Linux/Macos/Windows")
  29 
  30     def source(self):
  31         url = self.conan_data["sources"][self.version]["url"][str(self.settings.os)]
  32         checksum = self.conan_data["sources"][self.version]["sha256"][str(self.settings.os)]
  33         tools.get(url, sha256=checksum)
  34         os.rename(glob.glob("zulu*")[0], self._source_subfolder)
  35 
  36     def build(self):
  37         pass # nothing to do, but this shall trigger no warnings ;-)
  38 
  39     def package(self):
  40         self.copy(pattern="*", dst="bin", src=os.path.join(self._source_subfolder, "bin"), excludes=("msvcp140.dll", "vcruntime140.dll"))
  41         self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include"))
  42         self.copy(pattern="*", dst="lib", src=os.path.join(self._source_subfolder, "lib"))
  43         self.copy(pattern="*", dst="res", src=os.path.join(self._source_subfolder, "conf"))
  44         # conf folder is required for security settings, to avoid
  45         # java.lang.SecurityException: Can't read cryptographic policy directory: unlimited
  46         # https://github.com/conan-io/conan-center-index/pull/4491#issuecomment-774555069
  47         self.copy(pattern="*", dst="conf", src=os.path.join(self._source_subfolder, "conf"))
  48         self.copy(pattern="*", dst="licenses", src=os.path.join(self._source_subfolder, "legal"))
  49         self.copy(pattern="*", dst=os.path.join("lib", "jmods"), src=os.path.join(self._source_subfolder, "jmods"))
  50 
  51     def package_info(self):
  52         self.cpp_info.includedirs.append(self._jni_folder)
  53         self.cpp_info.libdirs = []
  54 
  55         java_home = self.package_folder
  56         bin_path = os.path.join(java_home, "bin")
  57 
  58         self.output.info("Creating JAVA_HOME environment variable with : {0}".format(java_home))
  59         self.env_info.JAVA_HOME = java_home
  60 
  61         self.output.info("Appending PATH environment variable with : {0}".format(bin_path))
  62         self.env_info.PATH.append(bin_path)
  63
  [end of recipes/zulu-openjdk/all/conanfile.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/recipes/zulu-openjdk/all/conanfile.py b/recipes/zulu-openjdk/all/conanfile.py
  --- a/recipes/zulu-openjdk/all/conanfile.py
  +++ b/recipes/zulu-openjdk/all/conanfile.py
  @@ -28,10 +28,8 @@
               raise ConanInvalidConfiguration("Unsupported os. This package currently only support Linux/Macos/Windows")
   
       def source(self):
  -        url = self.conan_data["sources"][self.version]["url"][str(self.settings.os)]
  -        checksum = self.conan_data["sources"][self.version]["sha256"][str(self.settings.os)]
  -        tools.get(url, sha256=checksum)
  -        os.rename(glob.glob("zulu*")[0], self._source_subfolder)
  +        tools.get(**self.conan_data["sources"][self.version][str(self.settings.os)],
  +                  destination=self._source_subfolder, strip_root=True)
   
       def build(self):
           pass # nothing to do, but this shall trigger no warnings ;-)
  
verification_info: {"golden_diff": "diff --git a/recipes/zulu-openjdk/all/conanfile.py b/recipes/zulu-openjdk/all/conanfile.py\n--- a/recipes/zulu-openjdk/all/conanfile.py\n+++ b/recipes/zulu-openjdk/all/conanfile.py\n@@ -28,10 +28,8 @@\n             raise ConanInvalidConfiguration(\"Unsupported os. This package currently only support Linux/Macos/Windows\")\n \n     def source(self):\n-        url = self.conan_data[\"sources\"][self.version][\"url\"][str(self.settings.os)]\n-        checksum = self.conan_data[\"sources\"][self.version][\"sha256\"][str(self.settings.os)]\n-        tools.get(url, sha256=checksum)\n-        os.rename(glob.glob(\"zulu*\")[0], self._source_subfolder)\n+        tools.get(**self.conan_data[\"sources\"][self.version][str(self.settings.os)],\n+                  destination=self._source_subfolder, strip_root=True)\n \n     def build(self):\n         pass # nothing to do, but this shall trigger no warnings ;-)\n", "issue": "[package] all: \"Access is denied\" in os.rename() on Windows\n### Package and Environment Details (include every applicable attribute)\r\n  * Package Name/Version: **almost all packages affected**\r\n  * Operating System+version: **Windows 10**\r\n  * Compiler+version: **MSVC 16**\r\n  * Conan version: **conan 1.35.2**\r\n  * Python version: **Python 3.8.7**\r\n\r\n\r\n### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)\r\n```\r\n[settings]\r\nos_build=Windows\r\nos=Windows\r\narch=x86_64\r\narch_build=x86_64\r\ncompiler=Visual Studio\r\ncompiler.version=16\r\ncompiler.runtime=MD\r\nbuild_type=Release\r\n```\r\n\r\n### Steps to reproduce (Include if Applicable)\r\n\r\nThis is a known issue. Solution provided by https://github.com/conan-io/conan/pull/6774\r\nHowever most recipes still use `os.rename()` and not `tools.rename()`. \r\n\r\n### Log\r\n```\r\nb2/4.2.0: Configuring sources in C:\\Users\\xxx\\.conan\\data\\b2\\4.2.0\\_\\_\\source\r\nERROR: b2/4.2.0: Error in source() method, line 58\r\nos.rename(extracted_dir, \"source\")\r\nPermissionError: [WinError 5] Access is denied: 'build-4.2.0' -> 'source'\r\n```\r\n\n", "before_files": [{"content": "from conans import ConanFile, tools\nfrom conans.errors import ConanInvalidConfiguration\nimport os, glob\n\n\nclass ZuluOpenJDK(ConanFile):\n    name = \"zulu-openjdk\"\n    url = \"https://github.com/conan-io/conan-center-index/\"\n    description = \"A OpenJDK distribution\"\n    homepage = \"https://www.azul.com\"\n    license = \"https://www.azul.com/products/zulu-and-zulu-enterprise/zulu-terms-of-use/\"\n    topics = (\"java\", \"jdk\", \"openjdk\")\n    settings = \"os\", \"arch\"\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n\n    @property\n    def _jni_folder(self):\n        folder = {\"Linux\": \"linux\", \"Macos\": \"darwin\", \"Windows\": \"win32\"}.get(str(self.settings.os))\n        return os.path.join(\"include\", folder)\n\n    def configure(self):\n        if self.settings.arch != \"x86_64\":\n            raise ConanInvalidConfiguration(\"Unsupported Architecture.  This package currently only supports x86_64.\")\n        if self.settings.os not in [\"Windows\", \"Macos\", \"Linux\"]:\n            raise ConanInvalidConfiguration(\"Unsupported os. This package currently only support Linux/Macos/Windows\")\n\n    def source(self):\n        url = self.conan_data[\"sources\"][self.version][\"url\"][str(self.settings.os)]\n        checksum = self.conan_data[\"sources\"][self.version][\"sha256\"][str(self.settings.os)]\n        tools.get(url, sha256=checksum)\n        os.rename(glob.glob(\"zulu*\")[0], self._source_subfolder)\n\n    def build(self):\n        pass # nothing to do, but this shall trigger no warnings ;-)\n\n    def package(self):\n        self.copy(pattern=\"*\", dst=\"bin\", src=os.path.join(self._source_subfolder, \"bin\"), excludes=(\"msvcp140.dll\", \"vcruntime140.dll\"))\n        self.copy(pattern=\"*\", dst=\"include\", src=os.path.join(self._source_subfolder, \"include\"))\n        self.copy(pattern=\"*\", dst=\"lib\", src=os.path.join(self._source_subfolder, \"lib\"))\n        self.copy(pattern=\"*\", dst=\"res\", src=os.path.join(self._source_subfolder, \"conf\"))\n        # conf folder is required for security settings, to avoid\n        # java.lang.SecurityException: Can't read cryptographic policy directory: unlimited\n        # https://github.com/conan-io/conan-center-index/pull/4491#issuecomment-774555069\n        self.copy(pattern=\"*\", dst=\"conf\", src=os.path.join(self._source_subfolder, \"conf\"))\n        self.copy(pattern=\"*\", dst=\"licenses\", src=os.path.join(self._source_subfolder, \"legal\"))\n        self.copy(pattern=\"*\", dst=os.path.join(\"lib\", \"jmods\"), src=os.path.join(self._source_subfolder, \"jmods\"))\n\n    def package_info(self):\n        self.cpp_info.includedirs.append(self._jni_folder)\n        self.cpp_info.libdirs = []\n\n        java_home = self.package_folder\n        bin_path = os.path.join(java_home, \"bin\")\n\n        self.output.info(\"Creating JAVA_HOME environment variable with : {0}\".format(java_home))\n        self.env_info.JAVA_HOME = java_home\n\n        self.output.info(\"Appending PATH environment variable with : {0}\".format(bin_path))\n        self.env_info.PATH.append(bin_path)\n", "path": "recipes/zulu-openjdk/all/conanfile.py"}]}