sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: deno
Issue: `Deno.copyFile`/`Deno.copyFileSync` deletes all contents when copying to the same file
Labels: triage required 👀

I'm pretty sure that nobody would expect the file contents to be deleted when copying to the same file. This also seems to affect compatibility with node.

Here I print the size of the copied file before and after:

```bash
echo 'test' > a.txt
du a.txt
deno repl -A --eval 'Deno.copyFileSync("a.txt", "a.txt");Deno.exit();'
du a.txt
```

This gives the following output:

```bash
4       a.txt
0       a.txt
```

Deno version:

```
deno 1.34.1 (release, x86_64-unknown-linux-gnu)
v8 11.5.150.2
typescript 5.0.4
```
Repository: stable-diffusion-webui
Issue: [Feature Request]: pass share_url to api
Labels: enhancement

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What would your feature do ?

Here, is defined share_url from gradio, it would be nice to export it via API, so I can make a routine to notify myself where this url now. 
https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/baf6946e06249c5af9851c60171692c44ef633e0/webui.py#L395



### Proposed workflow

I think it could be added to /info json or anywhere where it could be accessed 

### Additional information

_No response_
Repository: three.js
Issue: Raycast points with fixed size
Labels: Suggestion

### Description

When using a Points object with a `ShaderMaterial` that does not attenuate point size, the raycaster threshold does not scale with the distance from the point. If `raycaster.params.Points.threshold` is set to allow hitting a point's rendered boundary a certain distance away, then clicking on the boundary of points further away will not register as a hit.

Fiddle demonstrating issue: https://jsfiddle.net/k9gd5r02/
Try clicking the point and see check the console for whether the raycaster hit or missed the point. Zoom in or out and try again to demonstrate the issue.

### Solution

For point materials that do not attenuate with size, let the raycaster define a hit by an angle threshold.
If _v1_ is the ray's direction vector, and _v2_ is the vector from the ray's origin to the point, then the point is considered a hit if the angle between _v1_ and _v2_ is below a threshold.

Fiddle demonstrating solution:  https://jsfiddle.net/jy4sg1fb/
Same test as last fiddle, but the raycaster should work regardless of zoom level.

The main difference is the change to the function 'testPoint', which is called in Points.raycast.
```javascript
function testPoint(...) {
    const intersectPoint = new THREE.Vector3();
    _ray.closestPointToPoint( point, intersectPoint );
    intersectPoint.applyMatrix4( matrixWorld );
    const OriginToPointDistance = raycaster.ray.origin.distanceTo( point );
    const intersectPointDistance = intersectPoint.distanceTo( point );
    const rayPointAngle = Math.asin( intersectPointDistance / OriginToPointDistance );
	if ( rayPointAngle < localThreshold ) {
        // we have a hit.
    }
}
```

### Alternatives

Previously, what I did to get around this problem is use a group of `Sprite` objects instead of a `Points `object, and then check the (u,v) coordinates of the raycaster intersection to decide if I should keep or discard the intersection. 

### Additional context

This is related to issue #5105
Repository: pytorch
Issue: LayerNorm freeze processes using torch multiprocessing
Labels: module: multiprocessing,triaged

### 🐛 Describe the bug

LayerNorm operation is freezing my processes when i launch 1 or more process using torch multiprocessing. I did a trivial network only containing a layernorm and my process all freezes in the forward pass. I am on linux and i did not hve this problem on MacOS. The code is :

```
import sys, os

import torch
import torch.multiprocessing as mp




def worker(rank, model, input_action):
    """Worker function"""
    print(f"Worker {rank} received model")
    out = model(input_action)
    
#Create a model using torch layernorm
class LayerNormModel(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.layernorm = torch.nn.LayerNorm(4)
        
    def forward(self, x):
        return self.layernorm(x)


if __name__ == '__main__':
    # Set the multiprocessing start method
    #mp.set_start_method('spawn')
    num_threads = torch.get_num_threads()
    print("Number of threads:", num_threads)
    
    model = LayerNormModel()
    input_action = torch.randn(1, 2, 4)
    #Working properly
    test = model(input_action)
    
    torch.set_num_threads(5)
    num_threads = torch.get_num_threads()
    print("Number of threads:", num_threads)
    
    # Create a list of values
    values = [1, 2, 3, 4, 5]

    # Create a process for each value
    processes = []
    for i, value in enumerate(values):
        p = mp.Process(target=worker, args=(i, model, input_action))
        processes.append(p)
        p.start()

    # Wait for all processes to finish
    for p in processes:
        p.join()
        
    print("Done!")
```



### Versions

Versions of relevant libraries:
[pip3] numpy==1.24.3
[pip3] torch==2.0.1
[pip3] triton==2.0.0
[conda] numpy                     1.24.3                   pypi_0    pypi
[conda] torch                     2.0.1                    pypi_0    pypi
[conda] triton                    2.0.0                    pypi_0    pypi

cc @VitalyFedyunin
Repository: godot
Issue: Script edited in the script editor updates in the scene editor without saving
Labels: bug,discussion,topic:gdscript,topic:editor

### Godot version

v4.1.beta [37d1dfef9]

### System information

Godot v4.1.beta (37d1dfef9) - Fedora Linux 38 (Workstation Edition) - Vulkan (Mobile)

### Issue description

When editing a script using the script editor, the script is updated in the Inspector even without the script being saved. This means that changing exported variables could change or remove variables assigned to the node in the editor, even if the change is never saved in the script editor. When the change is undone, the values are reset to their default value, not the value they had before!

https://github.com/godotengine/godot/assets/129700584/dd8328d5-d2ef-41dc-8721-b7370941d0cb

This could be especially annoying, if a lot of nodes use the same script, and all of them get reset.

The script and scene are changed in the resource cache only, so closing the editor and reopening resets the value to the correct one, but saving the scene would persist the changes, even if the script was never saved.

I would expect the changes in the script editor to only apply to the inspector, if the script is saved. This would be consistent with the behavior of external editors.

### Steps to reproduce

1. Add a script to a node
2. Add an export variable to this script
3. Save the script
4. Change the exported variable in the Inspector
5. In the script editor, delete the exported variable (do not save)
6. Wait a few seconds
7. The exported variable disappears in the Inspector (?! I would have expected no changes until the script is saved)
8. Undo the change in the script editor
9. The exported variable appears in the Inspector, set to its default value (?! I would have expected the original values to be restored at least)

### Minimal reproduction project

[test-project-2.zip](https://github.com/godotengine/godot/files/11715918/test-project-2.zip)
Repository: go
Issue: os: GOOS=wasip1 returns non-IsNotExist errors on non-existent files
Labels: NeedsInvestigation,arch-wasm

I'm trying to run some code with to-be Go 1.21's wasip1/wasm support.

We have some code:

```go
	cfgPath := filepath.Join(s.rootPath, "tailscaled.log.conf")
	lpc, err := logpolicy.ConfigFromFile(cfgPath)
	switch {
	case os.IsNotExist(err):
		lpc = logpolicy.NewConfig(logtail.CollectionNode)
		if err := lpc.Save(cfgPath); err != nil {
			return fmt.Errorf("logpolicy.Config.Save for %v: %w", cfgPath, err)
		}
	case err != nil:
		return fmt.Errorf("logpolicy.LoadConfig for %v: %w", cfgPath, err)
	}
```

And instead of hitting that `os.IsNotExist` path, it's going into the `case err != nil` path with:

```
$ wasmtime run --env=HOME=$HOME --dir=. ~/go/bin/wasip1_wasm/tshello
2023/06/12 00:28:09 tsnet: logpolicy.LoadConfig for tailscaled.log.conf: open tailscaled.log.conf: Bad file number
```

It's possible I'm holding `wasmtime` wrong, but "Bad file number" doesn't tell me much. Is that a not found error or a sandbox violation error, or ...?

/cc @johanbrandhorst
Repository: terminal
Issue: Mouse Mode gets stuck in certain circumstances
Labels: Area-Input,Area-VT,Issue-Bug,Product-Terminal,Priority-3

### Windows Terminal version

1.17.11461

### Windows build number

10.0.19045.2965

### Other Software

Far Manager, version 3.0.6163.0 x64

### Steps to reproduce

Microsoft.WindowsTerminal_1.17.11461.0_x64.zip
or
Microsoft.WindowsTerminalPreview_1.18.1462.0_x64.zip
in portable mode, uac off, under Admin

I use WT with FAR 100% times

when start some EXE's file under far manager (twiced click L-button mouse - only this!)
cursor board by Far Manager starting moving with mouse movement
the effect does not stop until you click L-button mouse.


### Expected Behavior

Cursor board by Far Manager not move with mouse movement

### Actual Behavior

100% reproduced on some EXE's ( with 90% console app?)

for examples:

Windows\System32\

with effects:

console app:
certutil.exe
change.exe

gui app:
appverif.exe
certreq.exe

console app without effects:
ARP.EXE
at.exe


i also check 8year ago Far Manager Far30b3900.x86
trouble still present too

PS:
i use windows 27 year
far manager 25 year
conemu 12 year

but never see this effects earlier...
WT I try use ~week ( why not early? because i dont like UWP apps)
Repository: puppeteer
Issue: [Feature]: disable inject sourceURL
Labels: feature

### Feature description

I hope can disable inject sourceURL comment when run some CDP method like `Runtime.evaluate` `Runtime.callFunctionOn`  `Page.addScriptToEvaluateOnNewDocument` and so on.
Repository: next.js
Issue: OpenGraph images are not statically generated for dynamic routes
Labels: Metadata,linear: next

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
      Platform: linux
      Arch: x64
      Version: #1 ZEN SMP PREEMPT_DYNAMIC Sun, 04 Jun 2023 11:52:10 +0000
    Binaries:
      Node: 18.16.0
      npm: 9.5.1
      Yarn: 1.22.10
      pnpm: 8.6.1
    Relevant packages:
      next: 13.4.5-canary.12
      eslint-config-next: 13.4.5
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.3
```


### Which area(s) of Next.js are affected? (leave empty if unsure)

App directory (appDir: true), Metadata (metadata, generateMetadata, next/head, head.js), Static HTML Export (output: "export")

### Link to the code that reproduces this issue or a replay of the bug

https://codesandbox.io/p/sandbox/reverent-feather-2sycr6

### To Reproduce

- Set `output: "export"` in next.config.js
- Create dynamic path (a path with param, e.g. `app/[id]/page.tsx`) which has `generateStaticParams`
- Create `opengraph-image.tsx` for that path
- Don't set `runtime` (which defaults to `'auto'`/`'nodejs'`)
- Build Next.js (`npm run build`)


### Describe the Bug

The `opengraph-image` is not generated for dynamic paths when statically rendering.

In the output, it's marked as `λ  (Server)  server-side renders at runtime` for the dynamic paths (e.g. `/[id]/opengraph-image`), without listing each generated path (which `/[id]` would have, e.g. `/1`, `/2`,).

I can confirm it generates a `.html` for each path in `out`, but no `opengraph-image` is preset.

(It does work if it has no parameter in the path)

Example build output:
![image](https://github.com/vercel/next.js/assets/2672503/78130742-7fe1-46c3-8bdc-fcd9cefcab2b)


### Expected Behavior

A `opengraph-image` would be generated for each path returned by `generateStaticParams`, same as the `page.tsx` file would.

### Which browser are you using? (if relevant)

_No response_

### How are you deploying your application? (if relevant)

Statically rendered

<sub>[NEXT-1458](https://linear.app/vercel/issue/NEXT-1458/opengraph-images-are-not-statically-generated-for-dynamic-routes)</sub>
Repository: PowerToys
Issue: Powertoys Run Crash in windows.storage.dll
Labels: Issue-Bug,Needs-Triage,Resolution-Can't Repro,Needs-Team-Response

### Microsoft PowerToys version

0.70.1

### Installation method

PowerToys auto-update

### Running as admin

No

### Area(s) with issue?

PowerToys Run

### Steps to reproduce

Powertoys run crashes in the Program Plugin when typing `r` in the input. I have attached a log (hopefully the correct one).

I can also provide full crashdumps for the issue, however they are too big to attach to the bug. They hint to some issue related to thumbnail extraction (at least thats what the callstack for the crashing thread suggests). If you can provide me with a location to upload one of the dumps, I can do that.

[runner-log_2023-06-12.txt](https://github.com/microsoft/PowerToys/files/11720011/runner-log_2023-06-12.txt)


### ✔️ Expected Behavior

Powertoys run should not crash.

### ❌ Actual Behavior

Powertoys run crashes, and I need to restart Powertoys (via tray) to fix the issue.

### Other Software

_No response_
Repository: PowerToys
Issue: Please add Ukrainian symbolls to Quick Accent
Labels: Idea-Enhancement,Help Wanted,Product-Quick Accent

### Description of the new feature / enhancement

There are a lot of dialects like Lithuanian present(2 mil people) but Ukrainnian(40 mil people) not, please add it with symbols (і, І, ї, Ї, ґ, Ґ, є, Є ). This will be very useful for a lot of people!

### Scenario when this would be used?

Enter "ы" in Russian, press space, and choose "і" in Ukrainian. And this logic for rest symbols:  ї, Ї, ґ, Ґ, є, Є 

### Supporting information

Guys, this is a very useful feature, I was searching for it for the last 5 years, but now it's not working for a very big nation, probably because it's Kirrilyc, idk. But I am dreaming about this feature, it will help about 40 million people because half of the Ukrainians speak Ukrainian and half of Russian, but all can speak both and need to switch languages all the time. Thank you!
Repository: next.js
Issue: Draft mode not working on dev mode when i18n config settings are defined
Labels: Internationalization (i18n)

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:06:26 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8112
    Binaries:
      Node: 16.19.0
      npm: 8.19.3
      Yarn: 1.22.19
      pnpm: N/A
    Relevant packages:
      next: 13.4.4
      eslint-config-next: 13.4.4
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.3
```


### Which area(s) of Next.js are affected? (leave empty if unsure)

App directory (appDir: true)

### Link to the code that reproduces this issue or a replay of the bug

https://github.com/zarif-al/draft-issue-production/blob/main/next.config.js#L3-L8

### To Reproduce

run the demo linked with & without commenting out the i18n code

### Describe the Bug

if 

```ts
 i18n: {
  	locales: ["en"],	
  	 defaultLocale: "en",
},
```

is set, the draft mode feature stops working (the hook returns false) in dev mode

### Expected Behavior

```ts
  const { isEnabled: isDraftModeEnabled } = draftMode()
```

returns setting
```ts
draftMode().enable()
return new Response("Draft mode is enabled")
```

on one of the API endpoints

### Which browser are you using? (if relevant)

_No response_

### How are you deploying your application? (if relevant)

_No response_
Repository: rust
Issue: Bootstrap cannot remove host symlink on Windows if created from WSL2
Labels: O-windows,T-bootstrap,C-bug

If I use `./x` in WSL2 it will create a host symlink in the build directory. If I then switch to the Windows host using the same build directory I get this error:

```text
thread 'main' panicked at 'fs::remove_dir(&host) failed with The directory name is invalid. (os error 267)', lib.rs:516:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

The simplest solution here would be to detect `ERROR_DIRECTORY` (aka os error 267) and fallback to `fs::remove_file`.
Repository: angular
Issue: Providing animations in route's providers duplicates elements of component
Labels: area: animations,area: router

### Which @angular/* package(s) are the source of the bug?

animations

### Is this a regression?

No

### Description

Calling `provideAnimations()` in the providers array of a route duplicates elements in the component.

```typescript
export const routes: Routes = [
  {
    path: '',
    providers: [provideAnimations()],
    loadComponent: () => import('./animations/animations.component'),
  },
];
```

**animations.component.html**
```html
<div *ngIf="visible">Example Div</div>

<button (click)="visible = !visible">Toggle Div</button>
```

Clicking the button should toggle the div. Instead, the div is duplicated on every other click.

### Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/github/Marcarrian/angular-16-provide-animations-bug

### Please provide the exception or error you saw

_No response_

### Please provide the environment you discovered this bug in (run `ng version`)

```true
Angular CLI: 16.0.5
Node: 18.16.0
Package Manager: npm 9.5.1
OS: win32 x64

Angular: 16.0.5
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1600.5
@angular-devkit/build-angular   16.0.5
@angular-devkit/core            16.0.5
@angular-devkit/schematics      16.0.5
@angular/cdk                    16.0.4
@angular/material               16.0.4
@schematics/angular             16.0.5
rxjs                            7.8.1
typescript                      5.0.4
```


### Anything else?

Calling `provideAnimations()` in `appConfig` works as expected.
```typescript
export const appConfig: ApplicationConfig = {
  providers: [
    provideRouter(routes),
    provideAnimations(),
  ],
};
```

I am unsure whether it's a regression or not.
Repository: three.js
Issue: Depth-based fog transparency effect to blend with the page background
Labels: Suggestion

### Description

A way to seamlessly blend a scene with the page background color can be useful for cases that mix together 3D and other page content. Leaving the background blank is already possible, but in addition to this, it could be good to also have fog-like fading to the page background (whether it's a solid color or something else).

This would also add a way to match the "fog color" with the page background color in case we start applying regular fog before tone mapping. Applying fog before tone mapping which would be more physically correct, but would make it more difficult to match the fog color with the page background. Or in some cases impossible - see https://github.com/mrdoob/three.js/pull/26208#issuecomment-1581253148 .

### Solution

To support fog-like fading to the page background, we could render a depth pass in addition to the normal color pass, and then set the alpha values of the WebGL default framebuffer according to fog computed from the depth pass.

This could be implemented as an EffectComposer pass without changing any of the core library.

There are fairly significant downsides like the extra performance cost and not having control over blending between the rendered color and the background color, but these might be worthwhile tradeoffs for some use cases.

### Alternatives

Simply rendering objects as semi-transparent according to their depth wouldn't work, since we want the scene objects to be blended only with the page background, not with each other.

The use case is probably uncommon enough that it doesn't need to be supported inside the core library.

### Additional context

Reference discussion: https://github.com/mrdoob/three.js/pull/26208#issuecomment-1582678138
Repository: pytorch
Issue: The document does not emphasize hidden range in nn.MaxPool2d
Labels: needs reproduction,module: docs,triaged

### 🐛 Describe the bug


`Hidden range of padding parameter in nn.MaxPool2d`

`pad should be at most half of kernel size, but got pad=2 and kernel_size=2`

### Code

```py
import torch
from torch import nn


class lenet(nn.Module):
    def __init__(self):
        super(lenet, self).__init__()
        self.conv = nn.Conv2d(in_channels=3, out_channels=16, kernel_size=2, padding=2, stride=1)
        self.pool = nn.MaxPool2d(padding=2, kernel_size=2)

    def forward(self, x):
        # 1st block
        x = self.conv(x)
        x = self.pool(x)

        return x


if __name__ == '__main__':
    net = lenet()
```

### Versions

### Version
PyTorch version: 2.0.0
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 12.6 (arm64)
GCC version: Could not collect
Clang version: 14.0.0 (clang-1400.0.29.102)
CMake version: Could not collect
Libc version: N/A

Python version: 3.10.10 (main, Mar 21 2023, 13:41:05) [Clang 14.0.6 ] (64-bit runtime)
Python platform: macOS-12.6-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Apple M1 Pro

Versions of relevant libraries:
[pip3] numpy==1.23.5
[pip3] torch==2.0.0
[pip3] torchsummary==1.5.1
[pip3] torchvision==0.15.1
[conda] numpy                     1.23.5          py310hb93e574_0  
[conda] numpy-base                1.23.5          py310haf87e8b_0  
[conda] torch                     2.0.0                    pypi_0    pypi
[conda] torchsummary              1.5.1                    pypi_0    pypi
[conda] torchvision               0.15.1                   pypi_0    pypi



cc @svekars @carljparker