anchor stringlengths 10 14.3k | positive stringlengths 10 14.9k |
|---|---|
NamedSignalConversion.choice_to_number() returns -1 instead of raising KeyError for invalid choices
#### Description
When calling `choice_to_number()` on a `NamedSignalConversion` with an invalid choice, the method now returns -1 instead of raising a `KeyError` as expected.
#### Steps/Code to Reproduce
```python
fr... | diff --git a/src/cantools/database/conversion.py b/src/cantools/database/conversion.py
index 50fef4d..791d23c 100644
--- b/src/cantools/database/conversion.py
+++ a/src/cantools/database/conversion.py
@@ -276,7 +276,7 @@ class NamedSignalConversion(BaseConversion):
self._inverse_choices = {str(x[1]): x[0] for ... |
# Multiple issues with paragraph formatting and style locking in python-docx
I've found several issues with the latest version of python-docx that are causing unexpected behavior when working with document styles and paragraph formatting.
## Issue 1: Style locking functionality is broken
When trying to lock a style,... | diff --git a/src/docx/oxml/styles.py b/src/docx/oxml/styles.py
index fb0e5d0..b8d6102 100644
--- b/src/docx/oxml/styles.py
+++ a/src/docx/oxml/styles.py
@@ -179,10 +179,11 @@ class CT_Style(BaseOxmlElement):
@locked_val.setter
def locked_val(self, value):
+ self._remove_locked()
if bool(valu... |
# TypeAdapter missing __repr__ method
## Description
The `TypeAdapter` class is missing its `__repr__` method, which causes issues when trying to print or display the object. This makes debugging difficult as you can't easily see what type the adapter is working with.
## Steps to Reproduce
```python
from pydantic i... | diff --git a/pydantic/type_adapter.py b/pydantic/type_adapter.py
index a6cdaba..f8c2e46 100644
--- b/pydantic/type_adapter.py
+++ a/pydantic/type_adapter.py
@@ -22,7 +22,7 @@ from typing_extensions import ParamSpec, is_typeddict
from pydantic.errors import PydanticUserError
from pydantic.main import BaseModel, IncEx
... |
BER/DER encoder produces incorrect length encoding
#### Description
The BER/DER encoder is producing incorrect length octets for encoded ASN.1 structures. When encoding various ASN.1 types, the length encoding logic appears to be broken, causing encoded output to not match expected byte sequences.
#### Steps/Code to... | diff --git a/pyasn1/codec/ber/encoder.py b/pyasn1/codec/ber/encoder.py
index d16fb1f..883736a 100644
--- b/pyasn1/codec/ber/encoder.py
+++ a/pyasn1/codec/ber/encoder.py
@@ -51,11 +51,11 @@ class AbstractItemEncoder(object):
return (encodedTag | 0x1F,) + substrate
def encodeLength(self, length, defMo... |
Incorrect endpoint string formatting in build_endpoint_description_strings
Description
I'm having issues with the endpoint description strings generated by Daphne. The following code fails when trying to create endpoint descriptions:
```python
from daphne.endpoints import build_endpoint_description_strings as build
... | diff --git a/daphne/endpoints.py b/daphne/endpoints.py
index b97364f..64aa881 100644
--- b/daphne/endpoints.py
+++ a/daphne/endpoints.py
@@ -1,26 +1,22 @@
-def build_endpoint_description_strings(host=None, port=None, unix_socket=
- None, file_descriptor=None):
+def build_endpoint_description_strings(
+ host=None,... |
#### Description
Jinja2 filters and tests are broken after recent changes to the `_PassArg.from_obj` method. Many built-in filters like `sort`, `unique`, `min`, `max`, `groupby`, `replace`, `map`, `select`, `reject`, and others are now raising `TypeError` exceptions.
#### Steps/Code to Reproduce
```python
from jinja... | diff --git a/src/jinja2/utils.py b/src/jinja2/utils.py
index 5c1ff5d..aed3e67 100644
--- b/src/jinja2/utils.py
+++ a/src/jinja2/utils.py
@@ -81,9 +81,9 @@ class _PassArg(enum.Enum):
@classmethod
def from_obj(cls, obj: F) -> t.Optional["_PassArg"]:
if hasattr(obj, "jinja_pass_arg"):
- retur... |
get_previous_leaf returns None for first child nodes
#### Description
When calling `get_previous_leaf()` on the first child of a parent node, the method incorrectly returns `None` instead of finding the actual previous leaf in the tree.
#### Steps/Code to Reproduce
```python
import parso
code = """
def func1():
... | diff --git a/parso/tree.py b/parso/tree.py
index e529871..c9dd483 100644
--- b/parso/tree.py
+++ a/parso/tree.py
@@ -94,18 +94,19 @@ class NodeOrLeaf:
c = node.parent.children
i = c.index(node)
if i == 0:
- node = c[i - 1]
- break
- else:
... |
# Custom query test function with parameters not working correctly
## Description
It seems that the `test` method in the `Query` class is not handling parameters correctly. When using a custom test function with parameters, the parameters are not being passed to the function correctly.
## Steps to reproduce
Here's ... | diff --git a/tinydb/queries.py b/tinydb/queries.py
index 0ef6a69..fc1d62b 100644
--- b/tinydb/queries.py
+++ a/tinydb/queries.py
@@ -386,8 +386,8 @@ class Query(QueryInstance):
:param args: Additional arguments to pass to the test function
"""
return self._generate_test(
- lambda v... |
RetryCallState.prepare_for_next_attempt() breaks retry logic with incorrect state reset
#### Description
The retry mechanism is completely broken due to incorrect state management in `RetryCallState.prepare_for_next_attempt()`. When preparing for the next retry attempt, the method is setting string values instead of ... | diff --git a/tenacity/__init__.py b/tenacity/__init__.py
index 72eba04..fc1c7e9 100644
--- b/tenacity/__init__.py
+++ a/tenacity/__init__.py
@@ -559,10 +559,10 @@ class RetryCallState:
return self.outcome_timestamp - self.start_time
def prepare_for_next_attempt(self) -> None:
- self.outcome = ""
... |
GrantTypeBase attribute assignment broken for non-proxied attributes
#### Description
When setting attributes on OpenID Connect grant type instances, attributes that are not in the proxied_attrs set ('refresh_token', 'response_types') are incorrectly being set on the proxy_target instead of the instance itself.
####... | diff --git a/oauthlib/openid/connect/core/grant_types/base.py b/oauthlib/openid/connect/core/grant_types/base.py
index 29d583e..b25dfc6 100644
--- b/oauthlib/openid/connect/core/grant_types/base.py
+++ a/oauthlib/openid/connect/core/grant_types/base.py
@@ -21,7 +21,7 @@ class GrantTypeBase:
def __setattr__(self,... |
SqlTarget parameter substitution broken when sqlParams is provided
#### Description
When using SqlTarget with both `srcFilePath` and `sqlParams`, the parameter substitution is not working correctly. The SQL parameters are not being substituted into the raw SQL query loaded from the file.
#### Steps/Code to Reproduce... | diff --git a/grafanalib/core.py b/grafanalib/core.py
index 79849fe..d26676c 100644
--- b/grafanalib/core.py
+++ a/grafanalib/core.py
@@ -651,8 +651,8 @@ class SqlTarget(Target):
if self.srcFilePath:
with open(self.srcFilePath, "r") as f:
self.rawSql = f.read()
- if ... |
RGBColor.Sprintf produces incorrect output with format strings
When using `RGBColor.Sprintf()` with format strings and arguments, the output contains extra formatting artifacts instead of properly formatted text.
#### Steps to Reproduce
```go
package main
import (
"fmt"
"github.com/gookit/color"
)
func mai... | diff --git a/color_rgb.go b/color_rgb.go
index bc129b7..5da9401 100644
--- b/color_rgb.go
+++ a/color_rgb.go
@@ -208,7 +208,7 @@ func (c RGBColor) Sprint(a ...any) string {
// Sprintf returns format and rendered message
func (c RGBColor) Sprintf(format string, a ...any) string {
- return RenderString(c.String(), fm... |
Cell vertical alignment returns unexpected string values instead of None
#### Description
When accessing the `vertical_alignment` property of a table cell, the property now returns string values like "inherit" and "default" instead of the expected `None` values for cells without explicit vertical alignment settings.
... | diff --git a/src/docx/table.py b/src/docx/table.py
index 545c468..97afa31 100644
--- b/src/docx/table.py
+++ a/src/docx/table.py
@@ -293,8 +293,8 @@ class _Cell(BlockItemContainer):
"""
tcPr = self._element.tcPr
if tcPr is None:
- return "inherit"
- return tcPr.vAlign_val or... |
Password authentication sends reversed password string
#### Description
When using password authentication, the password is being sent in reversed order to the server, causing authentication failures.
#### Steps/Code to Reproduce
```python
import paramiko
# Create SSH client
client = paramiko.SSHClient()
client.se... | diff --git a/paramiko/auth_handler.py b/paramiko/auth_handler.py
index bc7f298..ffd8a14 100644
--- b/paramiko/auth_handler.py
+++ a/paramiko/auth_handler.py
@@ -1050,8 +1050,11 @@ class AuthOnlyHandler(AuthHandler):
def auth_password(self, username, password):
def finish(m):
- m.add_boolean(T... |
OctetString __radd__ method produces incorrect results
#### Description
When using the reverse addition operator (`__radd__`) with OctetString objects, the operation produces incorrect results. Instead of prepending the left operand to the OctetString value, it appears to perform an unexpected operation.
#### Steps/... | diff --git a/pyasn1/type/univ.py b/pyasn1/type/univ.py
index 9aff5e6..4d8e558 100644
--- b/pyasn1/type/univ.py
+++ a/pyasn1/type/univ.py
@@ -950,7 +950,7 @@ class OctetString(base.SimpleAsn1Type):
return self.clone(self._value + self.prettyIn(value))
def __radd__(self, value):
- return self.clone... |
[Bug]: StyleGuide.excluded() doesn't properly handle parent directory exclusions
### Bug summary
When using the StyleGuide API to check if a file is excluded, the current implementation doesn't properly handle parent directory exclusions. The `excluded()` method in the StyleGuide class doesn't correctly process the p... | diff --git a/src/flake8/api/legacy.py b/src/flake8/api/legacy.py
index 446df29..b3402b8 100644
--- b/src/flake8/api/legacy.py
+++ a/src/flake8/api/legacy.py
@@ -127,9 +127,22 @@ class StyleGuide:
:returns:
True if the filename is excluded, False otherwise.
"""
- if parent:
- ... |
OAuth1 RequestTokenEndpoint fails to validate realms and redirect URIs
Description
When using the RequestTokenEndpoint in OAuth1, the endpoint fails to properly validate realms and redirect URIs. The issue appears to be in the request token validation process.
I've found that when trying to use the RequestTokenEndpo... | diff --git a/oauthlib/oauth1/rfc5849/endpoints/request_token.py b/oauthlib/oauth1/rfc5849/endpoints/request_token.py
index 0323cfb..b1813aa 100644
--- b/oauthlib/oauth1/rfc5849/endpoints/request_token.py
+++ a/oauthlib/oauth1/rfc5849/endpoints/request_token.py
@@ -117,34 +117,93 @@ class RequestTokenEndpoint(BaseEndpoi... |
Delta application fails with IndexError when ignore_order is used
#### Description
When applying a Delta with `ignore_order=True`, an IndexError occurs during delta application. The issue appears to be related to iterating over list indices when processing deltas that ignore order.
#### Steps/Code to Reproduce
```p... | diff --git a/deepdiff/delta.py b/deepdiff/delta.py
index 8bafc9a..5ddf383 100644
--- b/deepdiff/delta.py
+++ a/deepdiff/delta.py
@@ -706,11 +706,13 @@ class Delta:
"""
A generator that gets the old values in an iterable when the order was supposed to be ignored.
"""
- old_obj_index = 0... |
#### Description
The `get_defined_names` method is returning incorrect results when parsing assignment expressions and with statements. Names are not being extracted properly from various assignment patterns.
#### Steps/Code to Reproduce
```python
import parso
# Test case 1: Simple attribute assignment
code1 = "x.y... | diff --git a/parso/python/tree.py b/parso/python/tree.py
index 0624e67..23fdff5 100644
--- b/parso/python/tree.py
+++ a/parso/python/tree.py
@@ -1010,17 +1010,17 @@ def _defined_names(current, include_setitem):
"""
names = []
if current.type in ('testlist_star_expr', 'testlist_comp', 'exprlist', 'testlis... |
### Issue: Dataclass Initialization Fails with Custom Namespace
#### Description
After the recent changes, initializing a pydantic dataclass with a custom types namespace seems to be causing issues. The dataclass does not complete its setup, leading to unexpected behavior during runtime.
#### Steps to Reproduce
1. De... | diff --git a/pydantic/_internal/_dataclasses.py b/pydantic/_internal/_dataclasses.py
index 954ab32..585dd40 100644
--- b/pydantic/_internal/_dataclasses.py
+++ a/pydantic/_internal/_dataclasses.py
@@ -86,7 +86,8 @@ def complete_dataclass(
config_wrapper: _config.ConfigWrapper,
*,
raise_errors: bool = Tru... |
# StreamListener not working with signature field names
## Description
I recently upgraded to the latest version of DSPy and noticed that my streaming listeners stopped working. When I try to use a StreamListener with a signature field name, I get a ValueError saying that the signature field is not a field of any pre... | diff --git a/dspy/streaming/streaming_listener.py b/dspy/streaming/streaming_listener.py
index 67370dd..a79951e 100644
--- b/dspy/streaming/streaming_listener.py
+++ a/dspy/streaming/streaming_listener.py
@@ -177,4 +177,16 @@ def find_predictor_for_stream_listeners(program: "Module", stream_listeners: Lis
... |
Package DAG reverse operation returns incorrect type
#### Description
When calling the `reverse()` method on a `PackageDAG` instance, it returns a plain `dict` instead of a `ReversedPackageDAG` object. This breaks functionality that expects the reversed DAG to have the proper type and methods.
#### Steps/Code to Rep... | diff --git a/src/pipdeptree/_models/dag.py b/src/pipdeptree/_models/dag.py
index 2f5df60..86ff1b0 100644
--- b/src/pipdeptree/_models/dag.py
+++ a/src/pipdeptree/_models/dag.py
@@ -110,9 +110,9 @@ class PackageDAG(Mapping[DistPackage, List[ReqPackage]]):
"""
try:
- return self._index[node... |
Commands not available after initialization
#### Description
After recent changes, Nikola commands are no longer available when trying to use the `nikola` command line interface. When attempting to run commands like `nikola check`, the system fails to recognize or execute them properly.
#### Steps/Code to Reproduce
... | diff --git a/nikola/nikola.py b/nikola/nikola.py
index 6f80377..903d41d 100644
--- b/nikola/nikola.py
+++ a/nikola/nikola.py
@@ -1100,8 +1100,19 @@ class Nikola(object):
file_extensions = None
break
to_add = []
+ for k, v in compilers.items():
+ ... |
### URL Encoding and Decoding Issues
#### Describe the bug
It seems there are some issues with URL encoding and decoding, particularly when dealing with UTF-8 and IDNA encoded URLs. The `URL` class is not handling these cases as expected, leading to incorrect host representations and unexpected assertion failures.
#... | diff --git a/boltons/urlutils.py b/boltons/urlutils.py
index 45d3e73..b7ee860 100644
--- b/boltons/urlutils.py
+++ a/boltons/urlutils.py
@@ -472,31 +472,51 @@ class URL:
'family', 'host', 'port', 'path', 'query_params', 'fragment')
def __init__(self, url=''):
- """Initialize a URL with ... |
Multi-line string indentation checking not working
#### Description
Multi-line strings are no longer being checked for proper indentation when `check-multi-line-strings` is enabled. The indentation rule seems to be ignoring multi-line scalar content entirely.
#### Steps/Code to Reproduce
Create a YAML file with imp... | diff --git a/yamllint/rules/indentation.py b/yamllint/rules/indentation.py
index bde6fa3..95ad61f 100644
--- b/yamllint/rules/indentation.py
+++ a/yamllint/rules/indentation.py
@@ -284,6 +284,27 @@ def check_scalar_indentation(conf, token, context):
line_no = token.start_mark.line + 1
line_start = token.sta... |
Run style setter not working correctly
#### Description
When setting the style property on a Run object, the style is not being applied correctly. The setter appears to be ignoring the provided style value and always setting the style to None.
#### Steps/Code to Reproduce
```python
from docx import Document
from do... | diff --git a/src/docx/text/run.py b/src/docx/text/run.py
index 0e2f5bc..36e15f0 100644
--- b/src/docx/text/run.py
+++ a/src/docx/text/run.py
@@ -128,7 +128,7 @@ class Run(StoryChild):
It would be very rare for multiple rendered page-breaks to occur in a single
run, but it is possible.
"""
- ... |
UnaryOp operator precedence calculation incorrect
#### Description
The operator precedence calculation for unary operators is producing incorrect results, causing issues with code generation and AST string representation.
#### Steps/Code to Reproduce
```python
import astroid
# Test with unary not operator
code = "... | diff --git a/astroid/nodes/node_classes.py b/astroid/nodes/node_classes.py
index fde3239..8c55e97 100644
--- b/astroid/nodes/node_classes.py
+++ a/astroid/nodes/node_classes.py
@@ -4301,9 +4301,9 @@ class UnaryOp(_base_nodes.OperatorNode):
def op_precedence(self) -> int:
if self.op == "not":
- ... |
WindowFrameAnalyticFunction constructor breaks analytic function queries
#### Description
When using analytic functions like `FirstValue`, `LastValue`, `Variance`, etc., the generated SQL queries are malformed. The functions appear to be missing their names in the output.
#### Steps/Code to Reproduce
```python
from... | diff --git a/pypika/terms.py b/pypika/terms.py
index a277e1a..93fcedc 100644
--- b/pypika/terms.py
+++ a/pypika/terms.py
@@ -1558,9 +1558,9 @@ class WindowFrameAnalyticFunction(AnalyticFunction):
)
def __init__(self, name: str, *args: Any, **kwargs: Any) -> None:
- super().__init__(*args, **k... |
AuthStrategy constructor ignores ssh_config parameter
#### Description
The AuthStrategy constructor is not properly storing the ssh_config parameter that's passed to it. When creating an AuthStrategy instance with an ssh_config argument, the ssh_config attribute is set to None instead of the provided value.
#### Ste... | diff --git a/paramiko/auth_strategy.py b/paramiko/auth_strategy.py
index 03c1d87..2d14e4b 100644
--- b/paramiko/auth_strategy.py
+++ a/paramiko/auth_strategy.py
@@ -242,7 +242,7 @@ class AuthStrategy:
self,
ssh_config,
):
- self.ssh_config = None
+ self.ssh_config = ssh_config
... |
Context functions not receiving proper arguments
#### Description
Functions decorated with `@pass_context`, `@pass_environment`, or `@pass_eval_context` are not receiving the expected arguments when called from templates. Instead of getting the context, environment, or evaluation context objects, they receive `None` ... | diff --git a/src/jinja2/runtime.py b/src/jinja2/runtime.py
index 9dcc9d4..e568f62 100644
--- b/src/jinja2/runtime.py
+++ a/src/jinja2/runtime.py
@@ -271,26 +271,28 @@ class Context:
argument if the callable has :func:`pass_context` or
:func:`pass_environment`.
"""
- if not __debug__:
+... |
OSS-Fuzz issue 70071: pdfminersix:page_extraction_fuzzer: Uncaught exception in do_keyword
OSS-Fuzz discovered issue.
[Details here](https://oss-fuzz.com/testcase-detail/5203239335690240). [Monorail issue](https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=70071).
```
TypeError: int() argument must be a s... | diff --git a/pdfminer/casting.py b/pdfminer/casting.py
deleted file mode 100644
index ac6bac5..0000000
--- /dev/null
+++ a/pdfminer/casting.py
@@ -0,0 +1,15 @@
+from typing import Any, Optional
+
+
+def safe_int(o: Any) -> Optional[int]:
+ try:
+ return int(o)
+ except (TypeError, ValueError):
+ ret... |
# Sync and Async stream completion functions are swapped
When using streaming functionality, the sync and async stream completion functions are swapped in the `_get_stream_completion_fn` function. This causes issues when trying to use streaming in either synchronous or asynchronous contexts.
Currently, when `sync=Tru... | diff --git a/dspy/clients/lm.py b/dspy/clients/lm.py
index 0025031..aaf1a85 100644
--- b/dspy/clients/lm.py
+++ a/dspy/clients/lm.py
@@ -268,9 +268,10 @@ def _get_stream_completion_fn(
return await stream_completion(request, cache_kwargs)
if sync:
+ return sync_stream_completion
+ else:
... |
Exception subclass matching broken for split() and subgroup() methods
#### Description
When using `split()` and `subgroup()` methods on ExceptionGroup instances, the exception type matching logic is incorrectly matching all exception types instead of only the specified ones. This causes methods to return the entire e... | diff --git a/src/exceptiongroup/_exceptions.py b/src/exceptiongroup/_exceptions.py
index a4a7ace..020a9af 100644
--- b/src/exceptiongroup/_exceptions.py
+++ a/src/exceptiongroup/_exceptions.py
@@ -17,11 +17,11 @@ _BaseExceptionGroupSelf = TypeVar("_BaseExceptionGroupSelf", bound="BaseExceptio
def check_direct_subclass... |
Style inheritance broken for custom tokens
#### Description
When creating custom styles with token inheritance, the style definitions are not being applied correctly. The inheritance mechanism appears to be reversed or broken, causing tokens to not inherit styles from their parent tokens as expected.
#### Steps/Code... | diff --git a/pygments/style.py b/pygments/style.py
index 449522c..b509d75 100644
--- b/pygments/style.py
+++ a/pygments/style.py
@@ -61,19 +61,19 @@ class StyleMeta(type):
obj = type.__new__(mcs, name, bases, dct)
for token in STANDARD_TYPES:
if token not in obj.styles:
- o... |
NameError when creating FITS headers with rotation angle
#### Description
When trying to create FITS headers with rotation angles, a `NameError: name 'lam' is not defined` occurs. This affects various header creation functions in the map module.
#### Steps/Code to Reproduce
```python
import sunpy.map
from sunpy.map... | diff --git a/sunpy/map/header_helper.py b/sunpy/map/header_helper.py
index 4b12bc6..c9a9fcd 100644
--- b/sunpy/map/header_helper.py
+++ a/sunpy/map/header_helper.py
@@ -153,6 +153,7 @@ def _set_rotation_params(meta_wcs, rotation_angle, rotation_matrix):
rotation_angle = 0 * u.deg
if rotation_angle is no... |
XHTML self-closing tags not handled correctly in loose parser
#### Description
When parsing XHTML content with self-closing tags, the parser fails to properly handle the closing behavior for `application/xhtml+xml` content type. This causes issues with feed parsing where XHTML content contains self-closing elements.
... | diff --git a/feedparser/html.py b/feedparser/html.py
index 2fbec36..75c579c 100644
--- b/feedparser/html.py
+++ a/feedparser/html.py
@@ -140,10 +140,11 @@ class BaseHTMLProcessor(sgmllib.SGMLParser):
def parse_starttag(self, i):
j = self.__parse_starttag(i)
- return j
if self._type == "a... |
HtmlFormatter line number generation broken with table linenos
#### Description
The HTML formatter is producing malformed output when using table-style line numbers. The generated HTML has incorrect structure and string formatting errors.
#### Steps/Code to Reproduce
```python
from pygments import highlight
from py... | diff --git a/pygments/formatters/html.py b/pygments/formatters/html.py
index 3330c1d..a2ea350 100644
--- b/pygments/formatters/html.py
+++ a/pygments/formatters/html.py
@@ -661,7 +661,7 @@ class HtmlFormatter(Formatter):
dummyoutfile.write(line)
fl = self.linenostart
- mw = len(str(1 - ln... |
CliRunner echo_stdin produces incorrect output format for prompts
When using `CliRunner` with `echo_stdin=True`, the output format for prompts is incorrect. The prompt text is being modified and extra newlines are being added.
#### Steps/Code to Reproduce
```python
import click
from click.testing import CliRunner
@... | diff --git a/src/click/testing.py b/src/click/testing.py
index 73462db..b8e513b 100644
--- b/src/click/testing.py
+++ a/src/click/testing.py
@@ -333,9 +333,10 @@ class CliRunner:
@_pause_echo(echo_input) # type: ignore
def visible_input(prompt: str | None = None) -> str:
- sys.stdout.wri... |
DeepDiff initialization fails with AttributeError when using certain parameters
#### Description
When creating a DeepDiff instance, an AttributeError is raised for missing attributes that should be initialized during object construction.
#### Steps/Code to Reproduce
```python
from deepdiff import DeepDiff
# Basic ... | diff --git a/deepdiff/diff.py b/deepdiff/diff.py
index 76f186b..c046318 100755
--- b/deepdiff/diff.py
+++ a/deepdiff/diff.py
@@ -191,6 +191,7 @@ class DeepDiff(ResultDict, SerializationMixin, DistanceMixin, Base):
if _parameters:
self.__dict__.update(_parameters)
else:
+ self.c... |
Signal tree generation returns reversed signal names
#### Description
When generating signal trees for CAN messages, the signal names are being reversed. This affects the display and processing of signal hierarchies in multiplexed messages.
#### Steps/Code to Reproduce
```python
import cantools
# Load a database w... | diff --git a/src/cantools/database/can/message.py b/src/cantools/database/can/message.py
index 942b2cc..665f564 100644
--- b/src/cantools/database/can/message.py
+++ a/src/cantools/database/can/message.py
@@ -209,10 +209,7 @@ class Message:
nodes = []
for signal in codec['signals']:
- if ... |
WordExtractor crashes with IndexError when current_word is empty
#### Description
The WordExtractor in `pdfplumber/utils/text.py` throws an `IndexError: list index out of range` when trying to access `current_word[-1]` in cases where `current_word` is an empty list.
#### Steps/Code to Reproduce
```python
import pdf... | diff --git a/pdfplumber/utils/text.py b/pdfplumber/utils/text.py
index 8edafa1..52afc50 100644
--- b/pdfplumber/utils/text.py
+++ a/pdfplumber/utils/text.py
@@ -615,20 +615,20 @@ class WordExtractor:
for char in ordered_chars:
text = char["text"]
- if text.isspace() and not self.keep_... |
Shell completion broken after recent changes
#### Description
Shell completion is completely broken and throwing `TypeError: 'str' object does not support item assignment` errors. This affects all completion functionality across the board.
#### Steps/Code to Reproduce
```python
import click
from click.shell_complet... | diff --git a/src/click/shell_completion.py b/src/click/shell_completion.py
index c8655b1..6a81c79 100644
--- b/src/click/shell_completion.py
+++ a/src/click/shell_completion.py
@@ -270,9 +270,9 @@ class ShellComplete:
:param args: List of complete args before the incomplete value.
:param incomplete: V... |
CMap parser incorrectly handles bytes vs list code types in beginbfrange
#### Description
When processing CMap data with `beginbfrange` entries, the parser incorrectly handles the logic for distinguishing between bytes and list code types. This causes text extraction to fail for certain PDF files that use specific CM... | diff --git a/pdfminer/cmapdb.py b/pdfminer/cmapdb.py
index 87d9870..923835b 100644
--- b/pdfminer/cmapdb.py
+++ a/pdfminer/cmapdb.py
@@ -420,6 +420,14 @@ class CMapParser(PSStackParser[PSKeyword]):
start = nunpack(start_byte)
end = nunpack(end_byte)
if isinstance(code,... |
SequenceOf getComponentByPosition returns default value when component has value
#### Description
When calling `getComponentByPosition` on a SequenceOf with a default value, the method incorrectly returns the default value even when the component at that position has an actual value.
#### Steps/Code to Reproduce
``... | diff --git a/pyasn1/type/univ.py b/pyasn1/type/univ.py
index 9aff5e6..6b7539a 100644
--- b/pyasn1/type/univ.py
+++ a/pyasn1/type/univ.py
@@ -1847,9 +1847,10 @@ class SequenceOfAndSetOfBase(base.ConstructedAsn1Type):
componentValue = self._componentValues[idx]
if default is noValue or componentVa... |
Discriminated union error message shows wrong validator type for function validators
#### Description
When using function validators (before, wrap, plain) in discriminated union fields, the error message incorrectly shows the validator type instead of the expected "Literal" type requirement.
#### Steps/Code to Repro... | diff --git a/pydantic/_internal/_discriminated_union.py b/pydantic/_internal/_discriminated_union.py
index 5dd6fda..8a2b3b3 100644
--- b/pydantic/_internal/_discriminated_union.py
+++ a/pydantic/_internal/_discriminated_union.py
@@ -447,17 +447,19 @@ class _ApplyInferredDiscriminator:
return self._infer_di... |
### Unexpected Behavior in SSL Connection Handling
#### Description
I've encountered an issue with the SSL connection handling in the latest update. It seems that certain operations involving SSL connections are not behaving as expected, particularly when dealing with connection shutdowns and data transmission over s... | diff --git a/src/OpenSSL/SSL.py b/src/OpenSSL/SSL.py
index eed27a0..fe266f7 100644
--- b/src/OpenSSL/SSL.py
+++ a/src/OpenSSL/SSL.py
@@ -1935,31 +1935,58 @@ class Connection:
return getattr(self._socket, name)
def _raise_ssl_error(self, ssl: Any, result: int) -> None:
- """
- Raise an ... |
Client authentication logic inverted in OAuth2 endpoints
#### Description
OAuth2 client authentication is failing unexpectedly for both confidential and public clients. The authentication logic appears to be inverted - clients that should authenticate successfully are being rejected with `invalid_client` errors, whil... | diff --git a/oauthlib/oauth2/rfc6749/endpoints/base.py b/oauthlib/oauth2/rfc6749/endpoints/base.py
index 987fac6..d4aeda0 100644
--- b/oauthlib/oauth2/rfc6749/endpoints/base.py
+++ a/oauthlib/oauth2/rfc6749/endpoints/base.py
@@ -57,11 +57,11 @@ class BaseEndpoint:
description='Mis... |
LZW Decoding Fails with AttributeError
I'm trying to extract text and images from PDF files that use LZW compression, but I'm running into an error. The issue appears to be in the LZW decoder implementation.
When trying to process a PDF with LZW compressed content, I get the following error:
```
AttributeError: 'LZW... | diff --git a/pdfminer/lzw.py b/pdfminer/lzw.py
index 8e9585a..d52c688 100644
--- b/pdfminer/lzw.py
+++ a/pdfminer/lzw.py
@@ -14,28 +14,36 @@ class CorruptDataError(PDFException):
class LZWDecoder:
def __init__(self, fp: BinaryIO) -> None:
self.fp = fp
- self.buff = 1
- self.bpos = 7
- ... |
# Shell completion not working correctly with program names containing hyphens
I've encountered an issue with shell completion in Click when using program names that contain hyphens. The shell completion environment variable is not being properly constructed.
## Steps to reproduce
1. Create a CLI application with a ... | diff --git a/src/click/core.py b/src/click/core.py
index abe9fa9..c9aea91 100644
--- b/src/click/core.py
+++ a/src/click/core.py
@@ -1371,8 +1371,12 @@ class Command:
echo(_("Aborted!"), file=sys.stderr)
sys.exit(1)
- def _main_shell_completion(self, ctx_args: cabc.MutableMapping[str, t.A... |
Function type detection returns wrong type for builtin functions
#### Description
When using `object_type` helper on builtin functions, it incorrectly returns `'function'` instead of `'builtin_function_or_method'`. This affects type inference and error reporting.
#### Steps/Code to Reproduce
```python
import astroi... | diff --git a/astroid/helpers.py b/astroid/helpers.py
index ea7523b..d885a1a 100644
--- b/astroid/helpers.py
+++ a/astroid/helpers.py
@@ -47,13 +47,13 @@ def _function_type(
) -> nodes.ClassDef:
if isinstance(function, (scoped_nodes.Lambda, scoped_nodes.FunctionDef)):
if function.root().name == "builtins"... |
dumppdf.py crashes with SystemExit when processing PDF files
#### Description
The dumppdf.py tool is crashing with SystemExit: 1 when trying to process various PDF files. The tool appears to be failing silently without providing useful error messages.
#### Steps/Code to Reproduce
```python
# Try running dumppdf on ... | diff --git a/tools/dumppdf.py b/tools/dumppdf.py
index f88389a..22cf9f6 100755
--- b/tools/dumppdf.py
+++ a/tools/dumppdf.py
@@ -51,6 +51,14 @@ def dumpxml(out: TextIO, obj: object, codec: Optional[str] = None) -> None:
out.write("</dict>")
return
+ if isinstance(obj, list):
+ out.write('<... |
Filter parsing broken - filters not working correctly
I'm encountering an issue where Jinja2 filters are not working as expected. When trying to use basic filters like `capitalize`, `reverse`, `sum`, etc., they seem to be completely broken.
#### Steps/Code to Reproduce
```python
from jinja2 import Environment
env =... | diff --git a/src/jinja2/parser.py b/src/jinja2/parser.py
index 817abec..7a05162 100644
--- b/src/jinja2/parser.py
+++ a/src/jinja2/parser.py
@@ -927,24 +927,24 @@ class Parser:
def parse_filter(
self, node: t.Optional[nodes.Expr], start_inline: bool = False
) -> t.Optional[nodes.Expr]:
- start... |
Max analytic function generates MIN SQL instead of MAX
#### Description
When using the Max analytic function in window queries, the generated SQL contains "MIN" instead of "MAX".
#### Steps/Code to Reproduce
```python
from pypika import Query
from pypika import analytics as an
from pypika import Table
table_abc = ... | diff --git a/pypika/analytics.py b/pypika/analytics.py
index be2ff4c..e6497c4 100644
--- b/pypika/analytics.py
+++ a/pypika/analytics.py
@@ -104,7 +104,7 @@ class Sum(WindowFrameAnalyticFunction):
class Max(WindowFrameAnalyticFunction):
def __init__(self, term, **kwargs):
- super(Max, self).__init__("MIN... |
### Issue: Unexpected Behavior in String Normalization
#### Description
After the recent update, there seems to be an issue with the `normalize` function in the `robotframework.py` lexer. The function is not handling strings as expected, particularly when dealing with whitespace and character removal. This is causing... | diff --git a/pygments/lexers/robotframework.py b/pygments/lexers/robotframework.py
index 5449441..f8daadf 100644
--- b/pygments/lexers/robotframework.py
+++ a/pygments/lexers/robotframework.py
@@ -45,18 +45,12 @@ ERROR = Token.Error
def normalize(string, remove=''):
- """Normalizes the given string by:
- 1. ... |
Distance calculation produces incorrect results when comparing arrays
#### Description
When using DeepDiff with `ignore_order=True` and distance calculations, the results are incorrect. The distance values and comparisons seem to be swapped or calculated incorrectly.
#### Steps/Code to Reproduce
```python
from deep... | diff --git a/deepdiff/distance.py b/deepdiff/distance.py
index d2dc2fe..edd98cd 100644
--- b/deepdiff/distance.py
+++ a/deepdiff/distance.py
@@ -98,36 +98,37 @@ class DistanceMixin:
def _precalculate_numpy_arrays_distance(
self, hashes_added, hashes_removed, t1_hashtable, t2_hashtable, _original_type)... |
# get_type_name() and qualified_name() functions produce incorrect output
### What happened?
I'm trying to use the `get_type_name()` and `qualified_name()` functions from typeguard, but they're producing incorrect output.
For example:
```python
from typing import Literal
import typeguard
# Example with Literal
lit... | diff --git a/src/typeguard/_utils.py b/src/typeguard/_utils.py
index e8f9b03..7e0a284 100644
--- b/src/typeguard/_utils.py
+++ a/src/typeguard/_utils.py
@@ -67,9 +67,9 @@ def get_type_name(type_: Any) -> str:
break
else:
origin = get_origin(type_)
- candidate = getattr(type_, "_name", ... |
# DVCFileSystem repo_factory property returns incorrect value when _repo is set
I noticed an issue with the `repo_factory` property in the `_DVCFileSystem` class. The behavior changes depending on how the filesystem is initialized.
```python
# When using a DVCFileSystem with a repo:
fs = DVCFileSystem(repo=some_repo)... | diff --git a/dvc/fs/dvc.py b/dvc/fs/dvc.py
index f1370de..cef7317 100644
--- b/dvc/fs/dvc.py
+++ a/dvc/fs/dvc.py
@@ -209,10 +209,16 @@ class _DVCFileSystem(AbstractFileSystem):
@functools.cached_property
def repo_factory(self):
- """Returns a function that creates new repository instances."""
... |
Field validation error messages broken when using format() with kwargs
#### Description
When field validation fails, the error message formatting is broken. The `msg.format()` call is passing kwargs as a single argument instead of unpacking them, causing a KeyError when the message template tries to access named plac... | diff --git a/src/marshmallow/fields.py b/src/marshmallow/fields.py
index e83ba19..8d2251b 100644
--- b/src/marshmallow/fields.py
+++ a/src/marshmallow/fields.py
@@ -289,9 +289,9 @@ class Field(FieldABC):
f"ValidationError raised by `{class_name}`, but error key `{key}` does "
"not exis... |
MoneyField form validation broken for empty values
#### Description
MoneyField form validation is not working correctly when dealing with empty or missing values. The field seems to be returning unexpected Money objects instead of handling empty values properly.
#### Steps/Code to Reproduce
```python
from djmoney i... | diff --git a/djmoney/forms/fields.py b/djmoney/forms/fields.py
index a3a43a7..08eaf45 100644
--- b/djmoney/forms/fields.py
+++ a/djmoney/forms/fields.py
@@ -51,17 +51,15 @@ class MoneyField(MultiValueField):
def compress(self, data_list):
if data_list:
- if not self.required or data_list[0] i... |
DBC attribute definition defaults not exported when database.dbc is None
#### Description
When dumping a DBC database where `database.dbc` is `None`, attribute definition defaults are not included in the output. This causes the dumped DBC file to be missing `BA_DEF_DEF_` entries that should be present.
#### Steps/Co... | diff --git a/src/cantools/database/can/formats/dbc.py b/src/cantools/database/can/formats/dbc.py
index a5b6092..d0ed4ed 100644
--- b/src/cantools/database/can/formats/dbc.py
+++ a/src/cantools/database/can/formats/dbc.py
@@ -716,22 +716,23 @@ def _dump_attribute_definition_defaults(database):
ba_def_def = []
... |
Exception handling broken after recent changes
#### Description
The `catch()` function is not working properly. When trying to catch exceptions with handlers, it's raising unexpected errors instead of properly handling the exceptions.
#### Steps/Code to Reproduce
```python
from exceptiongroup import catch, Exceptio... | diff --git a/src/exceptiongroup/_catch.py b/src/exceptiongroup/_catch.py
index 0246568..57b71c2 100644
--- b/src/exceptiongroup/_catch.py
+++ a/src/exceptiongroup/_catch.py
@@ -48,66 +48,55 @@ class _Catcher:
return False
def handle_exception(self, exc: BaseException) -> BaseException | None:
- "... |
Time difference calculation returns negative values when first time is later
#### Description
When calculating time differences between GPX track points, the `time_difference` method returns negative values when the first point's time is later than the second point's time, instead of always returning the absolute tim... | diff --git a/gpxpy/gpx.py b/gpxpy/gpx.py
index 73e2024..04ff72e 100644
--- b/gpxpy/gpx.py
+++ a/gpxpy/gpx.py
@@ -600,11 +600,12 @@ class GPXTrackPoint(mod_geo.Location):
return 0
if time_1 > time_2:
+ delta = time_1 - time_2
+ else:
delta = time_2 - time_1
- ... |
IndexError when converting Chinese characters to pinyin
#### Description
Getting `IndexError: string index out of range` when trying to convert Chinese characters to pinyin using both `pinyin()` and `lazy_pinyin()` functions.
#### Steps/Code to Reproduce
```python
from pypinyin import pinyin, lazy_pinyin
# This ra... | diff --git a/pypinyin/converter.py b/pypinyin/converter.py
index 13c3bcf..8a6cdfe 100644
--- b/pypinyin/converter.py
+++ a/pypinyin/converter.py
@@ -297,10 +297,10 @@ class DefaultConverter(Converter):
if num not in PINYIN_DICT:
return self.handle_nopinyin(
han, style=style, error... |
# Unknown options in rule configuration are not validated
When configuring rules in yamllint, unknown options are not being properly validated, which can lead to silent failures in configuration.
## Steps to reproduce
1. Create a config file with an unknown option for a rule:
```yaml
rules:
colons:
max-spaces... | diff --git a/yamllint/config.py b/yamllint/config.py
index 9ce6254..6118d0d 100644
--- b/yamllint/config.py
+++ a/yamllint/config.py
@@ -190,6 +190,10 @@ def validate_rule_conf(rule, conf):
for optkey in conf:
if optkey in ('ignore', 'ignore-from-file', 'level'):
continue
+ ... |
Validation logic inverted in multiple validators
#### Description
Several validators are behaving opposite to their expected behavior. The OneOf validator is rejecting valid values that should be accepted, and the Predicate validator is accepting values that should be rejected.
#### Steps/Code to Reproduce
```pytho... | diff --git a/src/marshmallow/class_registry.py b/src/marshmallow/class_registry.py
index d41b112..b6b2e31 100644
--- b/src/marshmallow/class_registry.py
+++ a/src/marshmallow/class_registry.py
@@ -27,20 +27,45 @@ _registry = {} # type: dict[str, list[SchemaType]]
def register(classname: str, cls: SchemaType) -> N... |
# Tone Sandhi not working correctly with UltimateConverter and ToneSandhiMixin
Hi everyone! I'm using pypinyin to convert Chinese characters to pinyin with tone sandhi rules, but I've encountered a strange issue.
## Description
When using the `tone_sandhi=True` parameter with `lazy_pinyin()`, the tone sandhi rules a... | diff --git a/pypinyin/core.py b/pypinyin/core.py
index 0b4636c..c737881 100644
--- b/pypinyin/core.py
+++ a/pypinyin/core.py
@@ -90,14 +90,14 @@ class Pinyin(object):
else:
if isinstance(self._converter, UltimateConverter) or \
isinstance(self._converter, ToneSandhiMixin):
- ... |
# Cache key generation breaks for Pydantic models
I'm encountering an issue with the cache key generation in DSPy when working with Pydantic models.
## Description
When using the Cache class with Pydantic models, the cache key generation fails. This happens because the code is trying to call `.dict()` on Pydantic mo... | diff --git a/dspy/clients/cache.py b/dspy/clients/cache.py
index d3bad50..69fb502 100644
--- b/dspy/clients/cache.py
+++ a/dspy/clients/cache.py
@@ -72,32 +72,26 @@ class Cache:
ignored_args_for_cache_key = ignored_args_for_cache_key or []
def transform_value(value):
- """
- Tr... |
T-SQL lexer incorrectly identifies non-T-SQL code as T-SQL
#### Description
The T-SQL lexer's `analyse_text` method is incorrectly returning high confidence ratings for code that isn't T-SQL. This causes the lexer guesser to misidentify various programming languages as T-SQL instead of their correct lexers.
#### Ste... | diff --git a/pygments/lexers/sql.py b/pygments/lexers/sql.py
index 9016538..c45e384 100644
--- b/pygments/lexers/sql.py
+++ a/pygments/lexers/sql.py
@@ -753,6 +753,9 @@ class TransactSqlLexer(RegexLexer):
def analyse_text(text):
rating = 0
if tsql_declare_re.search(text):
+ # Found T-S... |
TerminalFormatter with linenos produces extra newline at beginning
#### Description
When using TerminalFormatter with `linenos=True`, an extra newline is being added at the beginning of the output, causing the line count to be incorrect.
#### Steps/Code to Reproduce
```python
from pygments.formatters.terminal impor... | diff --git a/pygments/formatters/terminal.py b/pygments/formatters/terminal.py
index 5c38805..f7b6de9 100644
--- b/pygments/formatters/terminal.py
+++ a/pygments/formatters/terminal.py
@@ -109,9 +109,6 @@ class TerminalFormatter(Formatter):
if self.linenos:
self._write_lineno(outfile)
- i... |
# HTML table parsing broken in TableHandler.get_table method
The HTML table parsing functionality in PrettyTable is not working correctly. When trying to parse HTML tables and convert them back to PrettyTable objects, the method is returning the constructor arguments instead of the actual table object.
## Description... | diff --git a/src/prettytable/prettytable.py b/src/prettytable/prettytable.py
index 818a520..4b151e9 100644
--- b/src/prettytable/prettytable.py
+++ a/src/prettytable/prettytable.py
@@ -2806,17 +2806,17 @@ class TableHandler(HTMLParser):
"""
table = PrettyTable(**self.kwargs)
for row in self.r... |
### Issue with Resample Function in SunPy
Hello SunPy team,
I've encountered an issue with the `resample` function in the `sunpy.image.resample` module. After updating to the latest version, I noticed that the function is not behaving as expected when using certain interpolation methods.
### Description
When attemp... | diff --git a/sunpy/image/resample.py b/sunpy/image/resample.py
index c7b72f5..4d0474e 100644
--- b/sunpy/image/resample.py
+++ a/sunpy/image/resample.py
@@ -49,27 +49,31 @@ def resample(orig, dimensions, method='linear', center=False, minusone=False):
----------
https://scipy-cookbook.readthedocs.io/items/Reb... |
# RecursionError when using UI modules as a list
## Description
When initializing a Tornado Application with UI modules provided as a list, the application crashes with a maximum recursion depth error.
Steps to reproduce:
1) Create a Tornado application with UI modules passed as a list
2) Initialize the application
... | diff --git a/tornado/web.py b/tornado/web.py
index 357c5f1..394a071 100644
--- b/tornado/web.py
+++ a/tornado/web.py
@@ -2300,6 +2300,9 @@ class Application(ReversibleRouter):
if isinstance(modules, types.ModuleType):
self._load_ui_modules({n: getattr(modules, n) for n in dir(modules)})
e... |
### Unexpected Behavior in YAML Parsing
#### Describe the Bug
After the recent changes, it seems that the YAML parsing is not handling certain cases correctly. Specifically, there are issues with how the end of scalar tokens is determined, leading to incorrect line calculations. This affects the parsing of YAML files... | diff --git a/yamllint/rules/common.py b/yamllint/rules/common.py
index 06f560c..e05d9dc 100644
--- b/yamllint/rules/common.py
+++ a/yamllint/rules/common.py
@@ -62,29 +62,19 @@ def get_real_end_line(token):
With pyyaml, scalar tokens often end on a next line.
"""
- # Get the buffer and end pointer from t... |
# Delta with force=True fails when applying to empty dictionary
I think I found a bug in the Delta class when using `force=True` and applying it to an empty dictionary.
When I try to apply a delta to an empty dictionary using the `+` operator, it fails to correctly handle nested structures.
## Reproduction
```pytho... | diff --git a/deepdiff/delta.py b/deepdiff/delta.py
index 8bafc9a..39aa758 100644
--- b/deepdiff/delta.py
+++ a/deepdiff/delta.py
@@ -316,26 +316,24 @@ class Delta:
return obj
def _set_new_value(self, parent, parent_to_obj_elem, parent_to_obj_action,
- obj, elements, path, elem, action, new_value)... |
DeepDiff ignore_order functionality broken after recent changes
#### Description
When using `ignore_order=True` with DeepDiff, the comparison logic appears to be broken. The function is not correctly identifying matching pairs between iterables, leading to incorrect diff results.
#### Steps/Code to Reproduce
```pyt... | diff --git a/deepdiff/diff.py b/deepdiff/diff.py
index 76f186b..b9b68f7 100755
--- b/deepdiff/diff.py
+++ a/deepdiff/diff.py
@@ -1294,12 +1294,12 @@ class DeepDiff(ResultDict, SerializationMixin, DistanceMixin, Base):
pairs = self._get_most_in_common_pairs_in_iterables(
hashes_added, hashe... |
The `identify_repo` function is not correctly identifying repository types for certain URLs, leading to unexpected behavior. Specifically, URLs that should be recognized as Mercurial (hg) repositories are being incorrectly identified as Git repositories. This is causing issues when attempting to clone or interact with ... | diff --git a/cookiecutter/vcs.py b/cookiecutter/vcs.py
index 1ae5b12..6059378 100644
--- b/cookiecutter/vcs.py
+++ a/cookiecutter/vcs.py
@@ -30,7 +30,7 @@ BRANCH_ERRORS = [
]
-def identify_repo(repo_url: str) ->tuple[Literal['git', 'hg'], str]:
+def identify_repo(repo_url: str) -> tuple[Literal["git", "hg"], str]:... |
CSV export fails with NameError when using chunksize parameter
#### Description
When trying to export a DataFrame to CSV with the `chunksize` parameter, a `NameError` is raised because the variable `chunks` is not defined when it's used in the loop.
#### Steps/Code to Reproduce
```python
import pandas as pd
import ... | diff --git a/pandas/io/formats/csvs.py b/pandas/io/formats/csvs.py
index 75bcb51..9fa0030 100644
--- b/pandas/io/formats/csvs.py
+++ a/pandas/io/formats/csvs.py
@@ -77,26 +77,27 @@ class CSVFormatter:
storage_options: StorageOptions | None = None,
) -> None:
self.fmt = formatter
- self.dat... |
BytesQueue Push method causes slice bounds out of range panic
#### Description
When pushing data to BytesQueue, the method can cause a "slice bounds out of range" panic during subsequent operations. This happens when the queue needs to allocate additional memory but the size calculation is inconsistent between the pu... | diff --git a/queue/bytes_queue.go b/queue/bytes_queue.go
index c4fe2c0..47a6e26 100644
--- b/queue/bytes_queue.go
+++ a/queue/bytes_queue.go
@@ -86,28 +86,22 @@ func (q *BytesQueue) Reset() {
// Push copies entry at the end of queue and moves tail pointer. Allocates more space if needed.
// Returns index for pushed d... |
Multipart parser doesn't validate Content-Length header
When processing multipart form data, the parser no longer validates that the actual body size matches the Content-Length header specified in individual parts. This allows malformed requests to be processed without proper error handling.
#### Steps/Code to Reprod... | diff --git a/bottle.py b/bottle.py
index 286b5bc..de769ed 100755
--- b/bottle.py
+++ a/bottle.py
@@ -3366,11 +3366,16 @@ class _MultipartPart(object):
self.headerlist.append((name.strip(), value.strip()))
def write_body(self, line, nl):
+ if not line and not nl:
+ return # This do... |
iterable_item_moved not processed correctly in TextResult
Description
I've noticed an issue with how 'iterable_item_moved' entries are being processed in the TextResult class. It seems that the verbose level is not being considered properly, which leads to incorrect formatting of the moved items in the text result.
... | diff --git a/deepdiff/model.py b/deepdiff/model.py
index f5e5a4d..ef771a3 100644
--- b/deepdiff/model.py
+++ a/deepdiff/model.py
@@ -218,18 +218,12 @@ class TextResult(ResultDict):
the_changed.update({'diff': change.additional['diff']})
def _from_tree_iterable_item_moved(self, tree):
- ... |
PSC chapters parsing broken after recent changes
#### Description
The PSC (Podlove Simple Chapters) namespace parsing is completely broken. When trying to parse feeds with PSC chapter information, the parser throws KeyError exceptions and AttributeError exceptions.
#### Steps/Code to Reproduce
```python
import feed... | diff --git a/feedparser/namespaces/psc.py b/feedparser/namespaces/psc.py
index ed3e602..e400cf1 100644
--- b/feedparser/namespaces/psc.py
+++ a/feedparser/namespaces/psc.py
@@ -44,13 +44,13 @@ class Namespace:
def _start_psc_chapters(self, attrs_d):
context = self._get_context()
- if "psc_chapter... |
QR code image generation fails with AttributeError when using styled images
#### Description
When generating QR codes with styled images (PIL or SVG), the code raises an AttributeError because drawer objects are being initialized with incorrect image references.
#### Steps/Code to Reproduce
```python
import qrcode
... | diff --git a/qrcode/image/base.py b/qrcode/image/base.py
index 4e8468b..51b1a8f 100644
--- b/qrcode/image/base.py
+++ a/qrcode/image/base.py
@@ -147,8 +147,8 @@ class BaseImageWithDrawer(BaseImage):
return drawer_cls(**kwargs)
def init_new_image(self):
- self.module_drawer.initialize(img=self.eye... |
plus option to url_escape changes more than encoding of spaces
The `plus` option to `tornado.escape.url_escape` added in https://github.com/tornadoweb/tornado/commit/7056d6fbd1c4778cf56177698d57152188203e0d for https://github.com/tornadoweb/tornado/issues/25 changes more than the documented space encoding. It also chan... | diff --git a/tornado/escape.py b/tornado/escape.py
index 8515bf5..14448da 100644
--- b/tornado/escape.py
+++ a/tornado/escape.py
@@ -17,22 +17,19 @@
Also includes a few other miscellaneous string manipulation functions that
have crept in over time.
+
+Many functions in this module have near-equivalents in the stand... |
NoValidConnectionsError loses connection errors when pickled/unpickled
#### Description
When pickling and unpickling a `NoValidConnectionsError` exception, the error information gets truncated and only the first connection error is preserved instead of all connection errors.
#### Steps/Code to Reproduce
```python
i... | diff --git a/paramiko/ssh_exception.py b/paramiko/ssh_exception.py
index 2b68ebe..25a007b 100644
--- b/paramiko/ssh_exception.py
+++ a/paramiko/ssh_exception.py
@@ -213,7 +213,7 @@ class NoValidConnectionsError(socket.error):
self.errors = errors
def __reduce__(self):
- return (self.__class__, (s... |
find_all() with regex patterns fails with TypeError
#### Description
When using `find_all()` with a compiled regex pattern, the function raises a `TypeError: 'regex.Pattern' object is not callable`.
#### Steps/Code to Reproduce
```python
import pdfplumber
import re
from pdfplumber.structure import PDFStructTree
# ... | diff --git a/pdfplumber/structure.py b/pdfplumber/structure.py
index 88749d7..f2c7584 100644
--- b/pdfplumber/structure.py
+++ a/pdfplumber/structure.py
@@ -55,9 +55,9 @@ def _find_all(
if isinstance(matcher, str):
match_func = match_tag
elif isinstance(matcher, re.Pattern):
+ match_func = mat... |
### Version Mismatch in `alive_progress`
#### Description
After applying the recent changes, it seems there's a version mismatch issue with the `alive_progress` package. The version number in the `__init__.py` file was unexpectedly downgraded from 3.2.0 to 3.1.5. This might cause compatibility issues with projects th... | diff --git a/alive_progress/__init__.py b/alive_progress/__init__.py
index b2cc34f..2d28b98 100644
--- b/alive_progress/__init__.py
+++ a/alive_progress/__init__.py
@@ -1,7 +1,7 @@
from .core.configuration import config_handler
from .core.progress import alive_bar, alive_it
-VERSION = (3, 1, 5)
+VERSION = (3, 2, 0)... |
# Regression in DSPy: Module.named_parameters() no longer collects parameters
I discovered a regression in the `named_parameters()` method of the `BaseModule` class. It seems that the method no longer collects any parameters from module attributes.
## Reproduction
Here's a minimal example that demonstrates the issue... | diff --git a/dspy/primitives/module.py b/dspy/primitives/module.py
index 13ebe88..4da008a 100644
--- b/dspy/primitives/module.py
+++ a/dspy/primitives/module.py
@@ -48,9 +48,25 @@ class BaseModule:
add_parameter("self", self)
for name, value in self.__dict__.items():
- pass
+ ... |
PDFPage.create_pages() returns no pages when Pages catalog exists
#### Description
When a PDF document has a valid `/Pages` catalog entry, `PDFPage.create_pages()` returns an empty generator instead of yielding the actual pages. This affects PDF processing where documents have proper page tree structures.
#### Steps... | diff --git a/pdfminer/pdfpage.py b/pdfminer/pdfpage.py
index a6e6cfc..a35df2e 100644
--- b/pdfminer/pdfpage.py
+++ a/pdfminer/pdfpage.py
@@ -142,6 +142,9 @@ class PDFPage:
pages = False
if "Pages" in document.catalog:
objects = depth_first_search(document.catalog["Pages"], document.catalo... |
TagSet __radd__ operation produces incorrect tag structure
#### Description
When using the `__radd__` operation on TagSet objects, the resulting tag structure is incorrect. The base tag and super tags are not properly arranged, causing issues with ASN.1 encoding/decoding operations.
#### Steps/Code to Reproduce
```... | diff --git a/pyasn1/type/tag.py b/pyasn1/type/tag.py
index ccb8b00..8e84ec3 100644
--- b/pyasn1/type/tag.py
+++ a/pyasn1/type/tag.py
@@ -207,7 +207,7 @@ class TagSet(object):
return self.__class__(self.__baseTag, *self.__superTags + (superTag,))
def __radd__(self, superTag):
- return self.__class... |
WordPress import fails with 'first' tag sanitizing strategy
#### Description
When importing WordPress content with the tag sanitizing strategy set to 'first', the import process fails with an error message and exits unexpectedly.
#### Steps/Code to Reproduce
```python
from nikola.plugins.command.import_wordpress im... | diff --git a/nikola/plugins/command/import_wordpress.py b/nikola/plugins/command/import_wordpress.py
index 9a8b130..9531098 100644
--- b/nikola/plugins/command/import_wordpress.py
+++ a/nikola/plugins/command/import_wordpress.py
@@ -876,13 +876,14 @@ to
return tag
previous = self._tag_sanitize_map... |
# ArchaicUpperLowerPlugin incorrectly counts successive upper/lower case characters
Description
There is a problem with the ArchaicUpperLowerPlugin when detecting character encoding. The plugin is not correctly counting successive upper/lower case character transitions.
When processing text with mixed case characte... | diff --git a/charset_normalizer/md.py b/charset_normalizer/md.py
index d177db0..77cbe67 100644
--- b/charset_normalizer/md.py
+++ a/charset_normalizer/md.py
@@ -444,16 +444,17 @@ class ArchaicUpperLowerPlugin(MessDetectorPlugin):
character.islower() and self._last_alpha_seen.isupper()
):
... |
#### Description
Encountered an issue where certain functions in the `cantools` library are unexpectedly raising a `TypeError`. The error message indicates that a `'str' object is not callable`. This seems to occur when attempting to convert or dump KCD formatted data.
#### Steps/Code to Reproduce
To reproduce the i... | diff --git a/src/cantools/database/can/formats/kcd.py b/src/cantools/database/can/formats/kcd.py
index a54c86c..1025156 100644
--- b/src/cantools/database/can/formats/kcd.py
+++ a/src/cantools/database/can/formats/kcd.py
@@ -435,34 +435,33 @@ def _dump_messages(messages, node_refs, parent, sort_signals):
_dump... |
`once_per_args` decorator fails with TypeError when function has arguments
#### Description
The `once_per_args` decorator is throwing a `TypeError: call() doesn't have...` when applied to functions that have arguments. This appears to be related to how the decorator processes function argument names.
#### Steps/Code... | diff --git a/funcy/flow.py b/funcy/flow.py
index 85c5a8e..5539225 100644
--- b/funcy/flow.py
+++ a/funcy/flow.py
@@ -236,7 +236,7 @@ once.__doc__ = "Let function execute once, noop all subsequent calls."
def once_per_args(func):
"""Call function once for every combination of values of its arguments."""
- ret... |
JaroWinkler similarity calculation is broken
### Bug report
I've found an issue with the JaroWinkler string similarity algorithm implementation. When comparing strings, it's returning incorrect similarity scores.
For example, when comparing Chinese characters:
```python
from strsimpy.jaro_winkler import JaroWinkler... | diff --git a/strsimpy/jaro_winkler.py b/strsimpy/jaro_winkler.py
index 8dc129f..bb155fb 100644
--- b/strsimpy/jaro_winkler.py
+++ a/strsimpy/jaro_winkler.py
@@ -56,8 +56,10 @@ class JaroWinkler(NormalizedStringSimilarity, NormalizedStringDistance):
def matches(s0, s1):
if len(s0) > len(s1):
m... |
field_validator parameter name changed breaks existing code
When using `field_validator` with positional arguments, the first parameter name was changed from `field` to `__field` which breaks existing code that relies on the parameter name.
#### Steps/Code to Reproduce
```python
from pydantic import BaseModel, field... | diff --git a/pydantic/functional_validators.py b/pydantic/functional_validators.py
index 2eed4ef..f65e15d 100644
--- b/pydantic/functional_validators.py
+++ a/pydantic/functional_validators.py
@@ -454,19 +454,23 @@ def field_validator(
For more in depth examples, see [Field Validators](../concepts/validators.md#fi... |
# HTML Sanitizer in feedparser breaks SVG and MathML handling
### Description
I've discovered an issue with the HTML sanitizer in feedparser that incorrectly handles SVG and MathML elements. When parsing feeds containing these elements, the sanitizer is not properly processing them, resulting in broken content.
The ... | diff --git a/feedparser/sanitizer.py b/feedparser/sanitizer.py
index f9b50e2..7865c57 100644
--- b/feedparser/sanitizer.py
+++ a/feedparser/sanitizer.py
@@ -749,77 +749,83 @@ class HTMLSanitizer(BaseHTMLProcessor):
def unknown_starttag(self, tag, attrs):
acceptable_attributes = self.acceptable_attributes
... |
Text preprocessing functions producing incorrect output
#### Description
The text preprocessing functions in the tokenizer module are not working as expected. When processing text with tone marks, end-of-line characters, and abbreviations, the output is completely different from what should be produced.
#### Steps/C... | diff --git a/gtts/tokenizer/core.py b/gtts/tokenizer/core.py
index d7e0a4e..23d2dac 100644
--- b/gtts/tokenizer/core.py
+++ a/gtts/tokenizer/core.py
@@ -182,15 +182,15 @@ class PreProcessorSub:
def __init__(self, sub_pairs, ignore_case=True):
def search_func(x):
- return u"{}".format(x[::-1])... |
RoutePattern() returns incorrect pattern with wildcards in route segments
#### Description
When using wildcards in route patterns, the `RoutePattern()` method returns an incorrect pattern where wildcards are replaced with `*` before joining the route segments, causing malformed patterns.
#### Steps/Code to Reproduce... | diff --git a/context.go b/context.go
index aacf6ef..773783c 100644
--- b/context.go
+++ a/context.go
@@ -124,14 +124,8 @@ func (x *Context) RoutePattern() string {
if x == nil {
return ""
}
-
- patterns := make([]string, len(x.RoutePatterns))
- for i, pattern := range x.RoutePatterns {
- patterns[i] = replaceW... |
MultiIndex.isin() fails with AttributeError when values is not a MultiIndex
#### Description
When calling `isin()` on a MultiIndex with values that are not already a MultiIndex, an AttributeError is raised.
#### Steps/Code to Reproduce
```python
import pandas as pd
import numpy as np
from pandas import MultiIndex
... | diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py
index 79eb1b6..7728a21 100644
--- b/pandas/core/indexes/multi.py
+++ a/pandas/core/indexes/multi.py
@@ -4120,7 +4120,7 @@ class MultiIndex(Index):
if len(values) == 0:
return np.zeros((len(self),), dtype=np.bool_)
... |
DataFrame formatting methods raise AttributeError after recent changes
#### Description
After some recent changes to the DataFrame formatting code, calling `to_string()`, `to_html()`, and other formatting methods on DataFrames now raises an `AttributeError`. The error occurs when the formatter tries to access propert... | diff --git a/pandas/io/formats/format.py b/pandas/io/formats/format.py
index b7fbc4e..d0f32b9 100644
--- b/pandas/io/formats/format.py
+++ a/pandas/io/formats/format.py
@@ -491,6 +491,10 @@ class DataFrameFormatter:
self.show_dimensions == "truncate" and self.is_truncated
)
+ @property
+ d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.