Repository: conda/conda

Issue:
conda env export error with setup.py develop packages
conda 4.3.23, Anaconda 4.4.0  

Environment export fails if there is a comma in the file path for the package.  These paths are valid on Windows.  See attached dump.

[conda_export_error.txt](https://github.com/conda/conda/files/1208700/conda_export_error.txt)

Fix is to change line 95 in ..\conda_env\pip_util.py to only split on the first comma:

        version, path = version.split(', ', 1)




Discussion:
```
|52> conda env export
An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

    https://github.com/conda/conda/issues



Current conda install:

               platform : win-64
          conda version : 4.3.23
       conda is private : False
      conda-env version : 4.3.23
    conda-build version : not installed
         python version : 3.6.2.final.0
       requests version : 2.14.2
       root environment : C:\apps\anaconda3-440  (writable)
    default environment : C:\apps\anaconda3-440\envs\dlwin36
       envs directories : C:\apps\anaconda3-440\envs
                          C:\Users\knorthover\AppData\Local\conda\conda\envs
                          C:\Users\knorthover\.conda\envs
          package cache : C:\apps\anaconda3-440\pkgs
                          C:\Users\knorthover\AppData\Local\conda\conda\pkgs
           channel URLs : https://repo.continuum.io/pkgs/free/win-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/win-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/win-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://repo.continuum.io/pkgs/msys2/win-64
                          https://repo.continuum.io/pkgs/msys2/noarch
            config file : None
             netrc file : None
           offline mode : False
             user-agent : conda/4.3.23 requests/2.14.2 CPython/3.6.2 Windows/10 Windows/10.0.14393
          administrator : False

`$ C:\apps\anaconda3-440\Scripts\conda-env-script.py export`




    Traceback (most recent call last):
      File "C:\apps\anaconda3-440\lib\site-packages\conda\exceptions.py", line 634, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "C:\apps\anaconda3-440\lib\site-packages\conda_env\cli\main_export.py", line 90, in execute
        ignore_channels=args.ignore_channels)
      File "C:\apps\anaconda3-440\lib\site-packages\conda_env\env.py", line 46, in from_environment
        add_pip_installed(prefix, installed, json=True)
      File "C:\apps\anaconda3-440\lib\site-packages\conda_env\pip_util.py", line 114, in add_pip_installed
        for pip_pkg in installed(prefix, output=output):
      File "C:\apps\anaconda3-440\lib\site-packages\conda_env\pip_util.py", line 95, in installed
        version, path = version.split(', ')
    ValueError: too many values to unpack (expected 2)

The version string being split was:

2.0.0, c:\users\knorthover\onedrive - kje northover, llc\projects\keraslib

Commas are allowed in Windows filenames and in this case are automatically generated by 
the MS OneDrive setup.

```

Resolving patch:
diff --git a/conda_env/pip_util.py b/conda_env/pip_util.py
--- a/conda_env/pip_util.py
+++ b/conda_env/pip_util.py
@@ -87,7 +87,7 @@ def installed(prefix, output=True):
                 # version. We still include the conda version, though, because it
                 # is still installed.
 
-                version, path = kwargs['version'].split(', ')
+                version, path = kwargs['version'].split(', ', 1)
                 # We do this because the code below uses rsplit('-', 2)
                 version = version.replace('-', ' ')
                 kwargs['version'] = version


Test patch: