Skip to content

gh-108303: Move config parser data to Lib/test/configparserdata/ #111879

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

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Nov 9, 2023

There are two options:

  • a data dir (because it is also used by idlelib)
  • test_configparser package with these files and test_configparser.py (it is more complex to add, since requires several build-step changes, while in my opinion does not add much)

What do others think?

@sobolevn sobolevn requested a review from vstinner November 9, 2023 12:56
@sobolevn sobolevn requested a review from terryjreedy as a code owner November 9, 2023 12:56
@sobolevn sobolevn added skip news needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Nov 9, 2023
@ambv ambv merged commit cc18b88 into python:main Nov 9, 2023
@miss-islington-app
Copy link

Thanks @sobolevn for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 9, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 9, 2023
@bedevere-app
Copy link

bedevere-app bot commented Nov 9, 2023

GH-111882 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Nov 9, 2023
@bedevere-app
Copy link

bedevere-app bot commented Nov 9, 2023

GH-111883 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Nov 9, 2023
ambv pushed a commit that referenced this pull request Nov 9, 2023
…ta/` (gh-111879) (gh-111882)

gh-108303: Move config parser data to `Lib/test/configparserdata/` (gh-111879)
(cherry picked from commit cc18b88)

Co-authored-by: Nikita Sobolev <[email protected]>
ambv pushed a commit that referenced this pull request Nov 9, 2023
…ta/` (gh-111879) (gh-111883)

gh-108303: Move config parser data to `Lib/test/configparserdata/` (gh-111879)
(cherry picked from commit cc18b88)

Co-authored-by: Nikita Sobolev <[email protected]>
@bedevere-bot
Copy link

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

Hi! The buildbot AMD64 Fedora Stable Clang Installed 3.12 has failed when building commit e11ea5a.

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/1154/builds/358) and take a look at the build logs.
  4. Check if the failure is related to this commit (e11ea5a) 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/1154/builds/358

Failed tests:

  • test_configparser
  • test_idle

Failed subtests:

  • test_load_cfg_files - idlelib.idle_test.test_config.IdleConfTest.test_load_cfg_files
  • test_parse_errors - test.test_configparser.SortedTestCase.test_parse_errors
  • test_parse_errors - test.test_configparser.StrictTestCase.test_parse_errors
  • test_parse_errors - test.test_configparser.ConfigParserTestCaseNoInterpolation.test_parse_errors
  • test_unicode_failure - test.test_configparser.ConfigParserTestCaseTrickyFile.test_unicode_failure
  • test_parse_errors - test.test_configparser.MultilineValuesTestCase.test_parse_errors
  • test_read_returns_file_list_with_bytestring_path - test.test_configparser.ConfigParserTestCaseNoValue.test_read_returns_file_list_with_bytestring_path
  • test_read_returns_file_list - test.test_configparser.ConfigParserTestCaseNonStandardDefaultSection.test_read_returns_file_list
  • test_parse_errors - test.test_configparser.RawConfigParserTestCase.test_parse_errors
  • test_read_returns_file_list - test.test_configparser.ConvertersTestCase.test_read_returns_file_list
  • test_parse_errors - test.test_configparser.ConfigParserTestCaseNonStandardDefaultSection.test_parse_errors
  • test_read_returns_file_list - test.test_configparser.StrictTestCase.test_read_returns_file_list
  • test_read_returns_file_list - test.test_configparser.CopyTestCase.test_read_returns_file_list
  • test_read_returns_file_list - test.test_configparser.ConfigParserTestCaseNoInterpolation.test_read_returns_file_list
  • test_read_returns_file_list_with_bytestring_path - test.test_configparser.StrictTestCase.test_read_returns_file_list_with_bytestring_path
  • test_parse_errors - test.test_configparser.ConvertersTestCase.test_parse_errors
  • test_cfgparser_dot_3 - test.test_configparser.ConfigParserTestCaseTrickyFile.test_cfgparser_dot_3
  • test_read_returns_file_list_with_bytestring_path - test.test_configparser.ConfigParserTestCase.test_read_returns_file_list_with_bytestring_path
  • test_file - test.test_configparser.ReadFileTestCase.test_file
  • test_read_returns_file_list - test.test_configparser.RawConfigParserTestCase.test_read_returns_file_list
  • test_parse_errors - test.test_configparser.RawConfigParserTestCaseNonStandardDelimiters.test_parse_errors
  • test_parse_errors - test.test_configparser.ConfigParserTestCaseLegacyInterpolation.test_parse_errors
  • test_read_returns_file_list_with_bytestring_path - test.test_configparser.ConfigParserTestCaseExtendedInterpolation.test_read_returns_file_list_with_bytestring_path
  • test_read_returns_file_list - test.test_configparser.ConfigParserTestCaseExtendedInterpolation.test_read_returns_file_list
  • test_read_returns_file_list_with_bytestring_path - test.test_configparser.CopyTestCase.test_read_returns_file_list_with_bytestring_path
  • test_read_returns_file_list_with_bytestring_path - test.test_configparser.MultilineValuesTestCase.test_read_returns_file_list_with_bytestring_path
  • test_read_returns_file_list - test.test_configparser.MultilineValuesTestCase.test_read_returns_file_list
  • test_read_returns_file_list - test.test_configparser.SortedTestCase.test_read_returns_file_list
  • test_load_file - idlelib.idle_test.test_config.IdleConfParserTest.test_load_file
  • test_parse_errors - test.test_configparser.ConfigParserTestCaseExtendedInterpolation.test_parse_errors
  • test_parse_errors - test.test_configparser.ConfigParserTestCase.test_parse_errors
  • test_read_returns_file_list_with_bytestring_path - test.test_configparser.ConfigParserTestCaseLegacyInterpolation.test_read_returns_file_list_with_bytestring_path
  • test_read_returns_file_list_with_bytestring_path - test.test_configparser.RawConfigParserTestCase.test_read_returns_file_list_with_bytestring_path
  • test_read_returns_file_list_with_bytestring_path - test.test_configparser.SortedTestCase.test_read_returns_file_list_with_bytestring_path
  • test_read_returns_file_list - test.test_configparser.ConfigParserTestCase.test_read_returns_file_list
  • test_read_returns_file_list_with_bytestring_path - test.test_configparser.ConfigParserTestCaseNonStandardDefaultSection.test_read_returns_file_list_with_bytestring_path
  • test_parse_errors - test.test_configparser.CopyTestCase.test_parse_errors
  • test_read_returns_file_list_with_bytestring_path - test.test_configparser.ConfigParserTestCaseNoInterpolation.test_read_returns_file_list_with_bytestring_path
  • test_read_returns_file_list - test.test_configparser.ConfigParserTestCaseNoValue.test_read_returns_file_list
  • test_read_returns_file_list_with_bytestring_path - test.test_configparser.ConvertersTestCase.test_read_returns_file_list_with_bytestring_path
  • test_parse_errors - test.test_configparser.ConfigParserTestCaseNonStandardDelimiters.test_parse_errors
  • test_read_returns_file_list - test.test_configparser.ConfigParserTestCaseLegacyInterpolation.test_read_returns_file_list
  • test_reading - test.test_configparser.RawConfigParserTestSambaConf.test_reading

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.12.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.12/test/test_configparser.py", line 1540, in test_readline_generator
    parser.read_file(FakeFile())
                     ^^^^^^^^^^
  File "/home/buildbot/buildarea/3.12.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.12/test/test_configparser.py", line 1493, in __init__
    with open(file_path, encoding="utf-8") as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'configdata/cfgparser.1'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.12.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.12/test/test_configparser.py", line 1361, in test_cfgparser_dot_3
    self.assertEqual(len(cf.read(tricky, encoding='utf-8')), 1)
AssertionError: 0 != 1


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.12.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.12/idlelib/idle_test/test_config.py", line 93, in test_load_file
    self.assertEqual(parser.Get('Foo Bar', 'foo'), 'newbar')
AssertionError: None != 'newbar'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.12.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.12/test/test_configparser.py", line 1168, in test_reading
    self.assertEqual(parsed_files, [smbconf])
AssertionError: Lists differ: [] != ['configdata/cfgparser.2']


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.12.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.12/test/test_configparser.py", line 1520, in test_file
    with open(file_path, encoding="utf-8") as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'configdata/cfgparser.1'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.12.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.12/test/test_configparser.py", line 758, in test_read_returns_file_list_with_bytestring_path
    self.assertEqual(parsed_files, [file1_bytestring])
AssertionError: Lists differ: [] != [b'configdata/cfgparser.1']


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.12.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.12/test/test_configparser.py", line 1393, in test_unicode_failure
    with self.assertRaises(UnicodeDecodeError):
AssertionError: UnicodeDecodeError not raised


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.12.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.12/idlelib/idle_test/test_config.py", line 308, in test_load_cfg_files
    eq(conf.defaultCfg['foo'].Get('Foo Bar', 'foo'), 'newbar')
AssertionError: None != 'newbar'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.12.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.12/test/test_configparser.py", line 555, in test_parse_errors
    with open(tricky, encoding='utf-8') as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'configdata/cfgparser.3'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.12.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.12/test/test_configparser.py", line 725, in test_read_returns_file_list
    self.assertEqual(parsed_files, [file1])
AssertionError: Lists differ: [] != ['configdata/cfgparser.1']

@sobolevn
Copy link
Member Author

sobolevn commented Nov 9, 2023

Failures look related

@ambv
Copy link
Contributor

ambv commented Nov 9, 2023

They are indeed related because looks like the data files don't get installed.

@sobolevn
Copy link
Member Author

sobolevn commented Nov 9, 2023

Fixing

sobolevn added a commit to sobolevn/cpython that referenced this pull request Nov 9, 2023
@vstinner
Copy link
Member

vstinner commented Nov 9, 2023

They are indeed related because looks like the data files don't get installed.

Ooooh, right. It's good that we have buildbots to test that :-)

aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@jaraco
Copy link
Member

jaraco commented Feb 24, 2024

They are indeed related because looks like the data files don't get installed.

Ooooh, right. It's good that we have buildbots to test that :-)

Better would be to fail faster (#81224).

This change is also implicated In jaraco/configparser#70.

It's probably good to learn that the backport was inadvertently depending on fixtures in the Python test suite.

Additionally, it's an indication that this change has implications for the backport's test suite and it would be good for me to get notified when there are such changes. I think what that means is that I just need to add my username to the codeowners for the relevant paths.

Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants