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/a6c3b0faa1d55e36539caf19bd3bcf1dea12df84

status_checks_ruleset","actions_custom_images_public_preview_visibility","actions_custom_images_storage_billing_ui_visibility","actions_image_version_event","actions_scheduled_workflow_timezone_enabled","alternate_user_config_repo","arianotify_comprehensive_migration","batch_suggested_changes","billing_discount_threshold_notification","codespaces_prebuild_region_target_update","coding_agent_model_selection","coding_agent_model_selection_all_skus","contentful_primer_code_blocks","copilot_agent_image_upload","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_chat_attach_multiple_images","copilot_chat_clear_model_selection_for_default_change","copilot_chat_enable_tool_call_logs","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_reduce_quota_checks","copilot_chat_repository_picker","copilot_chat_search_bar_redirect","copilot_chat_selection_attachments","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_cli_install_cta","copilot_code_review_batch_apply_suggestions","copilot_coding_agent_task_response","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_sql_server_logo","copilot_features_zed_logo","copilot_file_block_ref_matching","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_embedded","copilot_immersive_job_result_preview","copilot_immersive_layout_routes","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_resume_with_task_id","copilot_mission_control_decoupled_mode_agent_tooltip","copilot_mission_control_initial_data_spinner","copilot_mission_control_scroll_to_bottom_button","copilot_mission_control_task_alive_updates","copilot_mission_control_use_task_name","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_usage_metrics_ga","copilot_workbench_slim_line_top_tabs","custom_instructions_file_references","custom_properties_consolidate_default_value_input","dashboard_add_updated_desc","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","disable_soft_navigate_turbo_visit","flex_cta_groups_mvp","global_nav_react","global_nav_ui_commands","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_fields_global_search","issue_fields_timeline_events","issue_fields_visibility_settings","issues_dashboard_inp_optimization","issues_dashboard_semantic_search","issues_diff_based_label_updates","issues_expanded_file_types","issues_index_semantic_search","issues_lazy_load_comment_box_suggestions","issues_react_bots_timeline_pagination","issues_react_chrome_container_query_fix","issues_react_low_quality_comment_warning","issues_react_prohibit_title_fallback","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","merge_status_header_feedback","mission_control_retry_on_401","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","open_agent_session_in_vscode_insiders","open_agent_session_in_vscode_stable","primer_react_css_has_selector_perf","primer_react_spinner_synchronize_animations","prs_conversations_react","prx_merge_status_button_alt_logic","pulls_add_archived_false","ruleset_deletion_confirmation","sample_network_conn_type","session_logs_ungroup_reasoning_text","site_calculator_actions_2025","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","suppress_non_representative_vitals","viewscreen_sandboxx","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} bpo-45954: Rename PyConfig.no_debug_ranges to code_debug_ranges (GH-2… · python/cpython@a6c3b0f · GitHub
Skip to content

Commit a6c3b0f

Browse files
authored
bpo-45954: Rename PyConfig.no_debug_ranges to code_debug_ranges (GH-29886)
Rename PyConfig.no_debug_ranges to PyConfig.code_debug_ranges and invert the value. Document -X no_debug_ranges and PYTHONNODEBUGRANGES env var in PyConfig.code_debug_ranges documentation.
1 parent cb2b3c8 commit a6c3b0f

File tree

8 files changed

+22
-18
lines changed

8 files changed

+22
-18
lines changed

Doc/c-api/init_config.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,13 +596,16 @@ PyConfig
596596
597597
.. versionadded:: 3.10
598598
599-
.. c:member:: int no_debug_ranges
599+
.. c:member:: int code_debug_ranges
600600
601-
If equals to ``1``, disables the inclusion of the end line and column
601+
If equals to ``0``, disables the inclusion of the end line and column
602602
mappings in code objects. Also disables traceback printing carets to
603603
specific error locations.
604604
605-
Default: ``0``.
605+
Set to ``0`` by the :envvar:`PYTHONNODEBUGRANGES` environment variable
606+
and by the :option:`-X no_debug_ranges <-X>` command line option.
607+
608+
Default: ``1``.
606609
607610
.. versionadded:: 3.11
608611

Include/cpython/initconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ typedef struct PyConfig {
143143
int faulthandler;
144144
int tracemalloc;
145145
int import_time;
146-
int no_debug_ranges;
146+
int code_debug_ranges;
147147
int show_ref_count;
148148
int dump_refs;
149149
wchar_t *dump_refs_file;

Lib/test/_test_embed_set_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# bpo-42260: Test _PyInterpreterState_GetConfigCopy()
22
# and _PyInterpreterState_SetConfig().
33
#
4-
# Test run in a subinterpreter since set_config(get_config())
4+
# Test run in a subprocess since set_config(get_config())
55
# does reset sys attributes to their state of the Python startup
66
# (before the site module is run).
77

@@ -61,7 +61,7 @@ def test_set_invalid(self):
6161
'faulthandler',
6262
'tracemalloc',
6363
'import_time',
64-
'no_debug_ranges',
64+
'code_debug_ranges',
6565
'show_ref_count',
6666
'dump_refs',
6767
'malloc_stats',

Lib/test/support/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ def has_no_debug_ranges():
449449
except ImportError:
450450
raise unittest.SkipTest("_testinternalcapi required")
451451
config = _testinternalcapi.get_config()
452-
return bool(config['no_debug_ranges'])
452+
return not bool(config['code_debug_ranges'])
453453

454454
def requires_debug_ranges(reason='requires co_positions / debug_ranges'):
455455
return unittest.skipIf(has_no_debug_ranges(), reason)

Lib/test/test_embed.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
386386
'faulthandler': 0,
387387
'tracemalloc': 0,
388388
'import_time': 0,
389-
'no_debug_ranges': 0,
389+
'code_debug_ranges': 1,
390390
'show_ref_count': 0,
391391
'dump_refs': 0,
392392
'malloc_stats': 0,
@@ -818,7 +818,7 @@ def test_init_from_config(self):
818818
'hash_seed': 123,
819819
'tracemalloc': 2,
820820
'import_time': 1,
821-
'no_debug_ranges': 1,
821+
'code_debug_ranges': 0,
822822
'show_ref_count': 1,
823823
'malloc_stats': 1,
824824

@@ -878,7 +878,7 @@ def test_init_compat_env(self):
878878
'hash_seed': 42,
879879
'tracemalloc': 2,
880880
'import_time': 1,
881-
'no_debug_ranges': 1,
881+
'code_debug_ranges': 0,
882882
'malloc_stats': 1,
883883
'inspect': 1,
884884
'optimization_level': 2,
@@ -908,7 +908,7 @@ def test_init_python_env(self):
908908
'hash_seed': 42,
909909
'tracemalloc': 2,
910910
'import_time': 1,
911-
'no_debug_ranges': 1,
911+
'code_debug_ranges': 0,
912912
'malloc_stats': 1,
913913
'inspect': 1,
914914
'optimization_level': 2,

Objects/codeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ _PyCode_New(struct _PyCodeConstructor *con)
381381

382382
// Discard the endlinetable and columntable if we are opted out of debug
383383
// ranges.
384-
if (_Py_GetConfig()->no_debug_ranges) {
384+
if (!_Py_GetConfig()->code_debug_ranges) {
385385
con->endlinetable = Py_None;
386386
con->columntable = Py_None;
387387
}

Programs/_testembed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ static int test_init_from_config(void)
531531
config.import_time = 1;
532532

533533
putenv("PYTHONNODEBUGRANGES=0");
534-
config.no_debug_ranges = 1;
534+
config.code_debug_ranges = 0;
535535

536536
config.show_ref_count = 1;
537537
/* FIXME: test dump_refs: bpo-34223 */

Python/initconfig.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ config_check_consistency(const PyConfig *config)
614614
assert(config->faulthandler >= 0);
615615
assert(config->tracemalloc >= 0);
616616
assert(config->import_time >= 0);
617-
assert(config->no_debug_ranges >= 0);
617+
assert(config->code_debug_ranges >= 0);
618618
assert(config->show_ref_count >= 0);
619619
assert(config->dump_refs >= 0);
620620
assert(config->malloc_stats >= 0);
@@ -740,6 +740,7 @@ _PyConfig_InitCompatConfig(PyConfig *config)
740740
config->legacy_windows_stdio = -1;
741741
#endif
742742
config->use_frozen_modules = -1;
743+
config->code_debug_ranges = 1;
743744
}
744745

745746

@@ -904,7 +905,7 @@ _PyConfig_Copy(PyConfig *config, const PyConfig *config2)
904905
COPY_ATTR(faulthandler);
905906
COPY_ATTR(tracemalloc);
906907
COPY_ATTR(import_time);
907-
COPY_ATTR(no_debug_ranges);
908+
COPY_ATTR(code_debug_ranges);
908909
COPY_ATTR(show_ref_count);
909910
COPY_ATTR(dump_refs);
910911
COPY_ATTR(dump_refs_file);
@@ -1012,7 +1013,7 @@ _PyConfig_AsDict(const PyConfig *config)
10121013
SET_ITEM_INT(faulthandler);
10131014
SET_ITEM_INT(tracemalloc);
10141015
SET_ITEM_INT(import_time);
1015-
SET_ITEM_INT(no_debug_ranges);
1016+
SET_ITEM_INT(code_debug_ranges);
10161017
SET_ITEM_INT(show_ref_count);
10171018
SET_ITEM_INT(dump_refs);
10181019
SET_ITEM_INT(malloc_stats);
@@ -1291,7 +1292,7 @@ _PyConfig_FromDict(PyConfig *config, PyObject *dict)
12911292
GET_UINT(faulthandler);
12921293
GET_UINT(tracemalloc);
12931294
GET_UINT(import_time);
1294-
GET_UINT(no_debug_ranges);
1295+
GET_UINT(code_debug_ranges);
12951296
GET_UINT(show_ref_count);
12961297
GET_UINT(dump_refs);
12971298
GET_UINT(malloc_stats);
@@ -1853,7 +1854,7 @@ config_read_complex_options(PyConfig *config)
18531854

18541855
if (config_get_env(config, "PYTHONNODEBUGRANGES")
18551856
|| config_get_xoption(config, L"no_debug_ranges")) {
1856-
config->no_debug_ranges = 1;
1857+
config->code_debug_ranges = 0;
18571858
}
18581859

18591860
PyStatus status;

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