prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  conda env export under python2 is ug
  ```
  $ python2 -m conda_env export -p /conda
  name: null
  channels:
  - !!python/unicode
    'file:///Users/kfranz/.conda/conda-bld'
  - !!python/unicode
    'file:///conda/conda-bld'
  - !!python/unicode
    'bkreider'
  - !!python/unicode
    'conda-canary'
  - !!python/unicode
    'conda-forge'
  - !!python/unicode
    'defaults'
  dependencies:
  - !!python/unicode
    'wget=1.15=2'
  - !!python/unicode
    'conda=4.3.0=py27_0'
  - !!python/unicode
    'conda-env=2.6.0=0'
  - !!python/unicode
    'filelock=2.0.6=py27_0'
  - !!python/unicode
    'boltons=16.3.1=py27_0'
  - !!python/unicode
    'ca-certificates=2016.8.31=0'
  - !!python/unicode
    'certifi=2016.8.31=py27_0'
  - !!python/unicode
    'functools32=3.2.3.2=py27_1'
  ...
  ```
  
  </issue>
  <code>
  [start of conda_env/yaml.py]
  1 """
  2 Wrapper around yaml to ensure that everything is ordered correctly.
  3 
  4 This is based on the answer at http://stackoverflow.com/a/16782282
  5 """
  6 from __future__ import absolute_import, print_function
  7 from collections import OrderedDict
  8 
  9 from conda.common.yaml import get_yaml
  10 yaml = get_yaml()
  11 
  12 
  13 def represent_ordereddict(dumper, data):
  14     value = []
  15 
  16     for item_key, item_value in data.items():
  17         node_key = dumper.represent_data(item_key)
  18         node_value = dumper.represent_data(item_value)
  19 
  20         value.append((node_key, node_value))
  21 
  22     return yaml.nodes.MappingNode(u'tag:yaml.org,2002:map', value)
  23 
  24 
  25 yaml.add_representer(OrderedDict, represent_ordereddict)
  26 
  27 dump = yaml.dump
  28 load = yaml.load
  29 dict = OrderedDict
  30
  [end of conda_env/yaml.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/conda_env/yaml.py b/conda_env/yaml.py
  --- a/conda_env/yaml.py
  +++ b/conda_env/yaml.py
  @@ -6,6 +6,7 @@
   from __future__ import absolute_import, print_function
   from collections import OrderedDict
   
  +from conda.common.compat import PY2
   from conda.common.yaml import get_yaml
   yaml = get_yaml()
   
  @@ -24,6 +25,12 @@
   
   yaml.add_representer(OrderedDict, represent_ordereddict)
   
  +if PY2:
  +    def represent_unicode(self, data):
  +        return self.represent_str(data.encode('utf-8'))
  +
  +    yaml.add_representer(unicode, represent_unicode)  # NOQA
  +
   dump = yaml.dump
   load = yaml.load
   dict = OrderedDict
  
verification_info: {"golden_diff": "diff --git a/conda_env/yaml.py b/conda_env/yaml.py\n--- a/conda_env/yaml.py\n+++ b/conda_env/yaml.py\n@@ -6,6 +6,7 @@\n from __future__ import absolute_import, print_function\n from collections import OrderedDict\n \n+from conda.common.compat import PY2\n from conda.common.yaml import get_yaml\n yaml = get_yaml()\n \n@@ -24,6 +25,12 @@\n \n yaml.add_representer(OrderedDict, represent_ordereddict)\n \n+if PY2:\n+    def represent_unicode(self, data):\n+        return self.represent_str(data.encode('utf-8'))\n+\n+    yaml.add_representer(unicode, represent_unicode)  # NOQA\n+\n dump = yaml.dump\n load = yaml.load\n dict = OrderedDict\n", "issue": "conda env export under python2 is ug\n```\r\n$ python2 -m conda_env export -p /conda\r\nname: null\r\nchannels:\r\n- !!python/unicode\r\n  'file:///Users/kfranz/.conda/conda-bld'\r\n- !!python/unicode\r\n  'file:///conda/conda-bld'\r\n- !!python/unicode\r\n  'bkreider'\r\n- !!python/unicode\r\n  'conda-canary'\r\n- !!python/unicode\r\n  'conda-forge'\r\n- !!python/unicode\r\n  'defaults'\r\ndependencies:\r\n- !!python/unicode\r\n  'wget=1.15=2'\r\n- !!python/unicode\r\n  'conda=4.3.0=py27_0'\r\n- !!python/unicode\r\n  'conda-env=2.6.0=0'\r\n- !!python/unicode\r\n  'filelock=2.0.6=py27_0'\r\n- !!python/unicode\r\n  'boltons=16.3.1=py27_0'\r\n- !!python/unicode\r\n  'ca-certificates=2016.8.31=0'\r\n- !!python/unicode\r\n  'certifi=2016.8.31=py27_0'\r\n- !!python/unicode\r\n  'functools32=3.2.3.2=py27_1'\r\n...\r\n```\n", "before_files": [{"content": "\"\"\"\nWrapper around yaml to ensure that everything is ordered correctly.\n\nThis is based on the answer at http://stackoverflow.com/a/16782282\n\"\"\"\nfrom __future__ import absolute_import, print_function\nfrom collections import OrderedDict\n\nfrom conda.common.yaml import get_yaml\nyaml = get_yaml()\n\n\ndef represent_ordereddict(dumper, data):\n    value = []\n\n    for item_key, item_value in data.items():\n        node_key = dumper.represent_data(item_key)\n        node_value = dumper.represent_data(item_value)\n\n        value.append((node_key, node_value))\n\n    return yaml.nodes.MappingNode(u'tag:yaml.org,2002:map', value)\n\n\nyaml.add_representer(OrderedDict, represent_ordereddict)\n\ndump = yaml.dump\nload = yaml.load\ndict = OrderedDict\n", "path": "conda_env/yaml.py"}]}