def _convertenviron(space, w_env): # _wenviron must be initialized in this way if the program is # started through main() instead of wmain() rwin32._wgetenv(u"") for key, value in rwin32._wenviron_items(): if isinstance(key, str): key = key.upper() space.setitem(w_env, space.wrap(key), space.wrap(value))
def test_wenviron(): name, value = u'PYPY_TEST_日本', u'foobar日本' rwin32._wputenv(name, value) assert rwin32._wgetenv(name) == value env = dict(rwin32._wenviron_items()) assert env[name] == value for key, value in env.iteritems(): assert type(key) is unicode assert type(value) is unicode
def test_wenviron(): name, value = u"PYPY_TEST_日本", u"foobar日本" rwin32._wputenv(name, value) assert rwin32._wgetenv(name) == value env = dict(rwin32._wenviron_items()) assert env[name] == value for key, value in env.iteritems(): assert type(key) is unicode assert type(value) is unicode