anchor stringlengths 10 14.3k | positive stringlengths 10 14.9k |
|---|---|
Unicode escape sequences not properly encoded for certain characters
#### Description
When encoding strings that contain certain Unicode characters, the encoder is not properly generating the expected `\uXXXX` escape sequences. Instead, it's outputting the raw Unicode characters directly.
#### Steps/Code to Reproduc... | diff --git a/encode.go b/encode.go
index 1245cdd..bb29585 100644
--- b/encode.go
+++ a/encode.go
@@ -99,26 +99,14 @@ var meta = map[byte][]byte{
}
func (e *hjsonEncoder) quoteReplace(text string) string {
- b := make([]byte, 0, len(text))
- for i := 0; i < len(text); {
- r, width := utf8.DecodeRuneInString(text[i:... |
# DSS key functionality broken in multiple ways
I've discovered several issues with the DSS key implementation that break key functionality:
1. The `can_sign()` method is returning the opposite of what it should - it's returning `True` when `self.x is None` instead of when `self.x is not None`. This means private key... | diff --git a/paramiko/dsskey.py b/paramiko/dsskey.py
index 5215d28..a1c23a0 100644
--- b/paramiko/dsskey.py
+++ a/paramiko/dsskey.py
@@ -106,7 +106,7 @@ class DSSKey(PKey):
return self.size
def can_sign(self):
- return self.x is None
+ return self.x is not None
def sign_ssh_data(sel... |
# TOML parsing issues with array tables and time parsing
## Bug report
**Bug summary**
There are two issues with the TOML parser:
1. When using the `[[table]]` syntax (array of tables), the parser fails to properly handle certain cases, resulting in a `KeyError` or `TOMLDecodeError` when parsing valid TOML files.
2... | diff --git a/src/tomli/_parser.py b/src/tomli/_parser.py
index 16c76cd..cdee18a 100644
--- b/src/tomli/_parser.py
+++ a/src/tomli/_parser.py
@@ -368,24 +368,28 @@ def create_dict_rule(src: str, pos: Pos, out: Output) -> tuple[Pos, Key]:
def create_list_rule(src: str, pos: Pos, out: Output) -> tuple[Pos, Key]:
- ... |
### Issue: Incorrect Charset and Language Detection
#### Describe the Bug
After the recent changes, the charset and language detection seems to be malfunctioning. The detection process is not correctly identifying the expected charset and language for various text samples. This issue is particularly noticeable with n... | diff --git a/charset_normalizer/cd.py b/charset_normalizer/cd.py
index 71a3ed5..97e36e2 100644
--- b/charset_normalizer/cd.py
+++ a/charset_normalizer/cd.py
@@ -255,39 +255,38 @@ def alpha_unicode_split(decoded_sequence: str) -> list[str]:
Ex. a text containing English/Latin with a bit a Hebrew will return two ite... |
### ImportError: cannot import name 'InvalidRequirementError'
**Description:**
After applying the recent changes, an `ImportError` is raised when trying to import `InvalidRequirementError` from `pipdeptree._models.package`. This error occurs during the import process in the `conftest.py` file, which is crucial for se... | diff --git a/src/pipdeptree/_discovery.py b/src/pipdeptree/_discovery.py
index ba23498..dc3779b 100644
--- b/src/pipdeptree/_discovery.py
+++ a/src/pipdeptree/_discovery.py
@@ -130,4 +130,4 @@ def render_duplicated_dist_metadata_text(
__all__ = [
"get_installed_distributions",
-]
+]
\ No newline at end of file
... |
# Inconsistent behavior in parse_value function for Literal types
While working with DSPy, I noticed an issue with the `parse_value` function in `dspy/adapters/utils.py` when handling Literal types. The function doesn't correctly match string values to their corresponding Literal values in some cases.
## Description
... | diff --git a/dspy/adapters/utils.py b/dspy/adapters/utils.py
index 21540bd..617e6e5 100644
--- b/dspy/adapters/utils.py
+++ a/dspy/adapters/utils.py
@@ -132,139 +132,48 @@ def find_enum_member(enum, identifier):
def parse_value(value, annotation):
- """
- Parses a value according to the specified type annota... |
HOCRConverter produces incorrect output with reversed page elements and wrong bounding boxes
#### Description
The HOCR converter is generating malformed output with several issues affecting the structure and positioning of text elements. The generated HOCR markup has incorrect element ordering and bounding box calcul... | diff --git a/pdfminer/converter.py b/pdfminer/converter.py
index 7563c7a..c422b1b 100644
--- b/pdfminer/converter.py
+++ a/pdfminer/converter.py
@@ -977,28 +977,27 @@ class HOCRConverter(PDFConverter[AnyIO]):
def receive_layout(self, ltpage: LTPage) -> None:
def render(item: LTItem) -> None:
... |
ARXML loader fails with "Cannot retrieve a child element of a non-existing node!" for AUTOSAR 4.x files
#### Description
When loading AUTOSAR 4.x ARXML files, the system loader throws an `UnsupportedDatabaseFormatError` with the message "Cannot retrieve a child element of a non-existing node!". This appears to affect... | diff --git a/src/cantools/database/can/formats/arxml/system_loader.py b/src/cantools/database/can/formats/arxml/system_loader.py
index f7aa786..c9adf76 100644
--- b/src/cantools/database/can/formats/arxml/system_loader.py
+++ a/src/cantools/database/can/formats/arxml/system_loader.py
@@ -1597,6 +1597,23 @@ class System... |
#### Description
Function argument types are not being collected when generating stubs from traced types.
#### Steps/Code to Reproduce
```python
from monkeytype.stubs import shrink_traced_types
from monkeytype.tracing import CallTrace
from collections import defaultdict
# Create some sample traces with argument typ... | diff --git a/monkeytype/stubs.py b/monkeytype/stubs.py
index 9c1d3eb..07828ce 100644
--- b/monkeytype/stubs.py
+++ a/monkeytype/stubs.py
@@ -228,6 +228,8 @@ def shrink_traced_types(
return_types: Set[type] = set()
yield_types: Set[type] = set()
for t in traces:
+ for arg, typ in t.arg_types.items(... |
# Checkout fails to delete files without confirmation when `force=True`
When using the `checkout` function with `force=True`, it still prompts for confirmation before deleting files that don't exist in the cache. This behavior is inconsistent with the expected behavior of the `force` parameter.
A minimal example to r... | diff --git a/dvc/repo/checkout.py b/dvc/repo/checkout.py
index 176749a..0d186d7 100644
--- b/dvc/repo/checkout.py
+++ a/dvc/repo/checkout.py
@@ -1,13 +1,23 @@
-import logging
import os
-from typing import Dict, List
-
-from dvc.exceptions import CheckoutError, CheckoutErrorSuggestGit, NoOutputOrStageError
+from typing... |
TabStops initialization broken causing AttributeError on all operations
#### Description
TabStops class is completely broken after recent changes. Any attempt to use TabStops functionality results in AttributeError because the initialization is corrupted.
#### Steps/Code to Reproduce
```python
from docx import Docu... | diff --git a/src/docx/text/parfmt.py b/src/docx/text/parfmt.py
index ea37437..4c7a607 100644
--- b/src/docx/text/parfmt.py
+++ a/src/docx/text/parfmt.py
@@ -113,8 +113,8 @@ class ParagraphFormat(ElementProxy):
"""
pPr = self._element.pPr
if pPr is None:
- return 0
- return s... |
Incorrect empty FQDN when no subdomain and domain
When the extract result's subdomain and domain are both empty, it will return an incorrect empty FQDN.
```python
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import... | diff --git a/tldextract/cli.py b/tldextract/cli.py
index e9aa6ce..23b4f01 100644
--- b/tldextract/cli.py
+++ a/tldextract/cli.py
@@ -96,4 +96,16 @@ def main() -> None:
sys.exit(1)
for i in args.input:
- print(" ".join(tld_extract(i)))
+ ext = tld_extract(i)
+ if args.json:
+ ... |
Database length returns incorrect value after operations
#### Description
The database length calculation is off by one, returning values that are one less than expected. This affects various database operations that rely on the length calculation.
#### Steps/Code to Reproduce
```python
from tinydb import TinyDB
fr... | diff --git a/tinydb/database.py b/tinydb/database.py
index 4a73c46..3b36269 100644
--- b/tinydb/database.py
+++ a/tinydb/database.py
@@ -180,22 +180,25 @@ class TinyDB(TableBase):
:param name: The name of the table to drop.
"""
+ # If the table is currently opened, we need to forget the table... |
MultiIndex.to_frame() ignores index parameter and allow_duplicates validation
#### Description
The `MultiIndex.to_frame()` method is not working correctly. It appears to ignore the `index` parameter and also doesn't properly validate duplicate column labels when `allow_duplicates=False`.
#### Steps/Code to Reproduce... | diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py
index 79eb1b6..0a5d5e5 100644
--- b/pandas/core/indexes/multi.py
+++ a/pandas/core/indexes/multi.py
@@ -1950,13 +1950,22 @@ class MultiIndex(Index):
else:
idx_names = self._get_level_names()
+ if not allow_duplicates... |
### Issue: Unexpected Segmentation in Pinyin Conversion
#### Description
It seems there's an issue with the `handle_nopinyin` method in the `DefaultConverter` class. When converting strings that contain both Chinese characters and English letters, the output is unexpectedly segmented. This behavior is inconsistent wi... | diff --git a/pypinyin/converter.py b/pypinyin/converter.py
index 13c3bcf..f0080fc 100644
--- b/pypinyin/converter.py
+++ a/pypinyin/converter.py
@@ -155,7 +155,8 @@ class DefaultConverter(Converter):
"""
pass
- def handle_nopinyin(self, chars, style, heteronym, errors, strict, **kwargs):
+ def... |
NSRef node name gets reversed during symbol loading
#### Description
When using namespace references in Jinja2 templates, the variable names are being processed incorrectly, causing template runtime errors when trying to access namespace attributes.
#### Steps/Code to Reproduce
```python
from jinja2 import Environm... | diff --git a/src/jinja2/idtracking.py b/src/jinja2/idtracking.py
index d6cb635..27c3500 100644
--- b/src/jinja2/idtracking.py
+++ a/src/jinja2/idtracking.py
@@ -247,8 +247,7 @@ class FrameSymbolVisitor(NodeVisitor):
self.symbols.load(node.name)
def visit_NSRef(self, node: nodes.NSRef, **kwargs: t.An... |
GPX smoothing fails with UnboundLocalError and NameError
When calling the `smooth()` method on GPX track segments, the function raises `UnboundLocalError` and `NameError` exceptions due to undefined variables.
#### Steps to Reproduce
```python
import gpxpy
# Load any GPX file
with open('sample.gpx', 'r') as f:
... | diff --git a/gpxpy/gpx.py b/gpxpy/gpx.py
index 73e2024..15d5f36 100644
--- b/gpxpy/gpx.py
+++ a/gpxpy/gpx.py
@@ -1246,6 +1246,7 @@ class GPXTrackSegment:
if remove_extremes:
# compute the average distance between two points:
distances: List[float] = []
+ elevations_delta = ... |
Incorrect column position for scientific notation linting and truthy value detection issues
I've encountered a problem with the YAML linting rules for scientific notation and truthy values. There appear to be two separate issues:
1. In the `float_values.py` rule, the column position for scientific notation errors is ... | diff --git a/yamllint/rules/float_values.py b/yamllint/rules/float_values.py
index 7c7c60c..c542ff8 100644
--- b/yamllint/rules/float_values.py
+++ a/yamllint/rules/float_values.py
@@ -143,7 +143,7 @@ def check(conf, token, prev, next, nextnext, context):
] and IS_SCIENTIFIC_NOTATION_PATTERN.match(val):
y... |
Inconsistent behavior in `__contains__` method for BaseMaskedArray
I've noticed an issue with the `__contains__` method in the `BaseMaskedArray` class. It seems that the method is not correctly identifying the presence of certain elements in the array, particularly when dealing with masked values.
### Steps to Reprod... | diff --git a/pandas/core/arrays/masked.py b/pandas/core/arrays/masked.py
index f3a0cc0..0225235 100644
--- b/pandas/core/arrays/masked.py
+++ a/pandas/core/arrays/masked.py
@@ -305,31 +305,14 @@ class BaseMaskedArray(OpsMixin, ExtensionArray):
self._data[key] = value
self._mask[key] = mask
- def ... |
QueryParams repr format is incorrect
#### Description
The `__repr__` method for `QueryParams` is returning the wrong format. Instead of showing `QueryParams('query_string')`, it's showing `'query_string'('QueryParams')`.
#### Steps/Code to Reproduce
```python
from starlette.datastructures import QueryParams
q = Qu... | diff --git a/starlette/datastructures.py b/starlette/datastructures.py
index 90a7296..7c23890 100644
--- b/starlette/datastructures.py
+++ a/starlette/datastructures.py
@@ -403,7 +403,7 @@ class QueryParams(ImmutableMultiDict[str, str]):
def __repr__(self) -> str:
class_name = self.__class__.__name__
... |
SlavicBaseLocale _format_timeframe broken for plural forms
#### Description
When using Slavic locales (Russian, Polish, Bulgarian, Macedonian, etc.), the `_format_timeframe` method fails with an AttributeError because it tries to call `.format()` on a dictionary instead of a string.
#### Steps/Code to Reproduce
```... | diff --git a/arrow/locales.py b/arrow/locales.py
index 63b2d48..ac0c28a 100644
--- b/arrow/locales.py
+++ a/arrow/locales.py
@@ -1334,8 +1334,17 @@ class SlavicBaseLocale(Locale):
form = self.timeframes[timeframe]
delta = abs(delta)
+ if isinstance(form, Mapping):
+ if delta % 10 =... |
Missing prepare_refresh_token_request method in OAuth2 Client
#### Description
The `prepare_refresh_token_request` method has been removed from the OAuth2 Client class, breaking existing functionality for refresh token requests.
#### Steps/Code to Reproduce
```python
from oauthlib.oauth2 import Client
client = Cli... | diff --git a/oauthlib/oauth2/rfc6749/clients/base.py b/oauthlib/oauth2/rfc6749/clients/base.py
index a8de78b..164909a 100644
--- b/oauthlib/oauth2/rfc6749/clients/base.py
+++ a/oauthlib/oauth2/rfc6749/clients/base.py
@@ -427,6 +427,27 @@ class Client:
self.populate_token_attributes(self.token)
return ... |
# Template caching broken in Environment.get_or_select_template
## Description
I've noticed that template caching is broken in the latest version. When loading templates, they are always loaded from the source rather than using the cache, even when the cache is enabled.
This is causing significant performance issues... | diff --git a/src/jinja2/environment.py b/src/jinja2/environment.py
index 0b303d5..96eb4d0 100644
--- b/src/jinja2/environment.py
+++ a/src/jinja2/environment.py
@@ -959,12 +959,24 @@ class Environment:
if self.loader is None:
raise TypeError("no loader for this environment specified")
cac... |
JsonFormatter produces invalid JSON output when using rename_fields
#### Description
The JsonFormatter is generating malformed JSON output that cannot be parsed. When trying to log messages with the formatter, the output appears to be corrupted or improperly formatted, causing JSON parsing errors.
#### Steps/Code to... | diff --git a/src/pythonjsonlogger/jsonlogger.py b/src/pythonjsonlogger/jsonlogger.py
index 519a64d..78d71d5 100644
--- b/src/pythonjsonlogger/jsonlogger.py
+++ a/src/pythonjsonlogger/jsonlogger.py
@@ -210,22 +210,22 @@ class JsonFormatter(logging.Formatter):
Override this method to implement custom logic for a... |
Empty list is not handled correctly in _ensure_list_of_callables
Description
When using an empty list as a validator, the function `_ensure_list_of_callables` incorrectly handles this case.
Given the following code:
```python
from webargs import fields
# Create a field with an empty list as validator
field = fiel... | diff --git a/src/webargs/core.py b/src/webargs/core.py
index 44294e9..0b30559 100644
--- b/src/webargs/core.py
+++ a/src/webargs/core.py
@@ -117,27 +117,17 @@ def parse_json(s: typing.AnyStr, *, encoding: str = "utf-8") -> typing.Any:
def _ensure_list_of_callables(obj: typing.Any) -> CallableList:
- """Convert ... |
# Pydantic dataclass doesn't warn on conflicting config specifications
## Description
When using pydantic dataclasses with both a `config` parameter in the decorator and a `__pydantic_config__` attribute in the class, there's no warning about the conflicting configuration. This can lead to unexpected behavior since u... | diff --git a/pydantic/dataclasses.py b/pydantic/dataclasses.py
index 5111bc3..4aac45b 100644
--- b/pydantic/dataclasses.py
+++ a/pydantic/dataclasses.py
@@ -60,7 +60,7 @@ if sys.version_info >= (3, 10):
kw_only: bool = ...,
slots: bool = ...,
) -> type[PydanticDataclass]: ...
-
+
else:
... |
PEP8 normalizer produces incorrect indentation errors after recent changes
#### Description
The PEP8 normalizer is now producing incorrect results when analyzing Python code for indentation and formatting issues. It appears that several core components of the indentation handling logic have been modified, causing the... | diff --git a/parso/python/pep8.py b/parso/python/pep8.py
index c492dae..4fec621 100644
--- b/parso/python/pep8.py
+++ a/parso/python/pep8.py
@@ -129,16 +129,20 @@ class BackslashNode(IndentationNode):
equals = expr_stmt.children[-2]
if '\t' in config.indentation:
- self.indent... |
Setting paragraph style to None raises UnboundLocalError
#### Description
When setting a paragraph's style to None, an UnboundLocalError is raised because the code tries to access a variable before it's defined.
#### Steps/Code to Reproduce
```python
from docx import Document
# Create a new document
doc = Document... | diff --git a/src/docx/oxml/text/parfmt.py b/src/docx/oxml/text/parfmt.py
index de56096..f7ed305 100644
--- b/src/docx/oxml/text/parfmt.py
+++ a/src/docx/oxml/text/parfmt.py
@@ -312,11 +312,12 @@ class CT_PPr(BaseOxmlElement):
If `style` is |None|, remove `./w:pStyle` when present.
"""
- pStyl... |
Ruby lexer produces incorrect token output after recent changes
#### Description
The Ruby lexer is not properly tokenizing Ruby code, causing failures when processing various Ruby syntax elements. The lexer appears to be generating malformed token sequences that don't match the original input text.
#### Steps/Code t... | diff --git a/pygments/lexers/ruby.py b/pygments/lexers/ruby.py
index 134ff77..dbf785e 100644
--- b/pygments/lexers/ruby.py
+++ a/pygments/lexers/ruby.py
@@ -41,73 +41,84 @@ class RubyLexer(ExtendedRegexLexer):
flags = re.DOTALL | re.MULTILINE
def heredoc_callback(self, match, ctx):
+ # okay, this is ... |
Query operations returning inverted results
When using TinyDB queries, all query operations are returning inverted/opposite results. Queries that should match documents are not matching, and queries that shouldn't match are matching instead.
#### Steps/Code to Reproduce
```python
from tinydb import TinyDB, Query, wh... | diff --git a/tinydb/queries.py b/tinydb/queries.py
index 0ef6a69..147ac50 100644
--- b/tinydb/queries.py
+++ a/tinydb/queries.py
@@ -218,9 +218,7 @@ class Query(QueryInstance):
:param hashval: The hash of the query.
:return: A :class:`~tinydb.queries.QueryInstance` object
"""
- if self... |
SSLIOStream read_from_fd TypeError with memoryview
**Describe the bug**
When attempting to read from an SSLIOStream using a memoryview, a `TypeError` is raised. The error message indicates that the `read()` method requires a read-write bytes-like object, but a bytes object is being provided instead.
**To Reproduce**
... | diff --git a/tornado/iostream.py b/tornado/iostream.py
index dd2111e..4227d3f 100644
--- b/tornado/iostream.py
+++ a/tornado/iostream.py
@@ -1527,21 +1527,19 @@ class SSLIOStream(IOStream):
del data
def read_from_fd(self, buf: Union[bytearray, memoryview]) -> Optional[int]:
- """Attempts to r... |
_skip_dedent_error_leaves function returns None instead of leaf
#### Description
The `_skip_dedent_error_leaves` function in `parso/python/diff.py` is returning `None` instead of the expected leaf node, causing AttributeError when trying to access attributes on the returned value.
#### Steps/Code to Reproduce
```py... | diff --git a/parso/python/diff.py b/parso/python/diff.py
index ba999fa..49e0eca 100644
--- b/parso/python/diff.py
+++ a/parso/python/diff.py
@@ -168,9 +168,9 @@ def _get_last_line(node_or_leaf):
def _skip_dedent_error_leaves(leaf):
- while leaf is not None and leaf.type == 'error_leaf' and leaf.token_type != 'D... |
number_to_string function broken after recent changes
#### Description
The `number_to_string` function in `deepdiff/helper.py` appears to be completely broken. When calling this function with any numeric input, it fails to properly format numbers according to the specified significant digits and notation format.
###... | diff --git a/deepdiff/helper.py b/deepdiff/helper.py
index ff6d668..a22a40c 100644
--- b/deepdiff/helper.py
+++ a/deepdiff/helper.py
@@ -405,7 +405,7 @@ def number_to_string(number, significant_digits, number_format_notation="f"):
Convert numbers to string considering significant digits.
"""
try:
- ... |
Database URL construction broken when using mirror parameter
#### Description
When using the `db_mirror` parameter with the safety database fetching functionality, the URL construction is incorrect, causing database fetch failures.
#### Steps/Code to Reproduce
```python
from safety.safety import fetch_database_url
... | diff --git a/safety/safety.py b/safety/safety.py
index 7bb6ad7..675bdcc 100644
--- b/safety/safety.py
+++ a/safety/safety.py
@@ -164,12 +164,12 @@ def fetch_database_url(
"""
headers = {'schema-version': JSON_SCHEMA_VERSION, 'ecosystem': ecosystem.value}
- if from_cache and cached:
+ if cached and fro... |
Jinja template tokenization broken for multi-character delimiters
#### Description
When tokenizing Jinja templates with multi-character delimiters like `{{-`, `-}}`, `{%`, `-%}`, the tokenizer is not properly advancing through the delimiter characters, causing incorrect token parsing.
#### Steps/Code to Reproduce
`... | diff --git a/sqlglot/tokens.py b/sqlglot/tokens.py
index 2944deb..aa1ed38 100644
--- b/sqlglot/tokens.py
+++ a/sqlglot/tokens.py
@@ -1479,7 +1479,7 @@ class Tokenizer(metaclass=_Tokenizer):
else:
if self._chars(delim_size) == delimiter:
if delim_size > 1:
- ... |
Progress bar function not defined after context manager initialization
#### Description
When using alive_progress, the progress bar function is not available within the context manager, causing a `NameError` when trying to call it.
#### Steps/Code to Reproduce
```python
from alive_progress import alive_bar
with al... | diff --git a/alive_progress/core/progress.py b/alive_progress/core/progress.py
index a0e266a..d618033 100644
--- b/alive_progress/core/progress.py
+++ a/alive_progress/core/progress.py
@@ -178,6 +178,28 @@ def __alive_bar(config, total=None, *, calibrate=None,
if run.title:
run.title += (' ',) # ... |
Binary operations produce incorrect results with operands swapped
#### Description
Binary expressions in Jinja2 templates are evaluating with operands in the wrong order, causing incorrect results for non-commutative operations like subtraction, division, and list concatenation.
#### Steps/Code to Reproduce
```pyth... | diff --git a/src/jinja2/nodes.py b/src/jinja2/nodes.py
index 2f93b90..e95d02e 100644
--- b/src/jinja2/nodes.py
+++ a/src/jinja2/nodes.py
@@ -501,15 +501,15 @@ class BinExpr(Expr):
# intercepted operators cannot be folded at compile time
if (
- not eval_ctx.environment.sandboxed
- ... |
### Bug Report: Dynamic Imports Failing in Documentation
**Describe the Bug**
It seems there's an issue with the dynamic imports in the documentation generation. The problem arises when attempting to dynamically import certain attributes, which results in an unexpected failure.
**Steps to Reproduce**
To reproduce t... | diff --git a/docs/plugins/main.py b/docs/plugins/main.py
index 56b06b6..6b2a120 100644
--- b/docs/plugins/main.py
+++ a/docs/plugins/main.py
@@ -168,7 +168,10 @@ def upgrade_python(markdown: str) -> str:
else:
return '\n\n'.join(output)
- return re.sub(r'^(``` *py.*?)\n(.+?)^```(\s+(?:^\d+\. ... |
# HTTP Chunked Encoding and Header Handling Issues
### Describe the bug
I've discovered two issues with the HTTP handling in Gunicorn:
1. The chunked encoding parser is not properly handling whitespace in chunk size lines, causing some valid chunked requests to fail.
2. The HTTP response headers are being sent with ... | diff --git a/gunicorn/http/body.py b/gunicorn/http/body.py
index d7ee29e..dbbe69f 100644
--- b/gunicorn/http/body.py
+++ a/gunicorn/http/body.py
@@ -89,8 +89,12 @@ class ChunkedReader:
# RFC9112 7.1.1: BWS before chunk-ext - but ONLY then
chunk_size, *chunk_ext = line.split(b";", 1)
+ if chun... |
Snowflake parser returns None for lateral flatten expressions
#### Description
When parsing Snowflake SQL queries containing `LATERAL FLATTEN` expressions, the parser is returning `None` instead of the expected lateral expression object. This causes queries with lateral flatten operations to fail parsing.
#### Steps... | diff --git a/sqlglot/dialects/snowflake.py b/sqlglot/dialects/snowflake.py
index efcec16..22452e0 100644
--- b/sqlglot/dialects/snowflake.py
+++ a/sqlglot/dialects/snowflake.py
@@ -702,11 +702,9 @@ class Snowflake(Dialect):
return self._parse_slice(self._parse_alias(self._parse_assignment(), explicit=True)... |
# Cache.get() doesn't check disk cache properly
**Describe the bug**
The `get` method in the `Cache` class doesn't properly check the disk cache when a key is not found in memory cache. This causes cache misses even when the data exists in the disk cache.
**To Reproduce**
Steps to reproduce the behavior:
1. Create a ... | diff --git a/dspy/clients/cache.py b/dspy/clients/cache.py
index d3bad50..b7d6c64 100644
--- b/dspy/clients/cache.py
+++ a/dspy/clients/cache.py
@@ -105,12 +105,21 @@ class Cache:
if self.enable_memory_cache and key in self.memory_cache:
with self._lock:
response = self.memory_cac... |
### Describe the bug
The PostgreSQL dialect's custom operator parsing seems to be malfunctioning. When using the `OPERATOR` syntax with multiple operators in a sequence, the expected SQL output is not generated correctly. This issue arises when attempting to parse and convert expressions involving custom operators.
#... | diff --git a/sqlglot/dialects/postgres.py b/sqlglot/dialects/postgres.py
index 9d41a68..741b118 100644
--- b/sqlglot/dialects/postgres.py
+++ a/sqlglot/dialects/postgres.py
@@ -442,33 +442,28 @@ class Postgres(Dialect):
}
def _parse_operator(self, this: t.Optional[exp.Expression]) -> t.Optional[exp.... |
**Endpoint parser in helio module crashes with UnboundLocalError**
**Description**
The `endpoint_parser` function in the helio parser module crashes with an UnboundLocalError when trying to access the `soup` variable.
**To reproduce:**
```python
from sunpy.net.helio.parser import endpoint_parser
# This will crash ... | diff --git a/sunpy/net/helio/parser.py b/sunpy/net/helio/parser.py
index 7af0dfa..d813552 100644
--- b/sunpy/net/helio/parser.py
+++ a/sunpy/net/helio/parser.py
@@ -73,12 +73,6 @@ def webservice_parser(service='HEC'):
def endpoint_parser(link):
- for web_link in soup.find_all('a'):
- url = web_link.get('... |
Unicode spaces are stripped when parsing markdown text
```
In [1]: import mistune
In [2]: md = mistune.create_markdown(escape=False, hard_wrap=True)
In [3]: result = md('\u2003\u2003foo\nbar\n\n\u2003\u2003foobar')
In [4]: print(result)
<p>foo<br />
bar</p>
<p>foobar</p>
```
The output is missing the leading em sp... | diff --git a/src/mistune/markdown.py b/src/mistune/markdown.py
index 34403eb..3602507 100644
--- b/src/mistune/markdown.py
+++ a/src/mistune/markdown.py
@@ -66,7 +66,8 @@ class Markdown:
elif 'text' in tok:
text = tok.pop('text')
# process inline text
- tok[... |
Error with Custom Interpreter and Package Discovery
Description
When using a custom Python interpreter, the package discovery process seems to be malfunctioning. Specifically, the issue arises when attempting to filter packages with the `--local-only` and `--user-only` flags. The expected packages are not being corre... | diff --git a/src/pipdeptree/_discovery.py b/src/pipdeptree/_discovery.py
index ba23498..ff02fef 100644
--- b/src/pipdeptree/_discovery.py
+++ a/src/pipdeptree/_discovery.py
@@ -13,103 +13,41 @@ from packaging.utils import canonicalize_name
from pipdeptree._warning import get_warning_printer
-def get_installed_dist... |
Language Matching Issue in CSS Selectors
Description
I've encountered an issue with language matching in CSS selectors after a recent update. It seems that the language attribute handling is not functioning as expected, particularly when dealing with wildcard and specific language patterns.
To illustrate, consider t... | diff --git a/soupsieve/css_match.py b/soupsieve/css_match.py
index e52e42d..77ccdbd 100644
--- b/soupsieve/css_match.py
+++ a/soupsieve/css_match.py
@@ -1155,40 +1155,90 @@ class CSSMatch(_DocumentNav):
def match_lang(self, el: bs4.Tag, langs: tuple[ct.SelectorLang, ...]) -> bool:
"""Match languages."""... |
Insert queries with string column names fail to execute
#### Description
When using string column names in insert queries, the columns method incorrectly wraps them in Field objects, causing SQL generation to fail.
#### Steps/Code to Reproduce
```python
from pypika import Query, Table
# This should work but curren... | diff --git a/pypika/queries.py b/pypika/queries.py
index 42c7c45..ab2410d 100644
--- b/pypika/queries.py
+++ a/pypika/queries.py
@@ -894,7 +894,7 @@ class QueryBuilder(Selectable, Term):
terms = terms[0]
for term in terms:
- if not isinstance(term, str):
+ if isinstance(ter... |
SSHClient.exec_command returns streams in wrong order
#### Description
When using `SSHClient.exec_command()`, the returned tuple of streams is in the wrong order. The method should return `(stdin, stdout, stderr)` but currently returns them in a different sequence.
#### Steps/Code to Reproduce
```python
import para... | diff --git a/paramiko/client.py b/paramiko/client.py
index d8be910..725fb16 100644
--- b/paramiko/client.py
+++ a/paramiko/client.py
@@ -203,11 +203,14 @@ class SSHClient(ClosingContextManager):
hostname, port, socket.AF_UNSPEC, socket.SOCK_STREAM
)
for (family, socktype, proto, canonname... |
GPX get_moving_data returns early with uninitialized variables
#### Description
The `get_moving_data()` method in the GPX class returns early before initializing all required variables, causing `UnboundLocalError` when trying to access moving_distance and max_speed.
#### Steps/Code to Reproduce
```python
import gpx... | diff --git a/gpxpy/gpx.py b/gpxpy/gpx.py
index 73e2024..4acb0ad 100644
--- b/gpxpy/gpx.py
+++ a/gpxpy/gpx.py
@@ -2224,11 +2224,13 @@ class GPX:
Max speed is in m/s.
"""
+ moving_time = 0.
+ stopped_time = 0.
+
+ moving_distance = 0.
stopped_distance = 0.
- moving... |
Section.page_height returns incorrect value
#### Description
The `page_height` property on Section objects is returning unexpected values. When accessing the page height of a document section, the returned value doesn't match what's expected based on the page size settings.
#### Steps/Code to Reproduce
```python
fr... | diff --git a/src/docx/section.py b/src/docx/section.py
index 982a143..ceccce6 100644
--- b/src/docx/section.py
+++ a/src/docx/section.py
@@ -193,9 +193,7 @@ class Section:
Page orientation is taken into account, so for example, its expected value
would be ``Inches(8.5)`` for letter-sized paper when or... |
CLI argument parsing broken - FileType parameters swapped
#### Description
The command line interface is failing to parse arguments correctly. When trying to use the wordcloud CLI with various options, it exits with error code 2.
#### Steps/Code to Reproduce
```python
from wordcloud import wordcloud_cli as cli
# T... | diff --git a/wordcloud/wordcloud_cli.py b/wordcloud/wordcloud_cli.py
index 4ddd3db..d5fe52c 100644
--- b/wordcloud/wordcloud_cli.py
+++ a/wordcloud/wordcloud_cli.py
@@ -45,8 +45,8 @@ class FileType(object):
"""
def __init__(self, mode='r', bufsize=-1):
- self._mode = bufsize
- self._bufsize = ... |
TabStops indexing broken after code reorganization
#### Description
When trying to access tab stops by index using `tab_stops[idx]`, the code fails with a `NameError` because variables are referenced before they are defined.
#### Steps/Code to Reproduce
```python
from docx import Document
from docx.text.tabstops im... | diff --git a/src/docx/text/tabstops.py b/src/docx/text/tabstops.py
index 824085d..f3fb88c 100644
--- b/src/docx/text/tabstops.py
+++ a/src/docx/text/tabstops.py
@@ -29,12 +29,13 @@ class TabStops(ElementProxy):
self._pPr.remove(tabs)
def __getitem__(self, idx):
+ """Enables list-style access ... |
# HEAD method included in OpenAPI schema
#### Description
After a recent update, I noticed that the OpenAPI schema generation now includes HEAD methods in the schema. This is causing issues with our API documentation as HEAD methods should typically be excluded from the schema.
#### Steps/Code to Reproduce
```pytho... | diff --git a/starlette/schemas.py b/starlette/schemas.py
index bfc40e2..7b843d2 100644
--- b/starlette/schemas.py
+++ a/starlette/schemas.py
@@ -72,6 +72,8 @@ class BaseSchemaGenerator:
elif inspect.isfunction(route.endpoint) or inspect.ismethod(route.endpoint):
path = self._remove_convert... |
# Column creation logic is reversed in make_columns function
**Describe the bug**
When creating columns using the `make_columns` function, the logic for handling tuple vs non-tuple inputs is reversed, causing unexpected behavior when creating tables.
**To Reproduce**
Steps to reproduce the behavior:
1. Try to create ... | diff --git a/pypika/queries.py b/pypika/queries.py
index 42c7c45..8330fb7 100644
--- b/pypika/queries.py
+++ a/pypika/queries.py
@@ -313,13 +313,14 @@ def make_columns(*names: Union[TypedTuple[str, str], str]) -> List[Column]:
columns = []
for name in names:
if isinstance(name, tuple) and len(name) =... |
XHTML content parsing broken with bytes handling
#### Description
When parsing XHTML content in Atom feeds, feedparser fails with `TypeError: sequence item 0: expected str instance, bytes found` errors. This affects feeds that contain XHTML content with `application/xhtml+xml` content type.
#### Steps/Code to Reprod... | diff --git a/feedparser/mixin.py b/feedparser/mixin.py
index 0e8380d..ee7123d 100644
--- b/feedparser/mixin.py
+++ a/feedparser/mixin.py
@@ -486,6 +486,11 @@ class XMLParserMixin(
element, expecting_text, pieces = self.elementstack.pop()
+ # Ensure each piece is a str for Python 3
+ for i, v ... |
#### Description
The `join_cells` function is producing unexpected output with spaces between cell fragments instead of concatenating them directly.
#### Steps/Code to Reproduce
```python
from alive_progress.utils.cells import join_cells, strip_marks
# Example fragments that should be joined without spaces
fragment... | diff --git a/alive_progress/utils/cells.py b/alive_progress/utils/cells.py
index b8df48c..9e56601 100644
--- b/alive_progress/utils/cells.py
+++ a/alive_progress/utils/cells.py
@@ -117,7 +117,7 @@ def print_cells(fragments, cols, term, last_line_len=0):
def join_cells(fragment):
"""Beware, this looses the cell in... |
BadHostKeyException error message format inconsistent with expected output
#### Description
The error message format for `BadHostKeyException` doesn't match what's expected. The order of "got" and "expected" keys in the message appears to be swapped.
#### Steps/Code to Reproduce
```python
from paramiko import RSAKe... | diff --git a/paramiko/ssh_exception.py b/paramiko/ssh_exception.py
index 2b68ebe..e9d78ae 100644
--- b/paramiko/ssh_exception.py
+++ a/paramiko/ssh_exception.py
@@ -130,11 +130,11 @@ class BadHostKeyException(SSHException):
self.expected_key = expected_key
def __str__(self):
- msg = "Host key for... |
ARXML ECU extract loader returns fewer messages than expected
#### Description
When loading an ARXML file using the ECU extract loader, some messages are being dropped and not included in the resulting database. The loader appears to be filtering out messages that should be valid.
#### Steps/Code to Reproduce
```py... | diff --git a/src/cantools/database/can/formats/arxml/ecu_extract_loader.py b/src/cantools/database/can/formats/arxml/ecu_extract_loader.py
index 67935ab..bd10688 100644
--- b/src/cantools/database/can/formats/arxml/ecu_extract_loader.py
+++ a/src/cantools/database/can/formats/arxml/ecu_extract_loader.py
@@ -98,16 +98,1... |
PDF encryption verification fails for certain encrypted documents
#### Description
When processing encrypted PDF documents, the encryption key verification is failing for some files that should be valid. This affects the ability to read encrypted PDFs that were previously working correctly.
#### Steps/Code to Reprod... | diff --git a/pdfminer/pdfdocument.py b/pdfminer/pdfdocument.py
index 1c06335..d34c390 100644
--- b/pdfminer/pdfdocument.py
+++ a/pdfminer/pdfdocument.py
@@ -422,10 +422,11 @@ class PDFStandardSecurityHandler:
return None
def verify_encryption_key(self, key: bytes) -> bool:
+ # Algorithm 3.6
... |
GroffFormatter generates incorrect color definitions and format
#### Description
The GroffFormatter is producing incorrect output when formatting code. The color definitions are being generated with wrong logic and the color format specification is incorrect.
#### Steps/Code to Reproduce
```python
from pygments imp... | diff --git a/pygments/formatters/groff.py b/pygments/formatters/groff.py
index a9e0711..7067e67 100644
--- b/pygments/formatters/groff.py
+++ a/pygments/formatters/groff.py
@@ -81,11 +81,11 @@ class GroffFormatter(Formatter):
def _define_colors(self, outfile):
colors = set()
for _, ndef in self.s... |
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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.