Skip to content

Termios module largely untested #81002

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

Closed
tonybaloney mannequin opened this issue May 6, 2019 · 4 comments
Closed

Termios module largely untested #81002

tonybaloney mannequin opened this issue May 6, 2019 · 4 comments
Assignees
Labels
3.11 only security fixes 3.12 only security fixes 3.13 bugs and security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@tonybaloney
Copy link
Mannequin

tonybaloney mannequin commented May 6, 2019

BPO 36821
Nosy @tonybaloney

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 = 'https://github.com/tonybaloney'
closed_at = None
created_at = <Date 2019-05-06.22:47:32.674>
labels = ['3.8', 'type-feature', 'tests']
title = 'Termios module largely untested'
updated_at = <Date 2019-05-06.22:47:59.957>
user = 'https://github.com/tonybaloney'

bugs.python.org fields:

activity = <Date 2019-05-06.22:47:59.957>
actor = 'anthonypjshaw'
assignee = 'anthonypjshaw'
closed = False
closed_date = None
closer = None
components = ['Tests']
creation = <Date 2019-05-06.22:47:32.674>
creator = 'anthonypjshaw'
dependencies = []
files = []
hgrepos = []
issue_num = 36821
keywords = []
message_count = 2.0
messages = ['341656', '341657']
nosy_count = 1.0
nosy_names = ['anthonypjshaw']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue36821'
versions = ['Python 3.8']

Linked PRs

@tonybaloney
Copy link
Mannequin Author

tonybaloney mannequin commented May 6, 2019

I noticed that the termios.c module is largely untested.

There is some coverage via test_pty, test_ioctl and test_getpass, but there is nothing to cover regression and the behaviours in the module functions.

Tests are required for:

  • termios.tcgetattr()
  • termios.tcsetattr()
  • termios.tcsendbreak()
  • termios.tcdrain()
  • termios.tcflush()
  • termios.tcflow()

@tonybaloney tonybaloney mannequin added the 3.8 (EOL) end of life label May 6, 2019
@tonybaloney tonybaloney mannequin self-assigned this May 6, 2019
@tonybaloney tonybaloney mannequin added tests Tests in the Lib/test dir type-feature A feature request or enhancement labels May 6, 2019
@tonybaloney
Copy link
Mannequin Author

tonybaloney mannequin commented May 6, 2019

This could be a good issue for the PyCon sprints, otherwise I'm happy to implement it

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@sobolevn sobolevn self-assigned this Oct 5, 2023
@erlend-aasland erlend-aasland added 3.11 only security fixes 3.12 only security fixes 3.13 bugs and security fixes type-bug An unexpected behavior, bug, or error and removed 3.8 (EOL) end of life type-feature A feature request or enhancement labels Oct 5, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Oct 5, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 10, 2023
(cherry picked from commit 92a9e98)

Co-authored-by: Serhiy Storchaka <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 10, 2023
(cherry picked from commit 92a9e98)

Co-authored-by: Serhiy Storchaka <[email protected]>
ambv pushed a commit that referenced this issue Oct 10, 2023
(cherry picked from commit 92a9e98)

Co-authored-by: Serhiy Storchaka <[email protected]>
ambv pushed a commit that referenced this issue Oct 10, 2023
(cherry picked from commit 92a9e98)

Co-authored-by: Serhiy Storchaka <[email protected]>
@andypost
Copy link

andypost commented Jan 22, 2024

Building on Alpinelinux one case constantly fails for 3.11.7 and 3.12.1

Re-running test_termios in verbose mode (matching: test_tcgetattr)
test_tcgetattr (test.test_termios.TestFunctions.test_tcgetattr) ... FAIL

======================================================================
FAIL: test_tcgetattr (test.test_termios.TestFunctions.test_tcgetattr)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builds/alpine/aports/main/python3/src/Python-3.11.7/Lib/test/test_termios.py", line 42, in test_tcgetattr
    self.assertEqual(termios.tcgetattr(self.stream), attrs)
AssertionError: Lists differ: [1280[227 chars]', b'P', b'\xed', b'\x1a', b'\xf7', b'*', b'z'[18 chars]'(']] != [1280[227 chars]', b'\x01', b'\x00', b'\x00', b'\x00', b' ', b[27 chars]d8']]

First differing element 6:
[b'\x[197 chars]', b'P', b'\xed', b'\x1a', b'\xf7', b'*', b'z'[17 chars]b'(']
[b'\x[197 chars]', b'\x01', b'\x00', b'\x00', b'\x00', b' ', b[26 chars]xd8']

  [1280,
   5,
   191,
   35387,
   15,
   15,
   [b'\x03',
    b'\x1c',
    b'\x7f',
    b'\x15',
    b'\x04',
    b'\x00',
    b'\x01',
    b'\x00',
    b'\x11',
    b'\x13',
    b'\x1a',
    b'\x00',
    b'\x12',
    b'\x0f',
    b'\x17',
    b'\x16',
    b'\x00',
    b'\x00',
    b'\x00',
    b'|',
    b'\xdc',
    b'\xc9',
    b'\xe7',
-   b'P',
-   b'\xed',
-   b'\x1a',
?        -

+   b'\x01',
?       +

+   b'\x00',
+   b'\x00',
+   b'\x00',
+   b' ',
+   b'\xd5',
+   b'$',
    b'\xf7',
+   b'\xd8']]
-   b'*',
-   b'z',
-   b'd',
-   b'\xf7',
-   b'(']]

----------------------------------------------------------------------
Ran 1 test in 0.003s

@erlend-aasland
Copy link
Contributor

@andypost, please open a new issue for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes 3.12 only security fixes 3.13 bugs and security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants