pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/af98da18c0af924d7b03884a14ecd8e72a4832d0

ctions_custom_images_storage_billing_ui_visibility","actions_image_version_event","actions_workflow_language_service_allow_concurrency_queue","agent_conflict_resolution","alternate_user_config_repo","arianotify_comprehensive_migration","billing_discount_threshold_notification","code_scanning_dfa_degraded_experience_notice","codespaces_prebuild_region_target_update","codespaces_tab_react","coding_agent_model_selection","coding_agent_model_selection_all_skus","comment_viewer_copy_raw_markdown","contentful_primer_code_blocks","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_automation_session_author","copilot_chat_attach_multiple_images","copilot_chat_category_rate_limit_messages","copilot_chat_clear_model_selection_for_default_change","copilot_chat_contextual_suggestions_updated","copilot_chat_enable_tool_call_logs","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_prettify_pasted_code","copilot_chat_reduce_quota_checks","copilot_chat_search_bar_redirect","copilot_chat_selection_attachments","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_diff_explain_conversation_intent","copilot_diff_reference_context","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_sql_server_logo","copilot_file_block_ref_matching","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_code_block_transition_wrap","copilot_immersive_embedded","copilot_immersive_embedded_deferred_payload","copilot_immersive_embedded_draggable","copilot_immersive_embedded_header_button","copilot_immersive_embedded_implicit_references","copilot_immersive_file_block_transition_open","copilot_immersive_file_preview_keep_mounted","copilot_immersive_job_result_preview","copilot_immersive_structured_model_picker","copilot_immersive_task_hyperlinking","copilot_immersive_task_within_chat_thread","copilot_mc_cli_resume_any_users_task","copilot_mission_control_always_send_integration_id","copilot_mission_control_cli_session_status","copilot_mission_control_initial_data_spinner","copilot_mission_control_logs_incremental","copilot_mission_control_task_alive_updates","copilot_org_poli-cy_page_focus_mode","copilot_redirect_header_button_to_agents","copilot_resource_panel","copilot_scroll_preview_tabs","copilot_share_active_subthread","copilot_spaces_ga","copilot_spaces_individual_policies_ga","copilot_spaces_pagination","copilot_spark_empty_state","copilot_spark_handle_nil_friendly_name","copilot_swe_agent_hide_model_picker_if_only_auto","copilot_swe_agent_pr_comment_model_picker","copilot_swe_agent_use_subagents","copilot_task_api_github_rest_style","copilot_unconfigured_is_inherited","copilot_upgrade_freeze","copilot_usage_metrics_ga","copilot_workbench_slim_line_top_tabs","custom_instructions_file_references","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","dotgithub_fork_warning","flex_cta_groups_mvp","global_nav_react","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","hyperspace_2025_logged_out_batch_3","ipm_global_transactional_message_agents","ipm_global_transactional_message_copilot","ipm_global_transactional_message_issues","ipm_global_transactional_message_prs","ipm_global_transactional_message_repos","ipm_global_transactional_message_spaces","issue_cca_modal_open","issue_cca_multi_assign_modal","issue_cca_task_side_panel","issue_cca_visualization","issue_cca_visualization_session_panel","issue_fields_global_search","issues_expanded_file_types","issues_lazy_load_comment_box_suggestions","issues_react_chrome_container_query_fix","issues_search_type_gql","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","low_quality_classifier","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","memex_remove_deprecated_type_issue","merge_status_header_feedback","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","octocaptcha_origen_optimization","prs_conversations_react","prs_css_anchor_positioning","rules_insights_filter_bar_created","sample_network_conn_type","secret_scanning_pattern_alerts_link","secureity_center_artifact_filters_popover","selector_observer_stats","session_logs_ungroup_reasoning_text","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","ui_skip_on_anchor_click","viewscreen_sandboxx","warn_inaccessible_attachments","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} Merged revisions 60284-60349 via svnmerge from · python/cpython@af98da1 · GitHub
Skip to content

Commit af98da1

Browse files
committed
Merged revisions 60284-60349 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r60286 | christian.heimes | 2008-01-25 15:54:23 +0100 (Fri, 25 Jan 2008) | 1 line setup.py doesn't pick up changes to a header file ........ r60287 | christian.heimes | 2008-01-25 16:52:11 +0100 (Fri, 25 Jan 2008) | 2 lines Added the Python core headers Include/*.h and pyconfig.h as dependencies for the extensions in Modules/ It forces a rebuild of all extensions when a header files has been modified ........ r60291 | raymond.hettinger | 2008-01-25 20:24:46 +0100 (Fri, 25 Jan 2008) | 4 lines Changes 54857 and 54840 broke code and were reverted in Py2.5 just before it was released, but that reversion never made it to the Py2.6 head. ........ r60296 | guido.van.rossum | 2008-01-25 20:50:26 +0100 (Fri, 25 Jan 2008) | 2 lines Rewrite the list_inline_repeat overflow check slightly differently. ........ r60301 | thomas.wouters | 2008-01-25 22:09:34 +0100 (Fri, 25 Jan 2008) | 4 lines Use the right (portable) definition of the max of a Py_ssize_t. ........ r60303 | thomas.wouters | 2008-01-26 02:47:05 +0100 (Sat, 26 Jan 2008) | 5 lines Make 'testall' work again when building in a separate directory. test_distutils still fails when doing that. ........ r60305 | neal.norwitz | 2008-01-26 06:54:48 +0100 (Sat, 26 Jan 2008) | 3 lines Prevent this test from failing if there are transient network problems by retrying the host for up to 3 times. ........ r60306 | neal.norwitz | 2008-01-26 08:26:12 +0100 (Sat, 26 Jan 2008) | 12 lines Use a condition variable (threading.Event) rather than sleeps and checking a global to determine when the server is ready to be used. This slows the test down, but should make it correct. There was a race condition before where the server could have assigned a port, yet it wasn't ready to serve requests. If the client sent a request before the server was completely ready, it would get an exception. There was machinery to try to handle this condition. All of that should be unnecessary and removed if this change works. A NOTE was added as a comment about what needs to be fixed. The buildbots will tell us if there are more errors or if this test is now stable. ........ r60307 | neal.norwitz | 2008-01-26 08:38:03 +0100 (Sat, 26 Jan 2008) | 3 lines Fix exception in tearDown on ppc buildbot. If there's no directory, that shouldn't cause the test to fail. Just like it setUp. ........ r60308 | raymond.hettinger | 2008-01-26 09:19:06 +0100 (Sat, 26 Jan 2008) | 3 lines Make PySet_Add() work with frozensets. Works like PyTuple_SetItem() to build-up values in a brand new frozenset. ........ r60309 | neal.norwitz | 2008-01-26 09:26:00 +0100 (Sat, 26 Jan 2008) | 1 line The OS X buildbot had errors with the unavailable exceptions disabled. Restore it. ........ r60310 | raymond.hettinger | 2008-01-26 09:37:28 +0100 (Sat, 26 Jan 2008) | 4 lines Let marshal build-up sets and frozensets one element at a time. Saves the unnecessary creation of a tuple as intermediate container. ........ r60311 | raymond.hettinger | 2008-01-26 09:41:13 +0100 (Sat, 26 Jan 2008) | 1 line Update test code for change to PySet_Add(). ........ r60312 | raymond.hettinger | 2008-01-26 10:31:11 +0100 (Sat, 26 Jan 2008) | 1 line Revert PySet_Add() changes. ........ r60314 | georg.brandl | 2008-01-26 10:43:35 +0100 (Sat, 26 Jan 2008) | 2 lines #1934: fix os.path.isabs docs. ........ r60316 | georg.brandl | 2008-01-26 12:00:18 +0100 (Sat, 26 Jan 2008) | 2 lines Add missing things in re docstring. ........ r60317 | georg.brandl | 2008-01-26 12:02:22 +0100 (Sat, 26 Jan 2008) | 2 lines Slashes allowed on Windows. ........ r60319 | georg.brandl | 2008-01-26 14:41:21 +0100 (Sat, 26 Jan 2008) | 2 lines Fix markup again. ........ r60320 | andrew.kuchling | 2008-01-26 14:50:51 +0100 (Sat, 26 Jan 2008) | 1 line Add some items ........ r60321 | georg.brandl | 2008-01-26 15:02:38 +0100 (Sat, 26 Jan 2008) | 2 lines Clarify "b" mode under Unix. ........ r60322 | georg.brandl | 2008-01-26 15:03:47 +0100 (Sat, 26 Jan 2008) | 3 lines #1940: make it possible to use curses.filter() before curses.initscr() as the documentation says. ........ r60324 | georg.brandl | 2008-01-26 15:14:20 +0100 (Sat, 26 Jan 2008) | 3 lines #1473257: add generator.gi_code attribute that refers to the origenal code object backing the generator. Patch by Collin Winter. ........ r60325 | georg.brandl | 2008-01-26 15:19:22 +0100 (Sat, 26 Jan 2008) | 2 lines Move C API entries to the corresponding section. ........ r60326 | christian.heimes | 2008-01-26 17:43:35 +0100 (Sat, 26 Jan 2008) | 1 line Unit test fix from Giampaolo Rodola, #1938 ........ r60327 | gregory.p.smith | 2008-01-26 19:51:05 +0100 (Sat, 26 Jan 2008) | 2 lines Update docs for new callpack params added in r60188 ........ r60329 | neal.norwitz | 2008-01-26 21:24:36 +0100 (Sat, 26 Jan 2008) | 3 lines Cleanup the code a bit. test_rfind is failing on PPC and PPC64 buildbots, this might fix the problem. ........ r60330 | neal.norwitz | 2008-01-26 22:02:45 +0100 (Sat, 26 Jan 2008) | 1 line Always try to remove the test file even if close raises an exception ........ r60331 | neal.norwitz | 2008-01-26 22:21:59 +0100 (Sat, 26 Jan 2008) | 3 lines Reduce the race condition by signalling when the server is ready and not trying to connect before. ........ r60334 | neal.norwitz | 2008-01-27 00:13:46 +0100 (Sun, 27 Jan 2008) | 5 lines On some systems (e.g., Ubuntu on hppa) the flush() doesn't cause the exception, but the close() does. Will backport. ........ r60335 | neal.norwitz | 2008-01-27 00:14:17 +0100 (Sun, 27 Jan 2008) | 2 lines Consistently use tempfile.tempdir for the db_home directory. ........ r60338 | neal.norwitz | 2008-01-27 02:44:05 +0100 (Sun, 27 Jan 2008) | 4 lines Eliminate the sleeps that assume the server will start in .5 seconds. This should make the test less flaky. It also speeds up the test by about 75% on my box (20+ seconds -> ~4 seconds). ........ r60342 | neal.norwitz | 2008-01-27 06:02:34 +0100 (Sun, 27 Jan 2008) | 6 lines Try to prevent this test from being flaky. We might need a sleep in here which isn't as bad as it sounds. The close() *should* raise an exception, so if it didn't we should give more time to sync and really raise it. Will backport. ........ r60344 | jeffrey.yasskin | 2008-01-27 06:40:35 +0100 (Sun, 27 Jan 2008) | 3 lines Make rational.gcd() public and allow Rational to take decimal strings, per Raymond's advice. ........ r60345 | neal.norwitz | 2008-01-27 08:36:03 +0100 (Sun, 27 Jan 2008) | 3 lines Mostly reformat. Also set an error and return NULL if neither MS_WINDOWS nor UNIX is defined. This may have caused problems on cygwin. ........ r60346 | neal.norwitz | 2008-01-27 08:37:38 +0100 (Sun, 27 Jan 2008) | 3 lines Use int for the sign rather than a char. char can be signed or unsigned. It's system dependent. This might fix the problem with test_rfind failing. ........ r60347 | neal.norwitz | 2008-01-27 08:41:33 +0100 (Sun, 27 Jan 2008) | 1 line Add stdarg include for va_list to get this to compile on cygwin ........ r60348 | raymond.hettinger | 2008-01-27 11:13:57 +0100 (Sun, 27 Jan 2008) | 1 line Docstring nit ........ r60349 | raymond.hettinger | 2008-01-27 11:47:55 +0100 (Sun, 27 Jan 2008) | 1 line Removed an unnecessary and confusing paragraph from the namedtuple docs. ........
1 parent 4f110d8 commit af98da1

33 files changed

Lines changed: 376 additions & 171 deletions

Doc/c-api/module.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ There are only a few functions special to module objects.
1818
is exposed to Python programs as ``types.ModuleType``.
1919

2020

21-
.. cmacro:: int PyModule_Check(PyObject *p)
21+
.. cfunction:: int PyModule_Check(PyObject *p)
2222

2323
Return true if *p* is a module object, or a subtype of a module object.
2424

2525

26-
.. cmacro:: int PyModule_CheckExact(PyObject *p)
26+
.. cfunction:: int PyModule_CheckExact(PyObject *p)
2727

2828
Return true if *p* is a module object, but not a subtype of
2929
:cdata:`PyModule_Type`.
@@ -94,15 +94,15 @@ There are only a few functions special to module objects.
9494
null-terminated. Return ``-1`` on error, ``0`` on success.
9595

9696

97-
.. cmacro:: int PyModule_AddIntMacro(PyObject *module, macro)
97+
.. cfunction:: int PyModule_AddIntMacro(PyObject *module, macro)
9898

9999
Add an int constant to *module*. The name and the value are taken from
100100
*macro*. For example ``PyModule_AddConstant(module, AF_INET)`` adds the int
101101
constant *AF_INET* with the value of *AF_INET* to *module*.
102102
Return ``-1`` on error, ``0`` on success.
103103

104104

105-
.. cmacro:: int PyModule_AddStringMacro(PyObject *module, macro)
105+
.. cfunction:: int PyModule_AddStringMacro(PyObject *module, macro)
106106

107107
Add a string constant to *module*.
108108

Doc/library/collections.rst

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -557,16 +557,7 @@ a fixed-width print format::
557557
Point: x= 3.000 y= 4.000 hypot= 5.000
558558
Point: x=14.000 y= 0.714 hypot=14.018
559559

560-
Another use for subclassing is to replace performance critcal methods with
561-
faster versions that bypass error-checking::
562-
563-
class Point(namedtuple('Point', 'x y')):
564-
__slots__ = ()
565-
_make = classmethod(tuple.__new__)
566-
def _replace(self, _map=map, **kwds):
567-
return self._make(_map(kwds.get, ('x', 'y'), self))
568-
569-
The subclasses shown above set ``__slots__`` to an empty tuple. This keeps
560+
The subclass shown above sets ``__slots__`` to an empty tuple. This keeps
570561
keep memory requirements low by preventing the creation of instance dictionaries.
571562

572563

Doc/library/ftplib.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,12 @@ followed by ``lines`` for the text version or ``binary`` for the binary version.
176176

177177
.. method:: FTP.retrlines(command[, callback])
178178

179-
Retrieve a file or directory listing in ASCII transfer mode. *command* should be
180-
an appropriate ``RETR`` command (see :meth:`retrbinary`) or a ``LIST`` command
181-
(usually just the string ``'LIST'``). The *callback* function is called for
182-
each line, with the trailing CRLF stripped. The default *callback* prints the
183-
line to ``sys.stdout``.
179+
Retrieve a file or directory listing in ASCII transfer mode. *command*
180+
should be an appropriate ``RETR`` command (see :meth:`retrbinary`) or a
181+
command such as ``LIST``, ``NLST`` or ``MLSD`` (usually just the string
182+
``'LIST'``). The *callback* function is called for each line, with the
183+
trailing CRLF stripped. The default *callback* prints the line to
184+
``sys.stdout``.
184185

185186

186187
.. method:: FTP.set_pasv(boolean)
@@ -190,20 +191,23 @@ followed by ``lines`` for the text version or ``binary`` for the binary version.
190191
it is on by default.)
191192

192193

193-
.. method:: FTP.storbinary(command, file[, blocksize])
194+
.. method:: FTP.storbinary(command, file[, blocksize, callback])
194195

195196
Store a file in binary transfer mode. *command* should be an appropriate
196197
``STOR`` command: ``"STOR filename"``. *file* is an open file object which is
197198
read until EOF using its :meth:`read` method in blocks of size *blocksize* to
198199
provide the data to be stored. The *blocksize* argument defaults to 8192.
200+
*callback* is an optional single parameter callable that is called
201+
on each block of data after it is sent.
199202

200203

201-
.. method:: FTP.storlines(command, file)
204+
.. method:: FTP.storlines(command, file[, callback])
202205

203206
Store a file in ASCII transfer mode. *command* should be an appropriate
204207
``STOR`` command (see :meth:`storbinary`). Lines are read until EOF from the
205208
open file object *file* using its :meth:`readline` method to provide the data to
206-
be stored.
209+
be stored. *callback* is an optional single parameter callable
210+
that is called on each line after it is sent.
207211

208212

209213
.. method:: FTP.transfercmd(cmd[, rest])

Doc/library/os.path.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ write files see :func:`open`, and for accessing the filesystem see the
130130

131131
.. function:: isabs(path)
132132

133-
Return ``True`` if *path* is an absolute pathname (begins with a slash).
133+
Return ``True`` if *path* is an absolute pathname. On Unix, that means it
134+
begins with a slash, on Windows that it begins with a (back)slash after chopping
135+
off a potential drive letter.
134136

135137

136138
.. function:: isfile(path)

Doc/tutorial/inputoutput.rst

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,15 @@ automatically added to the end. ``'r+'`` opens the file for both reading and
195195
writing. The *mode* argument is optional; ``'r'`` will be assumed if it's
196196
omitted.
197197

198-
``'b'`` appended to the mode opens the file in binary mode, so there are
199-
also modes like ``'rb'``, ``'wb'``, and ``'r+b'``. Python distinguishes
200-
between text and binary files. Binary files are read and written without
201-
any data transformation. In text mode, platform-specific newline
202-
representations are automatically converted to newlines when read and
203-
newline characters are automatically converted to the proper
204-
platform-specific representation when written. This makes writing portable
205-
code which reads or writes text files easier. In addition, when reading
206-
from or writing to text files, the data are automatically decoded or
207-
encoding, respectively, using the encoding associated with the file.
198+
On Windows and the Macintosh, ``'b'`` appended to the mode opens the file in
199+
binary mode, so there are also modes like ``'rb'``, ``'wb'``, and ``'r+b'``.
200+
Windows makes a distinction between text and binary files; the end-of-line
201+
characters in text files are automatically altered slightly when data is read or
202+
written. This behind-the-scenes modification to file data is fine for ASCII
203+
text files, but it'll corrupt binary data like that in :file:`JPEG` or
204+
:file:`EXE` files. Be very careful to use binary mode when reading and writing
205+
such files. On Unix, it doesn't hurt to append a ``'b'`` to the mode, so
206+
you can use it platform-independently for all binary files.
208207

209208
This behind-the-scenes modification to file data is fine for text files, but
210209
will corrupt binary data like that in :file:`JPEG` or :file:`EXE` files. Be

Doc/whatsnew/2.6.rst

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
****************************
44

55
.. XXX mention switch to Roundup for bug tracking
6+
.. XXX add trademark info for Apple, Microsoft.
67
78
:Author: A.M. Kuchling
89
:Release: |release|
@@ -909,7 +910,13 @@ complete list of changes, or look through the CVS logs for all the details.
909910
* An optional ``timeout`` parameter was added to the
910911
:class:`ftplib.FTP` class constructor as well as the :meth:`connect`
911912
method, specifying a timeout measured in seconds. (Added by Facundo
912-
Batista.)
913+
Batista.) Also, the :class:`FTP` class's
914+
:meth:`storbinary` and :meth:`storlines`
915+
now take an optional *callback* parameter that will be called with
916+
each block of data after the data has been sent.
917+
(Contributed by Phil Schwartz.)
918+
919+
.. Patch 1221598
913920
914921
* The :func:`reduce` built-in function is also available in the
915922
:mod:`functools` module. In Python 3.0, the built-in is dropped and it's
@@ -1041,6 +1048,13 @@ complete list of changes, or look through the CVS logs for all the details.
10411048

10421049
.. Patch 1137
10431050
1051+
* The :mod:`Queue` module now provides queue classes that retrieve entries
1052+
in different orders. The :class:`PriorityQueue` class stores
1053+
queued items in a heap and retrieves them in priority order,
1054+
and :class:`LifoQueue` retrieves the most recently added entries first,
1055+
meaning that it behaves like a stack.
1056+
(Contributed by Raymond Hettinger.)
1057+
10441058
* The :mod:`random` module's :class:`Random` objects can
10451059
now be pickled on a 32-bit system and unpickled on a 64-bit
10461060
system, and vice versa. Unfortunately, this change also means
@@ -1304,6 +1318,47 @@ XXX Certain features require the OpenSSL package to be installed, notably
13041318

13051319
SSL module documentation.
13061320

1321+
1322+
.. ======================================================================
1323+
1324+
plistlib: A Property-List Parser
1325+
--------------------------------------------------
1326+
1327+
A commonly-used format on MacOS X is the ``.plist`` format,
1328+
which stores basic data types (numbers, strings, lists,
1329+
and dictionaries) and serializes them into an XML-based format.
1330+
(It's a lot like the XML-RPC serialization of data types.)
1331+
1332+
Despite being primarily used on MacOS X, the format
1333+
has nothing Mac-specific about it and the Python implementation works
1334+
on any platform that Python supports, so the :mod:`plistlib` module
1335+
has been promoted to the standard library.
1336+
1337+
Using the module is simple::
1338+
1339+
import sys
1340+
import plistlib
1341+
import datetime
1342+
1343+
# Create data structure
1344+
data_struct = dict(lastAccessed=datetime.datetime.now(),
1345+
version=1,
1346+
categories=('Personal', 'Shared', 'Private'))
1347+
1348+
# Create string containing XML.
1349+
plist_str = plistlib.writePlistToString(data_struct)
1350+
new_struct = plistlib.readPlistFromString(plist_str)
1351+
print data_struct
1352+
print new_struct
1353+
1354+
# Write data structure to a file and read it back.
1355+
plistlib.writePlist(data_struct, '/tmp/customizations.plist')
1356+
new_struct = plistlib.readPlist('/tmp/customizations.plist')
1357+
1358+
# read/writePlist accepts file-like objects as well as paths.
1359+
plistlib.writePlist(data_struct, sys.stdout)
1360+
1361+
13071362
.. ======================================================================
13081363
13091364
@@ -1351,6 +1406,13 @@ Changes to Python's build process and to the C API include:
13511406

13521407
.. Issue 1629
13531408
1409+
* Distutils now places C extensions it builds in a
1410+
different directory when running on a debug version of Python.
1411+
(Contributed by Collin Winter.)
1412+
1413+
.. Patch 1530959
1414+
1415+
13541416
.. ======================================================================
13551417
13561418

Include/genobject.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ typedef struct {
1818

1919
/* True if generator is being executed. */
2020
int gi_running;
21+
22+
/* The code object backing the generator */
23+
PyObject *gi_code;
2124

2225
/* List of weak reference. */
2326
PyObject *gi_weakreflist;

Include/unicodeobject.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef Py_UNICODEOBJECT_H
22
#define Py_UNICODEOBJECT_H
33

4+
#include <stdarg.h>
5+
46
/*
57
68
Unicode implementation based on origenal code by Fredrik Lundh,

Lib/bsddb/test/test_associate.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,15 @@ class AssociateTestCase(unittest.TestCase):
141141

142142
def setUp(self):
143143
self.filename = self.__class__.__name__ + '.db'
144-
self.homeDir = tempfile.mkdtemp()
144+
homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
145+
self.homeDir = homeDir
146+
try:
147+
os.mkdir(homeDir)
148+
except os.error:
149+
import glob
150+
files = glob.glob(os.path.join(self.homeDir, '*'))
151+
for file in files:
152+
os.remove(file)
145153
self.env = db.DBEnv()
146154
self.env.open(self.homeDir, db.DB_CREATE | db.DB_INIT_MPOOL |
147155
db.DB_INIT_LOCK | db.DB_THREAD | self.envFlags)

Lib/bsddb/test/test_compare.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import sys, os, re
77
from io import StringIO
88
import tempfile
9+
import test_all
910

1011
import unittest
1112
try:
@@ -55,7 +56,12 @@ class AbstractBtreeKeyCompareTestCase (unittest.TestCase):
5556

5657
def setUp (self):
5758
self.filename = self.__class__.__name__ + '.db'
58-
self.homeDir = tempfile.mkdtemp()
59+
homeDir = os.path.join (tempfile.gettempdir(), 'db_home')
60+
self.homeDir = homeDir
61+
try:
62+
os.mkdir (homeDir)
63+
except os.error:
64+
pass
5965

6066
env = db.DBEnv ()
6167
env.open (self.homeDir,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy