helloadhavan/github_issues huggingface dataset:
Repository: electron/electron
Pull request: build: fix python warnings "SyntaxWarning: invalid escape sequence '\w'"

Backport of #44650

See that PR for details.


Notes: none.

Changed files:
filename: build/generate_node_defines.py
patch: @@ -2,7 +2,7 @@
 import re
 import sys
 
-DEFINE_EXTRACT_REGEX = re.compile('^ *# *define (\w*)', re.MULTILINE)
+DEFINE_EXTRACT_REGEX = re.compile(r'^ *# *define (\w*)', re.MULTILINE)
 
 def main(out_dir, headers):
   defines = []

filename: script/generate-config-gypi.py
patch: @@ -6,7 +6,6 @@
 import re
 import subprocess
 import sys
-from lib.config import get_target_arch
 
 ELECTRON_DIR = os.path.abspath(os.path.join(__file__, '..', '..'))
 NODE_DIR = os.path.join(ELECTRON_DIR, '..', 'third_party', 'electron_node')
@@ -40,8 +39,8 @@ def read_electron_args():
     for line in file_in:
       if line.startswith('#'):
         continue
-      m = re.match('(\w+) = (.+)', line)
-      if m == None:
+      m = re.match(r'(\w+) = (.+)', line)
+      if m is None:
         continue
       args[m.group(1)] = m.group(2)
   return args

filename: script/zip-symbols.py
patch: @@ -5,7 +5,7 @@
 import os
 import sys
 
-from lib.config import PLATFORM, get_target_arch
+from lib.config import PLATFORM
 from lib.util import scoped_cwd, get_electron_version, make_zip, \
                      get_electron_branding, get_out_dir, execute
Repository: vercel/next.js
Pull request: Revert "[test] fix flaky test of basepath navigation"

Reverts vercel/next.js#80213
x-ref: https://github.com/vercel/next.js/actions/runs/15497907587/job/43641053388
The test was not properly fixed, still observing the navigation failing in CI, need further investigation

Changed files:
filename: test/e2e/app-dir/app-basepath/index.test.ts
patch: @@ -12,12 +12,7 @@ describe('app dir - basepath', () => {
 
   it('should successfully hard navigate from pages -> app', async () => {
     const browser = await next.browser('/base/pages-path')
-    await browser.waitForElementByCss('#to-another').click()
-    // Wait for url to change, ensure the navigation is finished,
-    // then we can assert if the element is present.
-    await retry(async () => {
-      expect(await browser.url()).toBe(`${next.url}/base/another`)
-    }, 5_000)
+    await browser.elementByCss('#to-another').click()
     await browser.waitForElementByCss('#page-2')
   })
Repository: ggml-org/llama.cpp
Pull request: mtmd : Fix 32-bit narrowing issue in export-lora and mtmd clip

### Summary
Fixes narrowing conversion errors when building on 32-bit platforms due to implicit conversion from `long long` to `size_t` in initializer lists.

Under C++11 rules, non-constant expressions in initializer lists that narrow types will cause compile errors. This affects both `export-lora.cpp` and `clip.cpp`:

```cpp
gguf_get_n_tensors(...) * ggml_tensor_overhead(); // returns long long
```
On 32-bit platforms, this cannot be implicitly converted to size_t (unsigned int) in an initializer list.
### Fix

Added static_cast<size_t> to silence narrowing warnings and ensure type safety across 32/64-bit platforms.

### Files affected
	•tools/export-lora/export-lora.cpp
	•tools/mtmd/clip.cpp

### Notes
	•This change is non-functional: it only impacts build correctness.
	•Confirmed to compile cleanly on both 32-bit and 64-bit targets using clang.

Changed files:
filename: tools/export-lora/export-lora.cpp
patch: @@ -148,7 +148,7 @@ struct lora_merge_ctx {
 
         ctx_out = gguf_init_empty();
         struct ggml_init_params params = {
-            /*.mem_size   =*/ gguf_get_n_tensors(base_model.ctx_gguf)*ggml_tensor_overhead(),
+            /*.mem_size   =*/ static_cast<size_t>(gguf_get_n_tensors(base_model.ctx_gguf)*ggml_tensor_overhead()),
             /*.mem_buffer =*/ NULL,
             /*.no_alloc   =*/ true,
         };

filename: tools/mtmd/clip.cpp
patch: @@ -2315,7 +2315,7 @@ struct clip_model_loader {
 
         // create data context
         struct ggml_init_params params = {
-            /*.mem_size =*/ (gguf_get_n_tensors(ctx_gguf.get()) + 1) * ggml_tensor_overhead(),
+            /*.mem_size =*/ static_cast<size_t>(gguf_get_n_tensors(ctx_gguf.get()) + 1) * ggml_tensor_overhead(),
             /*.mem_buffer =*/ NULL,
             /*.no_alloc =*/ true,
         };
Repository: denoland/deno
Pull request: fix(node/worker_threads): data url not encoded properly with eval

When using the `eval` option on Node's  `worker_threads` the code is passed as a `data:` URL. But we didn't encode the actual code for that, which lead to syntax errors when including characters not allowed in an URL.

Fixes a part of https://github.com/denoland/deno/issues/27167

Changed files:
filename: ext/node/polyfills/worker_threads.ts
patch: @@ -42,6 +42,7 @@ const {
   SafeWeakMap,
   SafeMap,
   TypeError,
+  encodeURIComponent,
 } = primordials;
 
 const debugWorkerThreads = false;
@@ -123,7 +124,11 @@ class NodeWorker extends EventEmitter {
       );
     }
     if (options?.eval) {
-      specifier = `data:text/javascript,${specifier}`;
+      const code = typeof specifier === "string"
+        ? encodeURIComponent(specifier)
+        // deno-lint-ignore prefer-primordials
+        : specifier.toString();
+      specifier = `data:text/javascript,${code}`;
     } else if (
       !(typeof specifier === "object" && specifier.protocol === "data:")
     ) {

filename: tests/unit_node/worker_threads_test.ts
patch: @@ -136,6 +136,25 @@ Deno.test({
   },
 });
 
+Deno.test({
+  name: "[node/worker_threads] Worker eval",
+  async fn() {
+    // Check that newlines are encoded properly
+    const worker = new workerThreads.Worker(
+      `
+      import { parentPort } from "node:worker_threads"
+      console.log("hey, foo") // comment
+      parentPort.postMessage("It works!");
+      `,
+      {
+        eval: true,
+      },
+    );
+    assertEquals((await once(worker, "message"))[0], "It works!");
+    worker.terminate();
+  },
+});
+
 Deno.test({
   name: "[node/worker_threads] worker thread with type module",
   async fn() {
Repository: nodejs/node
Pull request: src: do not run IsWindowsBatchFile on non-windows

Let's not run `IsWindowsBatchFile` on non-windows environments.

Changed files:
filename: src/process_wrap.cc
patch: @@ -200,8 +200,10 @@ class ProcessWrap : public HandleWrap {
     // batch files directly but is potentially insecure because arguments
     // are not escaped (and sometimes cannot be unambiguously escaped),
     // hence why they are rejected here.
+#ifdef _WIN32
     if (IsWindowsBatchFile(options.file))
       err = UV_EINVAL;
+#endif
 
     // options.args
     Local<Value> argv_v =

filename: src/spawn_sync.cc
patch: @@ -769,8 +769,10 @@ Maybe<int> SyncProcessRunner::ParseOptions(Local<Value> js_value) {
   // batch files directly but is potentially insecure because arguments
   // are not escaped (and sometimes cannot be unambiguously escaped),
   // hence why they are rejected here.
+#ifdef _WIN32
   if (IsWindowsBatchFile(uv_process_options_.file))
     return Just<int>(UV_EINVAL);
+#endif
 
   Local<Value> js_args =
       js_options->Get(context, env()->args_string()).ToLocalChecked();

filename: src/util-inl.h
patch: @@ -540,25 +540,21 @@ constexpr std::string_view FastStringKey::as_string_view() const {
 // Inline so the compiler can fully optimize it away on Unix platforms.
 bool IsWindowsBatchFile(const char* filename) {
 #ifdef _WIN32
-  static constexpr bool kIsWindows = true;
-#else
-  static constexpr bool kIsWindows = false;
-#endif  // _WIN32
-  if (kIsWindows) {
-    std::string file_with_extension = filename;
-    // Regex to match the last extension part after the last dot, ignoring
-    // trailing spaces and dots
-    std::regex extension_regex(R"(\.([a-zA-Z0-9]+)\s*[\.\s]*$)");
-    std::smatch match;
-    std::string extension;
-
-    if (std::regex_search(file_with_extension, match, extension_regex)) {
-      extension = ToLower(match[1].str());
-    }
-
-    return !extension.empty() && (extension == "cmd" || extension == "bat");
+  std::string file_with_extension = filename;
+  // Regex to match the last extension part after the last dot, ignoring
+  // trailing spaces and dots
+  std::regex extension_regex(R"(\.([a-zA-Z0-9]+)\s*[\.\s]*$)");
+  std::smatch match;
+  std::string extension;
+
+  if (std::regex_search(file_with_extension, match, extension_regex)) {
+    extension = ToLower(match[1].str());
   }
+
+  return !extension.empty() && (extension == "cmd" || extension == "bat");
+#else
   return false;
+#endif  // _WIN32
 }
 
 }  // namespace node
Repository: facebook/react
Pull request: test: Don't retry flushActWork if flushUntilNextPaint threw



## Summary

Fixes "ReferenceError: You are trying to access a property or method of the Jest environment after it has been torn down." in `ReactIncrementalErrorHandling-test.internal.js`

Alternatives:

1. Additional `await act(cb)` call where `cb` makes sure we can flush until next paint without throwing
    ```js
    // Ensure test isn't exited with pending work
    await act(async () => {
      root.render(<App shouldThrow={false} />);
    });
    ```
1. Use `toFlushAndThrow`
    ```diff
    -    let error;
    -    try {
    -      await act(async () => {
    -        root.render(<App shouldThrow={true} />);
    -      });
    -    } catch (e) {
    -      error = e;
    -    }
    +    root.render(<App shouldThrow={true} />);
     
    -    expect(error.message).toBe('Oops!');
    +    expect(Scheduler).toFlushAndThrow('Oops!');
         expect(numberOfThrows < 100).toBe(true);
    ```

But then it still wouldn't make sense to pass `resolve` and `reject` to the next `flushActWork`. Even if the next `flushActWork` would flush until next paint without throwing, we couldn't resolve or reject because we already did reject.
 

## How did you test this change?

- `yarn test --watch packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.internal.js` produces no more errors after the test finishes.


Changed files:
filename: packages/jest-react/src/internalAct.js
patch: @@ -128,6 +128,7 @@ function flushActWork(resolve: () => void, reject: (error: any) => void) {
       Scheduler.unstable_flushUntilNextPaint();
     } catch (error) {
       reject(error);
+      return;
     }
 
     // If Scheduler yields while there's still work, it's so that we can
Repository: electron/electron
Pull request: build: fix python warnings "SyntaxWarning: invalid escape sequence '\w'"

#### Description of Change

Fixes these warnings:

```
[3469/51023] ACTION //electron:electron_generate_node_defines(//build/toolchain/linux:clang_x64)
/home/charles/src/devdiv/src/out/Testing/../../electron/build/generate_node_defines.py:5: SyntaxWarning: invalid escape sequence '\w'
  DEFINE_EXTRACT_REGEX = re.compile('^ *# *define (\w*)', re.MULTILINE)
[4627/51023] ACTION //electron:generate_config_gypi(//build/toolchain/linux:clang_x64)
/home/charles/src/devdiv/src/out/Testing/../../electron/script/generate-config-gypi.py:43: SyntaxWarning: invalid escape sequence '\w'
  m = re.match('(\w+) = (.+)', line)
```

Also fixes three other minor warnings that were nearby: a pair of unused imports and a [pep 8 E711 warning](https://peps.python.org/pep-0008/#programming-recommendations) to use `foo is None` instead of `foo == None`

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: none.

Changed files:
filename: build/generate_node_defines.py
patch: @@ -2,7 +2,7 @@
 import re
 import sys
 
-DEFINE_EXTRACT_REGEX = re.compile('^ *# *define (\w*)', re.MULTILINE)
+DEFINE_EXTRACT_REGEX = re.compile(r'^ *# *define (\w*)', re.MULTILINE)
 
 def main(out_dir, headers):
   defines = []

filename: script/generate-config-gypi.py
patch: @@ -6,7 +6,6 @@
 import re
 import subprocess
 import sys
-from lib.config import get_target_arch
 
 ELECTRON_DIR = os.path.abspath(os.path.join(__file__, '..', '..'))
 NODE_DIR = os.path.join(ELECTRON_DIR, '..', 'third_party', 'electron_node')
@@ -40,8 +39,8 @@ def read_electron_args():
     for line in file_in:
       if line.startswith('#'):
         continue
-      m = re.match('(\w+) = (.+)', line)
-      if m == None:
+      m = re.match(r'(\w+) = (.+)', line)
+      if m is None:
         continue
       args[m.group(1)] = m.group(2)
   return args

filename: script/zip-symbols.py
patch: @@ -5,7 +5,7 @@
 import os
 import sys
 
-from lib.config import PLATFORM, get_target_arch
+from lib.config import PLATFORM
 from lib.util import scoped_cwd, get_electron_version, make_zip, \
                      get_electron_branding, get_out_dir, execute
Repository: huggingface/transformers
Pull request: Fix TypeError: 'NoneType' object is not iterable for esm (#38667)

Add post_init() calls to EsmForMaskedLM, EsmForTokenClassification and EsmForSequenceClassification.

# What does this PR do?

Adds `post_init()` calls to esm models in order to prevent the error "TypeError: 'NoneType' object is not iterable".

Fixes # 38667

## Before submitting
- [:x:  ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [:heavy_check_mark:  ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [:x: ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [:white_check_mark:  ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ :x:] Did you write any new necessary tests?


## Who can review?

@MekkCyber @Cyrilvallez since they're active in the referenced PR from the bug, or anyone familiar with the situation.


Changed files:
filename: src/transformers/models/esm/modeling_esm.py
patch: @@ -1023,6 +1023,8 @@ def __init__(self, config):
 
         self.init_weights()
 
+        self.post_init()
+
     def get_output_embeddings(self):
         return self.lm_head.decoder
 
@@ -1127,6 +1129,8 @@ def __init__(self, config):
 
         self.init_weights()
 
+        self.post_init()
+
     @auto_docstring
     def forward(
         self,
@@ -1210,6 +1214,8 @@ def __init__(self, config):
 
         self.init_weights()
 
+        self.post_init()
+
     @auto_docstring
     def forward(
         self,
Repository: facebook/react
Pull request: Remove unnecessary flowconfig ignore paths

## Summary

By removing them, the flowconfig file will be cleaner and easier to maintain.

## How did you test this change?

ci green

Changed files:
filename: scripts/flow/config/flowconfig
patch: @@ -8,12 +8,6 @@
 .*/rollup/shims/facebook-www/.*
 .*/rollup/shims/react-native/.*
 
-.*/node_modules/@snyk/.*
-.*/node_modules/y18n/.*
-.*/node_modules/chrome-devtools-frontend/.*
-.*/node_modules/devtools-timeline-model/.*
-.*/node_modules/create-react-class/.*
-.*/node_modules/react-native-web/.*
 .*/node_modules/fbjs/lib/keyMirrorRecursive.js.flow
 .*/node_modules/resolve/test/.*
 .*/__mocks__/.*
Repository: denoland/deno
Pull request: fix(outdated): allow `--latest` without `--update`

Ref #27025.

it does nothing (it's the default behavior) but it doesn't hurt to allow it

Changed files:
filename: cli/args/flags.rs
patch: @@ -2664,10 +2664,10 @@ Display outdated dependencies:
   <p(245)>deno outdated</>
   <p(245)>deno outdated --compatible</>
 
-Update dependencies:
+Update dependencies to latest semver compatible versions:
   <p(245)>deno outdated --update</>
+Update dependencies to latest versions, ignoring semver requirements:
   <p(245)>deno outdated --update --latest</>
-  <p(245)>deno outdated --update</>
 
 Filters can be used to select which packages to act on. Filters can include wildcards (*) to match multiple packages.
   <p(245)>deno outdated --update --latest \"@std/*\"</>
@@ -2703,7 +2703,6 @@ Specific version requirements to update to can be specified:
           .help(
             "Update to the latest version, regardless of semver constraints",
           )
-          .requires("update")
           .conflicts_with("compatible"),
       )
       .arg(
@@ -11687,6 +11686,14 @@ Usage: deno repl [OPTIONS] [-- [ARGS]...]\n"
           recursive: false,
         },
       ),
+      (
+        svec!["--latest"],
+        OutdatedFlags {
+          filters: svec![],
+          kind: OutdatedKind::PrintOutdated { compatible: false },
+          recursive: false,
+        },
+      ),
     ];
     for (input, expected) in cases {
       let mut args = svec!["deno", "outdated"];
Repository: nodejs/node
Pull request: doc: add suggested tsconfig for type stripping


Changed files:
filename: doc/api/typescript.md
patch: @@ -68,6 +68,21 @@ By intentionally not supporting syntaxes that require JavaScript code
 generation, and by replacing inline types with whitespace, Node.js can run
 TypeScript code without the need for source maps.
 
+Type stripping works with most versions of TypeScript
+but we recommend version 5.7 or newer with the following `tsconfig.json` settings:
+
+```json
+{
+  "compilerOptions": {
+     "target": "esnext",
+     "module": "nodenext",
+     "allowImportingTsExtensions": true,
+     "rewriteRelativeImportExtensions": true,
+     "verbatimModuleSyntax": true
+  }
+}
+```
+
 ### Determining module system
 
 Node.js supports both [CommonJS][] and [ES Modules][] syntax in TypeScript
Repository: facebook/react
Pull request: remove unguarded getRootNode call

I forgot to guard the `getRootNode` call in #26106 and it fails in IE8 and old jsdom. I consolidated the implementation a bit and removed the unguarded call

Changed files:
filename: packages/react-dom-bindings/src/client/ReactDOMFloatClient.js
patch: @@ -88,7 +88,7 @@ let lastCurrentDocument: ?Document = null;
 
 let previousDispatcher = null;
 export function prepareToRenderResources(rootContainer: Container) {
-  const rootNode = getRootNode(rootContainer);
+  const rootNode = getHoistableRoot(rootContainer);
   lastCurrentDocument = getDocumentFromRoot(rootNode);
 
   previousDispatcher = Dispatcher.current;
@@ -111,7 +111,7 @@ export type HoistableRoot = Document | ShadowRoot;
 const preloadPropsMap: Map<string, PreloadProps> = new Map();
 
 // getRootNode is missing from IE and old jsdom versions
-function getRootNode(container: Container): HoistableRoot {
+export function getHoistableRoot(container: Container): HoistableRoot {
   // $FlowFixMe[method-unbinding]
   return typeof container.getRootNode === 'function'
     ? /* $FlowFixMe[incompatible-return] Flow types this as returning a `Node`,
@@ -122,7 +122,7 @@ function getRootNode(container: Container): HoistableRoot {
 
 function getCurrentResourceRoot(): null | HoistableRoot {
   const currentContainer = getCurrentRootHostContainer();
-  return currentContainer ? getRootNode(currentContainer) : null;
+  return currentContainer ? getHoistableRoot(currentContainer) : null;
 }
 
 // Preloads are somewhat special. Even if we don't have the Document
@@ -148,11 +148,6 @@ function getDocumentFromRoot(root: HoistableRoot): Document {
   return root.ownerDocument || root;
 }
 
-export function getHoistableRoot(container: Container): HoistableRoot {
-  // Flow thinks getRootNode returns Node but we know it is actualy either a Document or ShadowRoot
-  return ((container.getRootNode(): any): Document | ShadowRoot);
-}
-
 // --------------------------------------
 //      ReactDOM.Preload
 // --------------------------------------
Repository: denoland/deno
Pull request: fix(unstable): otel context with multiple keys

`SafeMap` treats its argument as an object with a "length" and index properties, rather than a generic iterator, so every time we cloned it, it was dropping all the data.

Changed files:
filename: ext/telemetry/telemetry.ts
patch: @@ -39,7 +39,6 @@ const {
   SafeWeakMap,
   Array,
   ObjectEntries,
-  SafeMap,
   ReflectApply,
   SymbolFor,
   Error,
@@ -617,26 +616,25 @@ class SpanExporter {
 const CURRENT = new AsyncVariable();
 
 class Context {
-  #data = new SafeMap();
+  #data: Record<symbol, unknown> = { __proto__: null };
 
-  // deno-lint-ignore no-explicit-any
-  constructor(data?: Iterable<readonly [any, any]> | null | undefined) {
-    this.#data = data ? new SafeMap(data) : new SafeMap();
+  constructor(data?: Record<symbol, unknown> | null | undefined) {
+    this.#data = { __proto__: null, ...data };
   }
 
   getValue(key: symbol): unknown {
-    return this.#data.get(key);
+    return this.#data[key];
   }
 
   setValue(key: symbol, value: unknown): Context {
     const c = new Context(this.#data);
-    c.#data.set(key, value);
+    c.#data[key] = value;
     return c;
   }
 
   deleteValue(key: symbol): Context {
     const c = new Context(this.#data);
-    c.#data.delete(key);
+    delete c.#data[key];
     return c;
   }
 }

filename: tests/specs/cli/otel_basic/__test__.jsonc
patch: @@ -19,6 +19,10 @@
     {
       "args": "run -A main.ts metric.ts",
       "output": "metric.out"
+    },
+    {
+      "args": "run -A --unstable-otel context.ts",
+      "output": ""
     }
   ]
 }

filename: tests/specs/cli/otel_basic/context.ts
patch: @@ -0,0 +1,26 @@
+import { assertEquals } from "@std/assert";
+
+const { ContextManager } = Deno.telemetry;
+
+const cm = new ContextManager();
+
+const a = cm.active();
+const b = a.setValue("b", 1);
+const c = b.setValue("c", 2);
+
+const subB = c.deleteValue("b");
+const subC = subB.deleteValue("c");
+
+assertEquals(a.getValue("b"), undefined);
+assertEquals(b.getValue("b"), 1);
+assertEquals(c.getValue("b"), 1);
+
+assertEquals(a.getValue("c"), undefined);
+assertEquals(b.getValue("c"), undefined);
+assertEquals(c.getValue("c"), 2);
+
+assertEquals(subB.getValue("b"), undefined);
+assertEquals(subB.getValue("c"), 2);
+
+assertEquals(subC.getValue("b"), undefined);
+assertEquals(subC.getValue("c"), undefined);