Skip to content

Fix test_calendar tests#2177

Merged
coolreader18 merged 3 commits intomasterfrom
coolreader18/windows-binaryio
Sep 2, 2020
Merged

Fix test_calendar tests#2177
coolreader18 merged 3 commits intomasterfrom
coolreader18/windows-binaryio

Conversation

@coolreader18
Copy link
Member

No description provided.

@coolreader18 coolreader18 force-pushed the coolreader18/windows-binaryio branch 2 times, most recently from fef1528 to f45a8ce Compare September 1, 2020 18:54
settings.initialization_parameter = InitParameter::InitializeInternal;
}

// don't translate newlines (\r\n <=> \n)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does CPython do this? My concern is that as this will have process wide effects, this may have unintended consequences for programs that embed RustPython.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may have unintended consequences for programs that embed RustPython.

That's why I moved it from vm::initialize to main, it should only happen for the actual rustpython binary.

Does CPython do this?

yup: https://github.com/python/cpython/blob/9b648a95ccb4c3b14f1e87158f5c9f5dbb2f62c0/Python/initconfig.c#L1812-L1817

@coolreader18 coolreader18 force-pushed the coolreader18/windows-binaryio branch from f45a8ce to 717784d Compare September 1, 2020 20:21
@coolreader18
Copy link
Member Author

Ahh, I think I found the problem -- our TextIOWrapper doesn't translate newlines. Maybe. Like when the script process prints to stdout, it prints '\n's, but the stdout TextIOWrapper doesn't translate that. I think I can make a quickfix just by changing the conv() function in test_calendar

@coolreader18 coolreader18 force-pushed the coolreader18/windows-binaryio branch from 197a887 to 5594660 Compare September 2, 2020 15:34
@coolreader18 coolreader18 merged commit 26638e4 into master Sep 2, 2020
@coolreader18 coolreader18 deleted the coolreader18/windows-binaryio branch September 2, 2020 17:23
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.

2 participants