aws-cdk: CDK for .NET cannot handle Swedish characters in TEMP/TMP path
CDK for .NET Core does not seem to be able to handle paths with non-ascii characters in them. My username in Windows is having an å character, which seems to cause an issue becuase the TEMP folder contains that letter in it’s path.
Reproduction Steps
- SET TMP to c:\path_with_å_in_it
- Run cdk synthesize, where you have a csharp project (or any cdk command it seems)
Error Log
An exception is thrown:
Unhandled exception. Amazon.JSII.Runtime.JsiiException: ENOENT: no such file or directory, stat 'C:\Users\PerG´┐¢rdebrink\AppData\Local\Temp\x0c4glzt.kiq\Amazon.CDK.CloudAssembly.Schema.aws-cdk-cloud-assembly-schema-1.33.1.tgz'
Environment
- CLI Version : 1.33.1
- Framework Version: .NET Core 3.1
- OS : Windows 10 (1909)
- Language : Swedish
Other
Unhandled exception. Amazon.JSII.Runtime.JsiiException: ENOENT: no such file or directory, stat 'C:\Users\PerG´┐¢rdebrink\AppData\Local\Temp\x0c4glzt.kiq\Amazon.CDK.CloudAssembly.Schema.aws-cdk-cloud-assembly-schema-1.33.1.tgz'
at Amazon.JSII.Runtime.Services.Client.TryDeserialize[TResponse](String responseJson)
at Amazon.JSII.Runtime.Services.Client.ReceiveResponse[TResponse]()
at Amazon.JSII.Runtime.Services.Client.Send[TRequest,TResponse](TRequest requestObject)
at Amazon.JSII.Runtime.Services.Client.Load(LoadRequest request)
at Amazon.JSII.Runtime.Services.Client.Load(String name, String version, String tarball)
at Amazon.JSII.Runtime.Services.Client.LoadPackage(String package, String version, String tarballPath)
at Amazon.JSII.Runtime.Deputy.JsiiTypeAttributeBase.Load(Assembly assembly)
at Amazon.JSII.Runtime.Deputy.JsiiTypeAttributeBase.Load(Assembly assembly)
at Amazon.JSII.Runtime.Deputy.JsiiTypeAttributeBase.Load(Assembly assembly)
at Amazon.JSII.Runtime.Deputy.JsiiTypeAttributeBase..ctor(Type nativeType, String fullyQualifiedName)
at Amazon.JSII.Runtime.Deputy.JsiiClassAttribute..ctor(Type nativeType, String fullyQualifiedName, String parametersJson)
at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, RuntimeType type, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1 derivedAttributes)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit)
at System.Attribute.GetCustomAttributes(MemberInfo element, Type type, Boolean inherit)
at System.Attribute.GetCustomAttribute(MemberInfo element, Type attributeType, Boolean inherit)
at System.Reflection.CustomAttributeExtensions.GetCustomAttribute[T](MemberInfo element)
at Amazon.JSII.Runtime.ReflectionUtils.GetClassAttribute(Type type)
at Amazon.JSII.Runtime.Deputy.DeputyBase..ctor(DeputyProps props)
at Constructs.Construct..ctor(DeputyProps props)
at Amazon.CDK.Construct..ctor(DeputyProps props)
at Amazon.CDK.App..ctor(IAppProps props)
at Temp.Program.Main(String[] args) in C:\git\temp\src\Temp\Program.cs:line 12
Subprocess exited with error 3762504530
This is 🐛 Bug Report
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (10 by maintainers)
I suspect that it’s some kind of encoding/decoding issue and that the problem is generally related to non-ascii characters?
Btw, I see that the exception I wrote in the issue was when the TMP was set to my windows profile folder name. If you set TMP to the path in the step above, the exception message would of course be something like
Unhandled exception. Amazon.JSII.Runtime.JsiiException: ENOENT: no such file or directory, stat 'C:\path_with_´┐¢in_it\x0c4glzt.kiq\Amazon.CDK.CloudAssembly.Schema.aws-cdk-cloud-assembly-schema-1.33.1.tgz'Let me know if you need more information to reproduce the issue or if you want me to provide more information