prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Broken activation in Windows for python3
  virtualenv activation through `activate_this.py` is broken in Windows for python3. Check this very simple piece of code
  
  ```
  import os
  import subprocess
  import sys
  from distutils.spawn import find_executable
  
  venv = find_executable("virtualenv")
  testdir = os.path.join(os.path.curdir, 'testenv')
  
  subprocess.check_output((venv, testdir, "-p", sys.executable))
  
  bin_path = os.path.join(testdir, "Scripts") if sys.platform in ("win32", "cygwin") else os.path.join(testdir, "bin")
  
  path = os.path.join(bin_path, "activate_this.py")
  with open(path) as f:
      exec(f.read(), {"__file__": path})
  ```
  
  This generates a `AttributeError: 'str' object has no attribute 'decode'`. Taking a look at the `activate_this.py` code:
  
  ```
  for lib in "..\Lib\site-packages".split(os.pathsep):
      path = os.path.realpath(os.path.join(bin_dir, lib))
      site.addsitedir(path.decode("utf-8") if "yes" else path)
  ```
  
  it's indeed normal that we get the error because we're always calling `decode()` over a str. Question is where the `__DECODE_PATH__` from https://github.com/pypa/virtualenv/blob/master/src/virtualenv/activation/python/activate_this.py#L28 is assigned to `"yes"`?
  
  </issue>
  <code>
  [start of src/virtualenv/activation/python/__init__.py]
  1 from __future__ import absolute_import, unicode_literals
  2 
  3 import os
  4 from collections import OrderedDict
  5 
  6 from virtualenv.info import WIN_CPYTHON_2
  7 from virtualenv.util.path import Path
  8 from virtualenv.util.six import ensure_text
  9 
  10 from ..via_template import ViaTemplateActivator
  11 
  12 
  13 class PythonActivator(ViaTemplateActivator):
  14     def templates(self):
  15         yield Path("activate_this.py")
  16 
  17     def replacements(self, creator, dest_folder):
  18         replacements = super(PythonActivator, self).replacements(creator, dest_folder)
  19         lib_folders = OrderedDict((os.path.relpath(str(i), str(dest_folder)), None) for i in creator.libs)
  20         replacements.update(
  21             {
  22                 "__LIB_FOLDERS__": ensure_text(os.pathsep.join(lib_folders.keys())),
  23                 "__DECODE_PATH__": ("yes" if WIN_CPYTHON_2 else ""),
  24             }
  25         )
  26         return replacements
  27 
  28     @staticmethod
  29     def _repr_unicode(creator, value):
  30         py2 = creator.interpreter.version_info.major == 2
  31         if py2:  # on Python 2 we need to encode this into explicit utf-8, py3 supports unicode literals
  32             value = ensure_text(repr(value.encode("utf-8"))[1:-1])
  33         return value
  34
  [end of src/virtualenv/activation/python/__init__.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/src/virtualenv/activation/python/__init__.py b/src/virtualenv/activation/python/__init__.py
  --- a/src/virtualenv/activation/python/__init__.py
  +++ b/src/virtualenv/activation/python/__init__.py
  @@ -3,7 +3,6 @@
   import os
   from collections import OrderedDict
   
  -from virtualenv.info import WIN_CPYTHON_2
   from virtualenv.util.path import Path
   from virtualenv.util.six import ensure_text
   
  @@ -17,10 +16,11 @@
       def replacements(self, creator, dest_folder):
           replacements = super(PythonActivator, self).replacements(creator, dest_folder)
           lib_folders = OrderedDict((os.path.relpath(str(i), str(dest_folder)), None) for i in creator.libs)
  +        win_py2 = creator.interpreter.platform == "win32" and creator.interpreter.version_info.major == 2
           replacements.update(
               {
                   "__LIB_FOLDERS__": ensure_text(os.pathsep.join(lib_folders.keys())),
  -                "__DECODE_PATH__": ("yes" if WIN_CPYTHON_2 else ""),
  +                "__DECODE_PATH__": ("yes" if win_py2 else ""),
               }
           )
           return replacements
  
verification_info: {"golden_diff": "diff --git a/src/virtualenv/activation/python/__init__.py b/src/virtualenv/activation/python/__init__.py\n--- a/src/virtualenv/activation/python/__init__.py\n+++ b/src/virtualenv/activation/python/__init__.py\n@@ -3,7 +3,6 @@\n import os\n from collections import OrderedDict\n \n-from virtualenv.info import WIN_CPYTHON_2\n from virtualenv.util.path import Path\n from virtualenv.util.six import ensure_text\n \n@@ -17,10 +16,11 @@\n     def replacements(self, creator, dest_folder):\n         replacements = super(PythonActivator, self).replacements(creator, dest_folder)\n         lib_folders = OrderedDict((os.path.relpath(str(i), str(dest_folder)), None) for i in creator.libs)\n+        win_py2 = creator.interpreter.platform == \"win32\" and creator.interpreter.version_info.major == 2\n         replacements.update(\n             {\n                 \"__LIB_FOLDERS__\": ensure_text(os.pathsep.join(lib_folders.keys())),\n-                \"__DECODE_PATH__\": (\"yes\" if WIN_CPYTHON_2 else \"\"),\n+                \"__DECODE_PATH__\": (\"yes\" if win_py2 else \"\"),\n             }\n         )\n         return replacements\n", "issue": "Broken activation in Windows for python3\nvirtualenv activation through `activate_this.py` is broken in Windows for python3. Check this very simple piece of code\r\n\r\n```\r\nimport os\r\nimport subprocess\r\nimport sys\r\nfrom distutils.spawn import find_executable\r\n\r\nvenv = find_executable(\"virtualenv\")\r\ntestdir = os.path.join(os.path.curdir, 'testenv')\r\n\r\nsubprocess.check_output((venv, testdir, \"-p\", sys.executable))\r\n\r\nbin_path = os.path.join(testdir, \"Scripts\") if sys.platform in (\"win32\", \"cygwin\") else os.path.join(testdir, \"bin\")\r\n\r\npath = os.path.join(bin_path, \"activate_this.py\")\r\nwith open(path) as f:\r\n    exec(f.read(), {\"__file__\": path})\r\n```\r\n\r\nThis generates a `AttributeError: 'str' object has no attribute 'decode'`. Taking a look at the `activate_this.py` code:\r\n\r\n```\r\nfor lib in \"..\\Lib\\site-packages\".split(os.pathsep):\r\n    path = os.path.realpath(os.path.join(bin_dir, lib))\r\n    site.addsitedir(path.decode(\"utf-8\") if \"yes\" else path)\r\n```\r\n\r\nit's indeed normal that we get the error because we're always calling `decode()` over a str. Question is where the `__DECODE_PATH__` from https://github.com/pypa/virtualenv/blob/master/src/virtualenv/activation/python/activate_this.py#L28 is assigned to `\"yes\"`?\n", "before_files": [{"content": "from __future__ import absolute_import, unicode_literals\n\nimport os\nfrom collections import OrderedDict\n\nfrom virtualenv.info import WIN_CPYTHON_2\nfrom virtualenv.util.path import Path\nfrom virtualenv.util.six import ensure_text\n\nfrom ..via_template import ViaTemplateActivator\n\n\nclass PythonActivator(ViaTemplateActivator):\n    def templates(self):\n        yield Path(\"activate_this.py\")\n\n    def replacements(self, creator, dest_folder):\n        replacements = super(PythonActivator, self).replacements(creator, dest_folder)\n        lib_folders = OrderedDict((os.path.relpath(str(i), str(dest_folder)), None) for i in creator.libs)\n        replacements.update(\n            {\n                \"__LIB_FOLDERS__\": ensure_text(os.pathsep.join(lib_folders.keys())),\n                \"__DECODE_PATH__\": (\"yes\" if WIN_CPYTHON_2 else \"\"),\n            }\n        )\n        return replacements\n\n    @staticmethod\n    def _repr_unicode(creator, value):\n        py2 = creator.interpreter.version_info.major == 2\n        if py2:  # on Python 2 we need to encode this into explicit utf-8, py3 supports unicode literals\n            value = ensure_text(repr(value.encode(\"utf-8\"))[1:-1])\n        return value\n", "path": "src/virtualenv/activation/python/__init__.py"}]}