anchor
stringlengths
10
14.3k
positive
stringlengths
10
14.9k
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...
# [Bug]: `keep()` function breaks `autocurry` functionality ## Bug summary In the current version, when using `keep()` with `autocurry`, it fails with a TypeError. The `keep()` function implementation is causing issues with higher-order functions that rely on iterating over function results. ## Code for reproduction...
diff --git a/funcy/seqs.py b/funcy/seqs.py index 9a96252..f94faff 100644 --- b/funcy/seqs.py +++ a/funcy/seqs.py @@ -153,17 +153,10 @@ def keep(f, seq=EMPTY): """Maps seq with f and iterates truthy results. Simply iterates truthy values in one argument version.""" if seq is EMPTY: - # One argum...
Loop context initialization broken for recursive loops #### Description When using recursive loops in Jinja2 templates, the loop context is not properly initialized, causing recursive loop functionality to fail completely. #### Steps/Code to Reproduce ```python from jinja2 import Template # Simple recursive loop t...
diff --git a/src/jinja2/runtime.py b/src/jinja2/runtime.py index 9dcc9d4..e4d05a3 100644 --- b/src/jinja2/runtime.py +++ a/src/jinja2/runtime.py @@ -418,11 +418,12 @@ class LoopContext: loop is marked recursive. :param depth0: Incremented when looping recursively. """ - self._itera...
NameError in validate_qualify_columns function after removing variable declaration #### Description The `validate_qualify_columns` function in `sqlglot/optimizer/qualify_columns.py` is raising a `NameError` because the `all_unqualified_columns` variable is being referenced but not declared. #### Steps/Code to Reprod...
diff --git a/sqlglot/optimizer/qualify_columns.py b/sqlglot/optimizer/qualify_columns.py index 3ab987d..15456dd 100644 --- b/sqlglot/optimizer/qualify_columns.py +++ a/sqlglot/optimizer/qualify_columns.py @@ -114,6 +114,7 @@ def qualify_columns( def validate_qualify_columns(expression: E) -> E: """Raise an `Opt...
NamespacePrefixedTag parsing broken for namespace-prefixed XML tags #### Description When working with XML namespace-prefixed tags, the `NamespacePrefixedTag` class incorrectly parses the prefix and local part, causing various XML operations to fail. #### Steps/Code to Reproduce ```python from docx.oxml.ns import N...
diff --git a/src/docx/oxml/ns.py b/src/docx/oxml/ns.py index 5bed1e6..16a9496 100644 --- b/src/docx/oxml/ns.py +++ a/src/docx/oxml/ns.py @@ -33,8 +33,8 @@ class NamespacePrefixedTag(str): return super(NamespacePrefixedTag, cls).__new__(cls, nstag) def __init__(self, nstag: str): - self._local_par...
CDD file parsing produces incorrect data field attributes When loading CDD files, the data fields are getting their attributes mixed up. The name and id are swapped, minimum and maximum values are reversed, and factor/offset values are also swapped. Additionally, bit lengths are being reduced by 1 and byte order is be...
diff --git a/src/cantools/database/diagnostics/formats/cdd.py b/src/cantools/database/diagnostics/formats/cdd.py index b25f9d5..43b02bc 100644 --- b/src/cantools/database/diagnostics/formats/cdd.py +++ a/src/cantools/database/diagnostics/formats/cdd.py @@ -26,17 +26,17 @@ class DataType: unit, ...
BUG: Series.value_counts with sort=False returns result sorted on values for Series with string dtype ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of ...
diff --git a/pandas/core/arrays/string_.py b/pandas/core/arrays/string_.py index 7227ea7..2dfa165 100644 --- b/pandas/core/arrays/string_.py +++ a/pandas/core/arrays/string_.py @@ -990,7 +990,7 @@ class StringArray(BaseStringArray, NumpyExtensionArray): # type: ignore[misc] def value_counts(self, dropna: bool = T...
ParagraphFormat.left_indent returns incorrect values #### Description The `left_indent` property of `ParagraphFormat` is returning unexpected values. When a paragraph has no formatting properties, it should return `None`, but it's returning `0` instead. Additionally, when there are formatting properties present, the ...
diff --git a/src/docx/text/parfmt.py b/src/docx/text/parfmt.py index ea37437..da1722b 100644 --- b/src/docx/text/parfmt.py +++ a/src/docx/text/parfmt.py @@ -91,8 +91,8 @@ class ParagraphFormat(ElementProxy): """ pPr = self._element.pPr if pPr is None: - return 0 - return pPr...
# MIPROv2 optimizer not evaluating correctly with minibatch ## Description I'm having an issue with the MIPROv2 optimizer when using minibatch mode. The optimizer seems to be evaluating incorrectly at intervals. ## Reproduction Here's a simple example that demonstrates the issue: ```python import dspy from dspy.te...
diff --git a/dspy/teleprompt/mipro_optimizer_v2.py b/dspy/teleprompt/mipro_optimizer_v2.py index 711b227..b45d033 100644 --- b/dspy/teleprompt/mipro_optimizer_v2.py +++ a/dspy/teleprompt/mipro_optimizer_v2.py @@ -607,7 +607,7 @@ class MIPROv2(Teleprompter): ) # If minibatch, perform full eva...
make_func returns wrong types for various inputs When using `make_func` with different input types, the function returns incorrect types or behaviors: ```python from funcy import make_func, make_pred # String regex patterns return wrong results func = make_func('\\d+') print(func('ab42c')) # Expected: '42', Got: Tr...
diff --git a/funcy/funcmakers.py b/funcy/funcmakers.py index e636ea7..ef2df85 100644 --- b/funcy/funcmakers.py +++ a/funcy/funcmakers.py @@ -11,17 +11,18 @@ def make_func(f, test=False): if callable(f): return f elif f is None: - return int if test else lambda x: x + # pass None to buil...
#### Description Type annotation order change in `__class_getitem__` breaks mypy type checking The return type annotation for `BaseModel.__class_getitem__` was changed from `type[BaseModel] | _forward_ref.PydanticRecursiveRef` to `_forward_ref.PydanticRecursiveRef | type[BaseModel]`, which causes mypy to infer the wr...
diff --git a/pydantic/main.py b/pydantic/main.py index 03cb511..a7f5b93 100644 --- b/pydantic/main.py +++ a/pydantic/main.py @@ -837,7 +837,7 @@ class BaseModel(metaclass=_model_construction.ModelMetaclass): def __class_getitem__( cls, typevar_values: type[Any] | tuple[type[Any], ...] - ) -> _forward...
Config attribute assignment broken after recent changes #### Description Setting configuration attributes on Config instances now raises `AttributeError: Invalid access!` when trying to assign values to valid configuration settings. #### Steps/Code to Reproduce ```python from gunicorn.config import Config cfg = Co...
diff --git a/gunicorn/config.py b/gunicorn/config.py index 402a26b..12352a7 100644 --- b/gunicorn/config.py +++ a/gunicorn/config.py @@ -67,7 +67,7 @@ class Config: return self.settings[name].get() def __setattr__(self, name, value): - if name == "settings" or name not in self.settings: + ...
IPvAnyNetwork and IPvAnyInterface validation order changed causing incorrect type detection #### Description When using `IPvAnyNetwork` or `IPvAnyInterface` types, the validation logic appears to have changed and now returns incorrect IP types for certain inputs. IPv4 addresses that should be detected as IPv4 are bei...
diff --git a/pydantic/networks.py b/pydantic/networks.py index cae8238..1f58ffb 100644 --- b/pydantic/networks.py +++ a/pydantic/networks.py @@ -232,6 +232,7 @@ class _BaseUrl: def __lt__(self, other: Any) -> bool: return self.__class__ is other.__class__ and self._url < other._url + def __gt__(sel...
# Docstring placement issue in Markdown compiler I'm experiencing an issue with the Markdown compiler in Nikola. When building my site, I'm getting errors related to the Markdown compiler. ## Problem The Markdown compiler seems to be failing to properly process Markdown files. After investigating, I found that there...
diff --git a/nikola/plugins/compile/markdown/__init__.py b/nikola/plugins/compile/markdown/__init__.py index d6f137e..6829fc5 100644 --- b/nikola/plugins/compile/markdown/__init__.py +++ a/nikola/plugins/compile/markdown/__init__.py @@ -59,17 +59,18 @@ class ThreadLocalMarkdown(threading.local): self.markdown ...
DiskError exception handling removed from CLI causing unhandled exceptions #### Description When encountering a DiskError from dvc_data.hashfile.cache, the CLI no longer provides user-friendly error messages and instead shows raw stack traces. #### Steps/Code to Reproduce ```python from dvc_data.hashfile.cache impo...
diff --git a/dvc/cli/__init__.py b/dvc/cli/__init__.py index ffff0eb..c72cd16 100644 --- b/dvc/cli/__init__.py +++ a/dvc/cli/__init__.py @@ -121,6 +121,23 @@ def _log_exceptions(exc: Exception) -> Optional[int]: from dvc_data.hashfile.cache import DiskError + if isinstance(exc, DiskError): + from dvc...
StaticFileHandler._get_content method returns empty generator #### Description The `StaticFileHandler._get_content` method appears to be broken and returns an empty generator instead of yielding file content chunks. This causes static file serving to fail with internal server errors. #### Steps/Code to Reproduce ``...
diff --git a/tornado/web.py b/tornado/web.py index 357c5f1..20725ee 100644 --- b/tornado/web.py +++ a/tornado/web.py @@ -2967,6 +2967,27 @@ class StaticFileHandler(RequestHandler): .. versionadded:: 3.1 """ + with open(abspath, "rb") as file: + if start is not None: + ...
NameError in pd.eval with float32 arrays and scalar operations #### Description When using `pd.eval` with float32 arrays and scalar operations, a `NameError` is raised due to an undefined variable `name`. #### Steps/Code to Reproduce ```python import pandas as pd import numpy as np # Create a float32 DataFrame df ...
diff --git a/pandas/core/computation/expr.py b/pandas/core/computation/expr.py index 14a393b..49bedb5 100644 --- b/pandas/core/computation/expr.py +++ a/pandas/core/computation/expr.py @@ -468,6 +468,8 @@ class BaseExprVisitor(ast.NodeVisitor): and not right.is_scalar and right.return_type == ...
JSON schema generation fails for discriminated unions with aliased fields #### Description When generating JSON schemas for models with discriminated unions where the discriminator field uses an alias, the schema generation process encounters an undefined variable error. #### Steps/Code to Reproduce ```python from ...
diff --git a/pydantic/json_schema.py b/pydantic/json_schema.py index ca031ea..df99b86 100644 --- b/pydantic/json_schema.py +++ a/pydantic/json_schema.py @@ -1262,6 +1262,7 @@ class GenerateJsonSchema: alias = alias_path[0] if not isinstance(alias, str): continue #...
SlidePlaceholders.__len__ returns incorrect count #### Description The `len()` function on `SlidePlaceholders` objects returns a count that is off by one. When calling `len(slide.placeholders)`, the returned value is one less than the actual number of placeholders present. #### Steps/Code to Reproduce ```python fro...
diff --git a/src/pptx/shapes/shapetree.py b/src/pptx/shapes/shapetree.py index 29623f1..59b2635 100644 --- b/src/pptx/shapes/shapetree.py +++ a/src/pptx/shapes/shapetree.py @@ -797,7 +797,7 @@ class SlidePlaceholders(ParentedElementProxy): def __len__(self) -> int: """Return count of placeholder shapes....
PSStackParser.pop() returns incorrect number of elements When calling `pop(n)` on PSStackParser, the method returns `n+1` elements instead of the expected `n` elements due to an off-by-one error in the slicing operation. #### Steps/Code to Reproduce ```python from pdfminer.psparser import PSStackParser # Create a p...
diff --git a/pdfminer/psparser.py b/pdfminer/psparser.py index b486956..76d2355 100755 --- b/pdfminer/psparser.py +++ a/pdfminer/psparser.py @@ -449,9 +449,25 @@ class PSBaseParser: self.oct += c return i + 1 + elif self.oct: + chrcode = int(self.oct, 8) + assert...
BitStringPayloadDecoder missing inheritance from AbstractSimplePayloadDecoder #### Description The `BitStringPayloadDecoder` class is missing its inheritance from `AbstractSimplePayloadDecoder`, causing various decoding operations to fail. #### Steps/Code to Reproduce ```python from pyasn1.codec.ber import decoder ...
diff --git a/pyasn1/codec/ber/decoder.py b/pyasn1/codec/ber/decoder.py index 7e69ca1..3418e33 100644 --- b/pyasn1/codec/ber/decoder.py +++ a/pyasn1/codec/ber/decoder.py @@ -158,7 +158,7 @@ class BooleanPayloadDecoder(IntegerPayloadDecoder): self, asn1Spec, tagSet, value and 1 or 0, **options) -class Bi...
Post-load processors not being invoked during schema loading #### Description Post-load processors decorated with `@post_load` are not being executed when calling `schema.load()`. The processors are completely skipped, causing schemas that rely on post-load transformations to return raw dictionaries instead of proces...
diff --git a/src/marshmallow/schema.py b/src/marshmallow/schema.py index e21768e..c685f14 100644 --- b/src/marshmallow/schema.py +++ a/src/marshmallow/schema.py @@ -893,13 +893,23 @@ class Schema(base.SchemaABC, metaclass=SchemaMeta): errors = error_store.errors # Run post processors ...
# Chart data not updating correctly when modifying Excel data I'm having an issue with updating chart data in PowerPoint presentations. When I try to update the Excel data for a chart, it's not working as expected. ## Problem Description When trying to update the Excel data for a chart using the `update_from_xlsx_bl...
diff --git a/src/pptx/parts/chart.py b/src/pptx/parts/chart.py index 7208071..477f2c2 100644 --- b/src/pptx/parts/chart.py +++ a/src/pptx/parts/chart.py @@ -69,10 +69,10 @@ class ChartWorkbook(object): there isn't one. """ xlsx_part = self.xlsx_part - if xlsx_part is not None: + ...
# Parallel execution module breaks with recent changes ## Description I've discovered an issue with the `Parallel` class in the `dspy.predict.parallel` module. After recent changes, the parallel execution functionality is completely broken. The module is unable to process examples correctly, resulting in AttributeErr...
diff --git a/dspy/predict/parallel.py b/dspy/predict/parallel.py index 03a4235..78eb22e 100644 --- b/dspy/predict/parallel.py +++ a/dspy/predict/parallel.py @@ -30,60 +30,44 @@ class Parallel: self.failed_examples = [] self.exceptions = [] - def forward(self, exec_pairs: List[Tuple[Any, Example]]...
Parser fails to parse arithmetic expressions with multiplication and division operators #### Description When parsing SQL expressions containing multiplication (`*`) or division (`/`) operators, the parser returns incomplete expressions, missing the right-hand side of the operation. #### Steps/Code to Reproduce ```...
diff --git a/sqlglot/parser.py b/sqlglot/parser.py index 248a128..55a0467 100644 --- b/sqlglot/parser.py +++ a/sqlglot/parser.py @@ -4888,8 +4888,6 @@ class Parser(metaclass=_Parser): parse_method = self._parse_exponent if self.EXPONENT else self._parse_unary this = parse_method() - return th...
TokenList inheritance broken - TypeError on object initialization #### Description After recent changes, TokenList objects fail to initialize properly, causing widespread failures across the codebase. The issue appears to be related to inheritance changes in the TokenList class. #### Steps/Code to Reproduce ```pyth...
diff --git a/sqlparse/sql.py b/sqlparse/sql.py index 1037375..a1d99a4 100644 --- b/sqlparse/sql.py +++ a/sqlparse/sql.py @@ -148,7 +148,7 @@ class Token: return False -class TokenList(): +class TokenList(Token): """A group of tokens. It has an additional instance attribute ``tokens`` which hold...
Group.command decorator returns None instead of command object When using the `@group.command` decorator, it now returns `None` instead of the command object. This breaks code that expects to get the command back from the decorator. #### Steps/Code to Reproduce ```python import click @click.group() def grp(): p...
diff --git a/src/click/core.py b/src/click/core.py index abe9fa9..eeb3bba 100644 --- b/src/click/core.py +++ a/src/click/core.py @@ -1592,9 +1592,9 @@ class Group(Command): kwargs["cls"] = self.command_class def decorator(f: t.Callable[..., t.Any]) -> Command: - cmd: Command = command...
Multiplexer range generation broken for consecutive IDs #### Description When working with DBC files containing multiplexed signals, the multiplexer range generation logic produces incorrect results for consecutive multiplexer IDs. This affects signal tree generation and causes issues when loading certain DBC files w...
diff --git a/src/cantools/database/can/formats/dbc.py b/src/cantools/database/can/formats/dbc.py index a5b6092..bc3b23e 100644 --- b/src/cantools/database/can/formats/dbc.py +++ a/src/cantools/database/can/formats/dbc.py @@ -995,16 +995,17 @@ def _create_mux_ranges(multiplexer_ids): """ ordered = sorted(mul...
TabStops.__delitem__ raises NameError when deleting tab stops #### Description When trying to delete a tab stop using `del tab_stops[idx]`, a NameError is raised because the variable `tabs` is referenced before it's defined. #### Steps/Code to Reproduce ```python from docx import Document from docx.shared import In...
diff --git a/src/docx/text/tabstops.py b/src/docx/text/tabstops.py index 824085d..86ad201 100644 --- b/src/docx/text/tabstops.py +++ a/src/docx/text/tabstops.py @@ -18,15 +18,16 @@ class TabStops(ElementProxy): self._pPr = element def __delitem__(self, idx): - - if len(tabs) == 0: - se...
After updating the language mappings in `gtts/langs.py`, I encountered an issue where several languages are not being processed correctly, resulting in unexpected errors. Specifically, when attempting to use the Text-to-Speech (TTS) functionality for a variety of languages, the system returns a 429 error, indicating "T...
diff --git a/gtts/langs.py b/gtts/langs.py index 5232ab1..2d351cd 100644 --- b/gtts/langs.py +++ a/gtts/langs.py @@ -44,9 +44,10 @@ _langs = { "ne": "Nepali", "nl": "Dutch", "no": "Norwegian", - "pa": "Punjabi", + "pa": "Punjabi (Gurmukhi)", "pl": "Polish", - "pt": "Portuguese", + "pt": ...
#### Description It seems there's an issue with the `compute_sec_ver` function in the `safety` module. When processing package versions, the function does not correctly handle the list of secure versions, leading to unexpected results in the remediation data. Specifically, the expected output for the `numpy` package d...
diff --git a/safety/models.py b/safety/models.py index 20a8188..1899850 100644 --- b/safety/models.py +++ a/safety/models.py @@ -185,34 +185,17 @@ class Package(DictConverter): Returns: List[str]: The list of supported versions. """ - if not versions: - return [] - -...
make_names_unique function returns None instead of database #### Description The `make_names_unique` function in the DBC format module is returning `None` instead of the modified database object, causing AttributeError when trying to access database attributes. #### Steps/Code to Reproduce ```python import cantools...
diff --git a/src/cantools/database/can/formats/dbc.py b/src/cantools/database/can/formats/dbc.py index a5b6092..35976c7 100644 --- b/src/cantools/database/can/formats/dbc.py +++ a/src/cantools/database/can/formats/dbc.py @@ -1899,11 +1899,11 @@ def make_names_unique(database, shorten_long_names): """ + make...
UnboundLocalError when decoding multiplexed CAN messages #### Description When trying to decode multiplexed CAN messages, an `UnboundLocalError` occurs with the message "local variable 'mux' referenced before assignment". This affects all operations involving multiplexed signals in CAN database messages. #### Steps/...
diff --git a/src/cantools/database/can/message.py b/src/cantools/database/can/message.py index 942b2cc..5eac549 100644 --- b/src/cantools/database/can/message.py +++ a/src/cantools/database/can/message.py @@ -722,6 +722,7 @@ class Message: assert_all_known) ...
ParseResults boolean evaluation broken after unpickling #### Description When a ParseResults object is unpickled, its boolean evaluation returns incorrect results. The `__bool__` method seems to behave differently for unpickled objects compared to fresh ones. #### Steps/Code to Reproduce ```python import pickle fro...
diff --git a/pyparsing/results.py b/pyparsing/results.py index 2458478..b1e2de9 100644 --- b/pyparsing/results.py +++ a/pyparsing/results.py @@ -267,7 +267,7 @@ class ParseResults: return len(self._toklist) def __bool__(self) -> bool: - return not (self._toklist and self._tokdict) + return...
BER encoder uses wrong typeId and tagSet when asn1Spec is provided #### Description When encoding ASN.1 values with an explicit `asn1Spec` parameter, the BER encoder incorrectly uses the `asn1Spec`'s `typeId` and `tagSet` instead of the value's own attributes. This causes encoding to fail or produce incorrect results...
diff --git a/pyasn1/codec/ber/encoder.py b/pyasn1/codec/ber/encoder.py index d16fb1f..288544a 100644 --- b/pyasn1/codec/ber/encoder.py +++ a/pyasn1/codec/ber/encoder.py @@ -824,9 +824,9 @@ class SingleItemEncoder(object): def __call__(self, value, asn1Spec=None, **options): try: if asn1Spec i...
# Alert groups not showing in console output Grafanalib version: latest from main branch ## Description When generating alert groups using the `print_alertgroup` function, the output is not being displayed in the console as expected. This affects the functionality of the `generate_alertgroup` command. ## Steps to r...
diff --git a/grafanalib/_gen.py b/grafanalib/_gen.py index 4094edf..315bd94 100644 --- b/grafanalib/_gen.py +++ a/grafanalib/_gen.py @@ -86,7 +86,7 @@ AlertGroup generation def print_alertgroup(dashboard): - write_dashboard(dashboard, stream=sys.stderr) + write_dashboard(dashboard, stream=sys.stdout) de...
Binary expression generation produces incorrect SQL for nested operations #### Description When generating SQL for nested binary expressions, the output is malformed due to incorrect handling of the expression tree traversal. #### Steps/Code to Reproduce ```python import sqlglot from sqlglot import parse_one # Tes...
diff --git a/sqlglot/generator.py b/sqlglot/generator.py index 34d2c0d..ba22479 100644 --- b/sqlglot/generator.py +++ a/sqlglot/generator.py @@ -3599,8 +3599,6 @@ class Generator(metaclass=_Generator): node = stack.pop() if type(node) is binary_type: - sqls.append(self.sql(nod...
Query bracket notation returns reversed field names #### Description When using bracket notation to access fields in TinyDB queries, the field names are being reversed. This causes queries to fail when trying to match documents with the expected field names. #### Steps/Code to Reproduce ```python from tinydb import...
diff --git a/tinydb/queries.py b/tinydb/queries.py index 0ef6a69..bd2e905 100644 --- b/tinydb/queries.py +++ a/tinydb/queries.py @@ -194,7 +194,15 @@ class Query(QueryInstance): return query def __getitem__(self, item: str): - return self.__getattr__(item[::-1]) + # A different syntax for ...
SFTP file seek operations with negative offsets produce incorrect positioning When using SFTP file operations with negative offsets in `seek()` calls, the file position is calculated incorrectly. This affects operations like seeking backwards from the current position (`SEEK_CUR`) or from the end of file (`SEEK_END`)....
diff --git a/paramiko/sftp_file.py b/paramiko/sftp_file.py index c74695e..9181c89 100644 --- b/paramiko/sftp_file.py +++ a/paramiko/sftp_file.py @@ -261,14 +261,15 @@ class SFTPFile(BufferedFile): See `file.seek` for details. """ + self.flush() if whence == self.SEEK_SET: ...
PackURI filename_index and relative_reference methods return incorrect values #### Description The `PackURI` class methods `filename_index` and `relative_reference` are returning incorrect values, causing issues with package URI handling and relative path computation. #### Steps/Code to Reproduce ```python from ppt...
diff --git a/src/pptx/opc/packuri.py b/src/pptx/opc/packuri.py index 74ddd33..a3353aa 100644 --- b/src/pptx/opc/packuri.py +++ a/src/pptx/opc/packuri.py @@ -65,13 +65,13 @@ class PackURI(str): """ filename = self.filename if not filename: - return 0 # Should be None for consistenc...
DatetimeIndex missing isocalendar method and _is_dates_only property #### Description After recent changes, DatetimeIndex no longer has the `isocalendar()` method and `_is_dates_only` property, causing AttributeError when these are accessed. #### Steps/Code to Reproduce ```python import pandas as pd from datetime i...
diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index 9adbaad..a4fcc3c 100644 --- b/pandas/core/indexes/datetimes.py +++ a/pandas/core/indexes/datetimes.py @@ -294,6 +294,11 @@ class DatetimeIndex(DatetimeTimedeltaMixin): arr = self._data.to_julian_date() return Index....