We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN 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'
...
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `conda_env/yaml.py`
Content:
```
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 FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

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

{"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"}], "after_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.compat import PY2\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\nif 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\ndump = yaml.dump\nload = yaml.load\ndict = OrderedDict\n", "path": "conda_env/yaml.py"}]}