Skip to content

Conversation

@sethvs
Copy link
Contributor

@sethvs sethvs commented Jun 9, 2018

PR Summary

Fix #7032, #7048

Get-ChildItem c: throws an error. #7032

Get-ChildItem c:

Get-ChildItem : Cannot find path 'C:\C:\' because it does not exist.
At line:1 char:1
+ Get-ChildItem c:
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (C:\C:\:String) [Get-ChildItem], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

When creating file using -Path c: without a backslash, file created in the drive root and not in the current folder. #7048

Windows PowerShell 5.1: file is created in current path - C:\Folder

[5.1] PS C:\Folder> New-Item -Path c: -Name testfile.txt


    Directory: C:\Folder


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        6/14/2018  12:30 PM              0 testfile.txt

PowerShell Core 6.0.2: file is created in current path - C:\Folder

[6.0.2] PS C:\Folder> New-Item -Path c: -Name testfile.txt


    Directory: C:\Folder


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        6/14/2018  12:32 PM              0 testfile.txt

PowerShell Core 6.1.0-preview.2: file is created in current path - C:\Folder

[6.1.0-preview.2] PS C:\Folder> New-Item -Path c: -Name testfile.txt


    Directory: C:\Folder


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        6/14/2018  12:28 PM              0 testfile.txt

PowerShell Core 6.1.0-preview.3: file is created in root path - C:\

[6.1.0-preview.3] PS C:\Folder> New-Item -Path c: -Name testfile.txt


    Directory: C:\


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        6/14/2018  12:29 PM              0 testfile.txt

PR Checklist

@sethvs sethvs requested review from BrucePay and anmenaga as code owners June 9, 2018 15:17
@bergmeister
Copy link
Contributor

bergmeister commented Jun 10, 2018

@sethvs Please push an empty commit to trigger another build since there seemed to be a sporadic problem that caused the build to hang and timeout. You could do this for example as follows, I recommend putting [feature] in the message so that more advanced tests run as well to test your change, which would be useful for this PR.

git commit -m [feature] --allow-empty
git push

@iSazonov This happened to me last week as well that a build got into a hanging state. Have you see that before as well or is this probably caused by a recently added test?

@iSazonov
Copy link
Collaborator

@bergmeister Do you mean a problem only with CIs (not local)?
Can you open new Issue and provide links on broken CI jobs?

@bergmeister
Copy link
Contributor

bergmeister commented Jun 10, 2018

@iSazonov I mean the AppVeyor run of this PR here. It must have got stuck or in a hanging state because it timed out after 3 hours.
The same build happened to this PR build of PR 7013. It seems that it happens only randomly.
I put those details into the new issue #7038
To be able to still analyse this build failure later on, we should not restart this build ourselves but rather push a new commit for a new build.

@sethvs sethvs requested a review from daxian-dbw as a code owner June 12, 2018 15:04
@anmenaga
Copy link

@sethvs After fixing current test failures in New-Item.Tests.ps1, please do a [feature] commit as @bergmeister suggested. Those namespaces APIs is a very fragile piece of code; so we need to run as many tests as we can to ensure that nothing gets broken by these changes.

@sethvs
Copy link
Contributor Author

sethvs commented Jun 13, 2018

@anmenaga OK.

@sethvs
Copy link
Contributor Author

sethvs commented Jun 13, 2018

Update-Help and PowerShellGet tests fail.
Can we restart Travis CI?

@iSazonov
Copy link
Collaborator

@sethvs Please look #6149 - perhaps we could fix it too.

@sethvs
Copy link
Contributor Author

sethvs commented Jun 13, 2018

@iSazonov OK, will take a look.

@sethvs
Copy link
Contributor Author

sethvs commented Jun 14, 2018

@adityapatwardhan @iSazonov I'm afraid I can't allocate much time at the moment. So let's split fixing #6149 to another PR in order not to delay this one. I'm going to address it later.

@sethvs
Copy link
Contributor Author

sethvs commented Jun 14, 2018

Empty commit to restart tests.

@adityapatwardhan
Copy link
Member

@sethvs it seems that #7048 is fixed in preview.3

@adityapatwardhan adityapatwardhan requested a review from rjmholt June 14, 2018 17:47
@adityapatwardhan
Copy link
Member

@rjmholt Can you have a look too?

@sethvs
Copy link
Contributor Author

sethvs commented Jun 15, 2018

@adityapatwardhan No, it is not fixed.
The description of this PR contains examples of the issue in 6.1.0-preview.3.

Copy link
Collaborator

@iSazonov iSazonov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave a comment

Copy link
Collaborator

@rjmholt rjmholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to build this branch and have a look at it, but it looks good so far.

{
PSTraceSource.NewArgumentNullException("paths");
}
else if (path.EndsWith((":" + Path.DirectorySeparatorChar), StringComparison.Ordinal) || path.EndsWith((":" + Path.AltDirectorySeparatorChar), StringComparison.Ordinal))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth hanging a line for the second path check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, done.

Copy link
Collaborator

@rjmholt rjmholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've put this branch through a test run and got no unusual failures. This looks good to me!

@adityapatwardhan adityapatwardhan merged commit ffca008 into PowerShell:master Jun 25, 2018
@sethvs sethvs deleted the GetChildItem branch July 20, 2018 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get-ChildItem c: throws an error.

6 participants