Code Monkey home page Code Monkey logo

Comments (9)

asmeurer avatar asmeurer commented on May 20, 2024

Are you in Python 3?

from conda-build.

ivan-kalev avatar ivan-kalev commented on May 20, 2024

My root environment is python 2.7-based (full anaconda, i.e. not miniconda). This bug is reproducible with either value of %CONDA_PY% (33 and 27).

from conda-build.

ivan-kalev avatar ivan-kalev commented on May 20, 2024

Here is a simple test case:

>>> import subprocess
>>> subprocess.Popen(["cmd.exe"], env={u"TEST": ""})
  File "C:\Anaconda\envs\py27\lib\subprocess.py", line 957, in _execute_child
    startupinfo)
TypeError: environment can only contain strings

>>> subprocess.Popen(["cmd.exe"], env={"TEST": ""})
<subprocess.Popen object at 0x0000000002A37748>

Note that this is an issue on Python 2 only, because in Python 3 u"str" is "str".

from conda-build.

asmeurer avatar asmeurer commented on May 20, 2024

The important thing is the version of Python that conda itself is running in. Python 3 has no "unicode strings".

from conda-build.

asmeurer avatar asmeurer commented on May 20, 2024

I guess an easy fix would be to call str on each variable. This will be a no-op in Python 3 and convert unicode to str in Python 2. If any of the strings contain non-ascii characters it will fail, but looking through the code, I don't think that can happen.

from conda-build.

H0R5E avatar H0R5E commented on May 20, 2024

There is a similar problem with "conda skeleton pypi" for 2.7 on win-64.

> conda skeleton pypi watchdog
Using url https://pypi.python.org/packages/source/w/watchdog/watchdog-0.8.0.tar.gz (152770) for watchdog.
Downloading watchdog (use --no-download to skip this step)
Unpacking watchdog...
done
working in c:\users\matthe~1\appdata\local\temp\tmphybgnbconda_skeleton_watchdog
Fetching package metadata: ....
Solving package specifications: .
The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    python-2.7.8               |                0        17.1 MB

The following packages will be UN-linked:

    package                    |            build
    ---------------------------|-----------------
    python-2.7.7               |                2

The following packages will be linked:

    package                    |            build
    ---------------------------|-----------------
    python-2.7.8               |                0   hard-link
    pyyaml-3.11                |           py27_0   hard-link

Fetching packages ...
python-2.7.8-0 100% |###############################| Time: 0:00:27 659.82 kB/s
Extracting packages ...
[      COMPLETE      ] |#################################################| 100%
Unlinking packages ...
[      COMPLETE      ] |#################################################| 100%
Linking packages ...
[      COMPLETE      ] |#################################################| 100%
Applying patch: u'c:\\users\\matthe~1\\appdata\\local\\temp\\tmphybgnbconda_skeleton_watchdog\\pypi-distutils.patch'
patching file core.py
Hunk #1 succeeded at 169 with fuzz 2 (offset 2 lines).
Traceback (most recent call last):
  File "C:\Anaconda\Scripts\conda-skeleton-script.py", line 4, in <module>
    sys.exit(main())
  File "C:\Anaconda\lib\site-packages\conda_build\main_skeleton.py", line 124, in main
    args.func(args, p)
  File "C:\Anaconda\lib\site-packages\conda_build\main_skeleton.py", line 135, in execute
    pypi.main(args, parser)
  File "C:\Anaconda\lib\site-packages\conda_build\pypi.py", line 313, in main
    run_setuppy(src_dir, tempdir, args)
  File "C:\Anaconda\lib\site-packages\conda_build\pypi.py", line 491, in run_setuppy
    subprocess.check_call(args, env=env)
  File "C:\Anaconda\lib\subprocess.py", line 535, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:\Anaconda\lib\subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "C:\Anaconda\lib\subprocess.py", line 709, in __init__
    errread, errwrite)
  File "C:\Anaconda\lib\subprocess.py", line 957, in _execute_child
    startupinfo)
TypeError: environment can only contain strings

> conda info
Current conda install:

             platform : win-64
        conda version : 3.5.5
       python version : 2.7.6.final.0
     root environment : C:\Anaconda  (writable)
  default environment : C:\Anaconda
     envs directories : C:\Anaconda\envs
        package cache : C:\Anaconda\pkgs
         channel URLs : http://repo.continuum.io/pkgs/free/win-64/
                        http://repo.continuum.io/pkgs/pro/win-64/
          config file : C:\Users\matthewtopper\.condarc
    is foreign system : False

from conda-build.

asmeurer avatar asmeurer commented on May 20, 2024

This should be fixed in the latest version of conda-build. conda update conda-build.

from conda-build.

H0R5E avatar H0R5E commented on May 20, 2024

Yes, thanks. I was using 1.3.1. Perhaps worth including this update in the anaconda package? I updated anaconda to 2.0.1 yesterday.

from conda-build.

github-actions avatar github-actions commented on May 20, 2024

Hi there, thank you for your contribution!

This issue has been automatically locked because it has not had recent activity after being closed.

Please open a new issue if needed.

Thanks!

from conda-build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.