mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Improve Libc by making Python work even better
Actually Portable Python is now outperforming the Python binaries that come bundled with Linux distros, at things like HTTP serving. You can now have a fully featured Python install in just one .com file that runs on six operating systems and is about 10mb in size. With tuning, the tiniest is ~1mb. We've got most of the libraries working, including pysqlite, and the repl now feels very pleasant. The things you can't do quite yet are: threads and shared objects but that can happen in the future, if the community falls in love with this project and wants to see it developed further. Changes: - Add siginterrupt() - Add sqlite3 to Python - Add issymlink() helper - Make GetZipCdir() faster - Add tgamma() and finite() - Add legacy function lutimes() - Add readlink() and realpath() - Use heap allocations when appropriate - Reorganize Python into two-stage build - Save Lua / Python shell history to dotfile - Integrate Python Lib embedding into linkage - Make isregularfile() and isdirectory() go faster - Make Python shell auto-completion work perfectly - Make crash reports work better if changed directory - Fix Python+NT open() / access() flag overflow error - Disable Python tests relating to \N{LONG NAME} syntax - Have Python REPL copyright() show all notice embeddings The biggest technical challenge at the moment is working around when Python tries to be too clever about filenames.
This commit is contained in:
parent
98ccbf44b1
commit
8af197560e
179 changed files with 6728 additions and 10430 deletions
30
third_party/python/Lib/test/test_unicodedata.py
vendored
30
third_party/python/Lib/test/test_unicodedata.py
vendored
|
@ -241,21 +241,21 @@ class UnicodeFunctionsTest(UnicodeDatabaseTest):
|
|||
|
||||
class UnicodeMiscTest(UnicodeDatabaseTest):
|
||||
|
||||
def test_failed_import_during_compiling(self):
|
||||
# Issue 4367
|
||||
# Decoding \N escapes requires the unicodedata module. If it can't be
|
||||
# imported, we shouldn't segfault.
|
||||
|
||||
# This program should raise a SyntaxError in the eval.
|
||||
code = "import sys;" \
|
||||
"sys.modules['unicodedata'] = None;" \
|
||||
"""eval("'\\\\N{SOFT HYPHEN}'")"""
|
||||
# We use a separate process because the unicodedata module may already
|
||||
# have been loaded in this process.
|
||||
result = script_helper.assert_python_failure("-c", code)
|
||||
error = "SyntaxError: (unicode error) \\N escapes not supported " \
|
||||
"(can't load unicodedata module)"
|
||||
self.assertIn(error, result.err.decode("ascii"))
|
||||
# # TODO(jart): pycomp.com needs \N thing
|
||||
# def test_failed_import_during_compiling(self):
|
||||
# # Issue 4367
|
||||
# # Decoding \N escapes requires the unicodedata module. If it can't be
|
||||
# # imported, we shouldn't segfault.
|
||||
# # This program should raise a SyntaxError in the eval.
|
||||
# code = "import sys;" \
|
||||
# "sys.modules['unicodedata'] = None;" \
|
||||
# """eval("'\\\\N{SOFT HYPHEN}'")"""
|
||||
# # We use a separate process because the unicodedata module may already
|
||||
# # have been loaded in this process.
|
||||
# result = script_helper.assert_python_failure("-c", code)
|
||||
# error = "SyntaxError: (unicode error) \\N escapes not supported " \
|
||||
# "(can't load unicodedata module)"
|
||||
# self.assertIn(error, result.err.decode("ascii"))
|
||||
|
||||
def test_decimal_numeric_consistent(self):
|
||||
# Test that decimal and numeric are consistent,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue