Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_file2k.py depends on sys.stdin being unseekable #67357

Closed
xnox mannequin opened this issue Jan 5, 2015 · 5 comments
Closed

test_file2k.py depends on sys.stdin being unseekable #67357

xnox mannequin opened this issue Jan 5, 2015 · 5 comments

Comments

@xnox
Copy link
Mannequin

xnox mannequin commented Jan 5, 2015

BPO 23168
Nosy @vstinner, @xnox
Files
  • issue23168.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2015-01-06.11:40:31.500>
    created_at = <Date 2015-01-05.12:18:38.895>
    labels = ['expert-installation']
    title = 'test_file2k.py depends on sys.stdin being unseekable'
    updated_at = <Date 2015-01-06.11:40:31.499>
    user = 'https://github.com/xnox'

    bugs.python.org fields:

    activity = <Date 2015-01-06.11:40:31.499>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-01-06.11:40:31.500>
    closer = 'vstinner'
    components = ['Installation']
    creation = <Date 2015-01-05.12:18:38.895>
    creator = 'xnox'
    dependencies = []
    files = ['37603']
    hgrepos = []
    issue_num = 23168
    keywords = ['patch']
    message_count = 5.0
    messages = ['233459', '233460', '233461', '233525', '233526']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'python-dev', 'xnox']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue23168'
    versions = ['Python 2.7']

    @xnox
    Copy link
    Mannequin Author

    xnox mannequin commented Jan 5, 2015

    # LD_LIBRARY_PATH=`pwd` ./python Lib/test/regrtest.py test_file2k </dev/null
    [1/1] test_file2k
    test test_file2k failed -- Traceback (most recent call last):
      File "/builddir/build/BUILD/Python-2.7.9/Lib/test/test_file2k.py", line 236, in testStdin
        self.assertRaises(IOError, sys.stdin.seek, -1)
    AssertionError: IOError not raised

    1 test failed:
    test_file2k

    I believe this is similar issue to http://bugs.python.org/issue14853

    @xnox xnox mannequin added the topic-installation label Jan 5, 2015
    @vstinner
    Copy link
    Member

    vstinner commented Jan 5, 2015

    Removing a test when it doesn't pass is not the correct way to fix a test...

    I would be better to write it differently to support seekable stdin. Or if it doesn't make sense, skip the test if stdin is seeable.

    @xnox
    Copy link
    Mannequin Author

    xnox mannequin commented Jan 5, 2015

    Removing a test when it doesn't pass is not the correct way to fix a test...

    Whilst I agree, this is not what was done in http://bugs.python.org/issue14853 . There it was concluded that the test itself is bogus and tests essentially nothing.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jan 6, 2015

    New changeset 7f30206d402f by Victor Stinner in branch '2.7':
    Issue bpo-23168: skip sys.stdin.seek() test if stdin is not a TTY
    https://hg.python.org/cpython/rev/7f30206d402f

    @vstinner
    Copy link
    Member

    vstinner commented Jan 6, 2015

    Instead of removing the test, I modified it to be skipped if stdin is not a TTY.

    @vstinner vstinner closed this as completed Jan 6, 2015
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant