You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Microsoft Windows NT 10.0.22631.0 x64
Ubuntu 22.04.5
Subsystem
No response
What steps will reproduce the bug?
This does not occur on any previous version of Node that I have tried (22.2.0, 21.7.3, 20.18.).
This is an excerpt of the code that I was working with. I was writing a unit test to test some code that parsed XML files and updated them. As part of this test, I copied a directory of example XML files to a backup directory, and then restored them in a afterEach hook. This worked until I ran it in CI and came across the issue with the current node version.
import{fileURLToPath}from'node:url';import{dirname,join}from'node:path';import*asfsfrom'node:fs';import{ux}from'@oclif/core';describe('update xml files',()=>{constfilename=fileURLToPath(import.meta.url);constfileDirName=dirname(filename);constxmlFilesPath=join(fileDirName,'../../xml');constxmlBackupPath=join(fileDirName,'../../xmlBackup');beforeEach(async()=>{try{fs.cpSync(xmlFilesPath,xmlBackupPath,{recursive: true});if(!fs.existsSync(xmlBackupPath)){thrownewError(`Backup XML directory does not exist: ${xmlFilesPath}`);}}catch(error: unknown){ux.error(errorasError);}});});
The error received was: Error: Cannot copy \\?\C:\Users\kc_ra\Documents\repos\kc-sf-plugin\test\xml to a subdirectory of self \\?\C:\Users\kc_ra\Documents\repos\kc-sf-plugin\test\xmlBackup
This was weird because it's not a subdirectory. However, I figured out that to fix it, I had to change the name of the backup directory from xmlBackup to just backup. This resolves the issue.
How often does it reproduce? Is there a required condition?
It happens every time you try to copy a directory into a sibling directory, in which the new directory's name contains the original directory's name.
What is the expected behavior? Why is that the expected behavior?
The expected behavior would be for this to only occur when it is an actual subdirectory, not just have similar names.
What do you see instead?
Error: Cannot copy \\?\C:\Users\kc_ra\Documents\repos\kc-sf-plugin\test\test to a subdirectory of self \\?\C:\Users\kc_ra\Documents\repos\kc-sf-plugin\test\testing
Additional information
No response
The text was updated successfully, but these errors were encountered:
This is a duplicate of #54285. This fix has already been applied to main, however it has not landed on any release lines yet. I assume it'll release with v22.10.0, whever that releases.
Version
22.9.0
Platform
Subsystem
No response
What steps will reproduce the bug?
This does not occur on any previous version of Node that I have tried (22.2.0, 21.7.3, 20.18.).
This is an excerpt of the code that I was working with. I was writing a unit test to test some code that parsed XML files and updated them. As part of this test, I copied a directory of example XML files to a backup directory, and then restored them in a
afterEach
hook. This worked until I ran it in CI and came across the issue with the current node version.The error received was:
Error: Cannot copy \\?\C:\Users\kc_ra\Documents\repos\kc-sf-plugin\test\xml to a subdirectory of self \\?\C:\Users\kc_ra\Documents\repos\kc-sf-plugin\test\xmlBackup
This was weird because it's not a subdirectory. However, I figured out that to fix it, I had to change the name of the backup directory from
xmlBackup
to justbackup
. This resolves the issue.How often does it reproduce? Is there a required condition?
It happens every time you try to copy a directory into a sibling directory, in which the new directory's name contains the original directory's name.
Example:
What is the expected behavior? Why is that the expected behavior?
The expected behavior would be for this to only occur when it is an actual subdirectory, not just have similar names.
What do you see instead?
Error: Cannot copy \\?\C:\Users\kc_ra\Documents\repos\kc-sf-plugin\test\test to a subdirectory of self \\?\C:\Users\kc_ra\Documents\repos\kc-sf-plugin\test\testing
Additional information
No response
The text was updated successfully, but these errors were encountered: