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

bpo-36878: Only allow text after # type: ignore if first character ASCII #13504

Merged
merged 2 commits into from
May 22, 2019

Conversation

msullivan
Copy link
Contributor

@msullivan msullivan commented May 22, 2019

This disallows things like # type: ignoreé, which seems wrong.

Also switch to using Py_ISALNUM for the alnum check, for consistency
with other code (and maybe correctness re: locale issues?).

https://bugs.python.org/issue36878

… ASCII

This disallows things like `# type: ignoreé`, which seems wrong.

Also switch to using Py_ISALNUM for the alnum check, for consistency
with other code (and maybe correctness re: locale issues?).
@msullivan
Copy link
Contributor Author

@ilevkivskyi @gvanrossum last one in this sequence, I think!

@gvanrossum
Copy link
Member

Yeah, Py_ISALNUM uses a table that's hard-coded for ASCII, and that's what we want here.

@miss-islington
Copy link
Contributor

@msullivan: Status check is done, and it's a failure ❌ .

1 similar comment
@miss-islington
Copy link
Contributor

@msullivan: Status check is done, and it's a failure ❌ .

@miss-islington
Copy link
Contributor

@msullivan: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit d8a82e2 into python:master May 22, 2019
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot PPC64 Fedora 3.x has failed when building commit d8a82e2.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/53/builds/2977) and take a look at the build logs.
  4. Check if the failure is related to this commit (d8a82e2) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/53/builds/2977

Click to see traceback logs
From https://github.com/python/cpython
 * branch            master     -> FETCH_HEAD
Reset branch 'master'

Objects/obmalloc.c:1376:1: warning: ‘no_sanitize_thread’ attribute directive ignored [-Wattributes]
 {
 ^

test_winsound skipped -- No module named 'winsound'
test_msilib skipped -- No module named '_msi'
test_ttk_guionly skipped -- Tk unavailable due to TclError: no display name and no $DISPLAY environment variab [...]
test_kqueue skipped -- test works only on BSD
test_ossaudiodev skipped -- [Errno 2] No such file or directory: '/dev/dsp'
test_ioctl skipped -- Unable to open /dev/tty
/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/multiprocessing/resource_tracker.py:203: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: '//psm_5dba67b4': [Errno 2] No such file or directory: '//psm_5dba67b4'
  warnings.warn('resource_tracker: %r: %s' % (name, e))
test_startfile skipped -- object <module 'os' from '/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/os.py'> has no attribute 'startfile'
test_winreg skipped -- No module named 'winreg'
test_tk skipped -- Tk unavailable due to TclError: no display name and no $DISPLAY environment variab [...]
test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run
test_devpoll skipped -- test works only on Solaris OS family
test_tix skipped -- Tk unavailable due to TclError: no display name and no $DISPLAY environment variab [...]
stty: standard input: Inappropriate ioctl for device
test_winconsoleio skipped -- test only relevant on win32
test_flock (__main__.FNTLEINTRTest) ... ok
test_lockf (__main__.FNTLEINTRTest) ... ok
test_read (__main__.OSEINTRTest) ... ok
test_wait (__main__.OSEINTRTest) ... ok
test_wait3 (__main__.OSEINTRTest) ... ok
test_wait4 (__main__.OSEINTRTest) ... ok
test_waitpid (__main__.OSEINTRTest) ... ok
test_write (__main__.OSEINTRTest) ... ok
test_devpoll (__main__.SelectEINTRTest) ... skipped 'need select.devpoll'
test_epoll (__main__.SelectEINTRTest) ... ok
test_kqueue (__main__.SelectEINTRTest) ... skipped 'need select.kqueue'
test_poll (__main__.SelectEINTRTest) ... ok
test_select (__main__.SelectEINTRTest) ... ok
test_sigtimedwait (__main__.SignalEINTRTest) ... ok
test_sigwaitinfo (__main__.SignalEINTRTest) ... ok
test_accept (__main__.SocketEINTRTest) ... ok
test_open (__main__.SocketEINTRTest) ... ok
test_os_open (__main__.SocketEINTRTest) ... ok
test_recv (__main__.SocketEINTRTest) ... ok
test_recvmsg (__main__.SocketEINTRTest) ... ok
test_send (__main__.SocketEINTRTest) ... ok
test_sendall (__main__.SocketEINTRTest) ... ok
test_sendmsg (__main__.SocketEINTRTest) ... ok
test_sleep (__main__.TimeEINTRTest) ... ok

----------------------------------------------------------------------
Ran 24 tests in 6.805s

OK (skipped=2)
/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/support/__init__.py:1056: RuntimeWarning: tests may fail, unable to create temporary directory '/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/build/test_python_14579/worker_4106': [Errno 28] No space left on device: '/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/build/test_python_14579/worker_4106'
  with temp_dir(path=name, quiet=quiet) as temp_path:
/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/support/__init__.py:1057: RuntimeWarning: tests may fail, unable to change the current working directory to '/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/build/test_python_14579/worker_4106': [Errno 2] No such file or directory: '/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/build/test_python_14579/worker_4106'
  with change_cwd(temp_path, quiet=quiet) as cwd_dir:
/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/support/__init__.py:1056: RuntimeWarning: tests may fail, unable to create temporary directory '/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/build/test_python_14579/worker_6233': [Errno 28] No space left on device: '/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/build/test_python_14579/worker_6233'
  with temp_dir(path=name, quiet=quiet) as temp_path:
/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/support/__init__.py:1057: RuntimeWarning: tests may fail, unable to change the current working directory to '/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/build/test_python_14579/worker_6233': [Errno 2] No such file or directory: '/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/build/test_python_14579/worker_6233'
  with change_cwd(temp_path, quiet=quiet) as cwd_dir:
test_builtin_function (test.test_reprlib.LongReprTest) ... skipped 'needs a built-in function with a really long name'
test_class (test.test_reprlib.LongReprTest) ... ERROR
test_instance (test.test_reprlib.LongReprTest) ... ERROR
test_method (test.test_reprlib.LongReprTest) ... ERROR
test_module (test.test_reprlib.LongReprTest) ... ERROR
test_object (test.test_reprlib.LongReprTest) ... skipped 'need a suitable object'
test_type (test.test_reprlib.LongReprTest) ... ERROR
test_builtin_function (test.test_reprlib.ReprTests) ... ok
test_cell (test.test_reprlib.ReprTests) ... ok
test_container (test.test_reprlib.ReprTests) ... ok
test_descriptors (test.test_reprlib.ReprTests) ... ok
test_frozenset (test.test_reprlib.ReprTests) ... ok
test_instance (test.test_reprlib.ReprTests) ... ok
test_lambda (test.test_reprlib.ReprTests) ... ok
test_nesting (test.test_reprlib.ReprTests) ... ok
test_numbers (test.test_reprlib.ReprTests) ... ok
test_range (test.test_reprlib.ReprTests) ... ok
test_set_literal (test.test_reprlib.ReprTests) ... ok
test_string (test.test_reprlib.ReprTests) ... ok
test_tuple (test.test_reprlib.ReprTests) ... ok
test_unsortable (test.test_reprlib.ReprTests) ... ok
test_assigned_attributes (test.test_reprlib.TestRecursiveRepr) ... ok
test_recursive_repr (test.test_reprlib.TestRecursiveRepr) ... ok

======================================================================
ERROR: test_class (test.test_reprlib.LongReprTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/test_reprlib.py", line 231, in setUp
    os.mkdir(self.pkgname)
OSError: [Errno 28] No space left on device: 'areallylongpackageandmodulenametotestreprtruncation'

======================================================================
ERROR: test_instance (test.test_reprlib.LongReprTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/test_reprlib.py", line 231, in setUp
    os.mkdir(self.pkgname)
OSError: [Errno 28] No space left on device: 'areallylongpackageandmodulenametotestreprtruncation'

======================================================================
ERROR: test_method (test.test_reprlib.LongReprTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/test_reprlib.py", line 231, in setUp
    os.mkdir(self.pkgname)
OSError: [Errno 28] No space left on device: 'areallylongpackageandmodulenametotestreprtruncation'

======================================================================
ERROR: test_module (test.test_reprlib.LongReprTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/test_reprlib.py", line 231, in setUp
    os.mkdir(self.pkgname)
OSError: [Errno 28] No space left on device: 'areallylongpackageandmodulenametotestreprtruncation'

======================================================================
ERROR: test_type (test.test_reprlib.LongReprTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/test_reprlib.py", line 231, in setUp
    os.mkdir(self.pkgname)
OSError: [Errno 28] No space left on device: 'areallylongpackageandmodulenametotestreprtruncation'

----------------------------------------------------------------------

Ran 23 tests in 0.013s

FAILED (errors=5, skipped=2)
test test_reprlib failed
/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/support/__init__.py:1056: RuntimeWarning: tests may fail, unable to create temporary directory '/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/build/test_python_14579/worker_6852': [Errno 28] No space left on device: '/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/build/test_python_14579/worker_6852'
  with temp_dir(path=name, quiet=quiet) as temp_path:
/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/support/__init__.py:1057: RuntimeWarning: tests may fail, unable to change the current working directory to '/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/build/test_python_14579/worker_6852': [Errno 2] No such file or directory: '/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/build/test_python_14579/worker_6852'
  with change_cwd(temp_path, quiet=quiet) as cwd_dir:
test test_reprlib failed
make: *** [buildbottest] Error 2

@msullivan
Copy link
Contributor Author

Buildbot failure is an infrastructure failure, it looks like: OSError: [Errno 28] No space left on device: 'areallylongpackageandmodulenametotestreprtruncation'

@msullivan msullivan deleted the type_ignore_tweak branch May 22, 2019 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants