GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Bug]: `itertools._tee_dataobject()` accepts `None` for `values` and fewer than three arguments · Issue #1252 · oracle/graalpython

[Bug]: itertools._tee_dataobject() accepts None for values and fewer than three arguments #1252

New issue
Copy link
New issue
Copy link
Open
#1263
Open
[Bug]: itertools._tee_dataobject() accepts None for values and fewer than three arguments#1252
#1263
Copy link
Labels
bugSomething isn't workingSomething isn't working

Description

@jseop-lim
jseop-lim
opened on Oct 31, 2026
Issue body actions

Describe the bug

itertools._tee_dataobject(it, None, None) creates an object on GraalPy, while CPython raises TypeError because values must be a list. Calls with fewer than three arguments are also accepted, where CPython requires exactly three.

Operating system

macOS

CPU architecture

ARM64

GraalPy version

master a3009f9 (Python 3.13.14); also reproduced on 25.1.3 (Python 3.12.8)

JDK version

No response

Context configuration

No response

Steps to reproduce

import itertools
print(type(itertools._tee_dataobject(iter([]), None, None)))
print(type(itertools._tee_dataobject(iter([]), [])))

GraalPy master a3009f9:

<class 'itertools._tee_dataobject'>
<class 'itertools._tee_dataobject'>

Expected behavior

CPython 3.13.14 (same on 3.12.13):

TypeError: teedataobject() argument 2 must be list, not None
TypeError: teedataobject expected 3 arguments, got 2

Stack trace

Additional context

_tee_dataobject(1) and _tee_dataobject() also create an object. _tee_dataobject(iter([]), None, 5) matches no specialization and fails with Unexpected values provided for TeeDataObjectBuiltinsFactory.InitNodeFactory.InitNodeGen instead of a TypeError.

Root Cause

TeeDataObjectBuiltins.InitNode requires only $self (minNumOfPositionalArgs = 1) and defaults values and nxt to None (TeeDataObjectBuiltins.java#L121-L124). Two isNone(values) specializations then treat None as an empty buffer (#L135-L153), and the TypeError specialization excludes None (#L184-L189). CPython checks for exactly three positional arguments, then rejects any non-list values (itertoolsmodule.c.h#L244-L251).

Fix Suggestion

Set minNumOfPositionalArgs = 4, remove the two isNone(values) specializations and their helper, and guard the TypeError specialization with !isList(values) alone.

Activity

  1. jseop-lim
    added
    bugSomething isn't workingSomething isn't working
    on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.