Skip to content
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

Check that sys.stdout/err is not None before flushing #344

Merged
merged 1 commit into from
Sep 21, 2018

Conversation

jenshnielsen
Copy link
Contributor

On Windows it seems that sys.stdout and possibly sys.stderr can be None.
This happens at startup of the kernel in Spyder e.g
spyder-ide/spyder#7842 and multiple duplicates.

The change to flush was introduced in 4.9 with #314

Checking that setout/stderr is not None before flushing seems to be enough to fix the issue for me.

On windows this has been observed to be None at startup spyder-ide/spyder#7842
@ccordoba12
Copy link
Member

Thanks a lot @jenshnielsen! It looks good to me.

@Carreau Carreau modified the milestones: 5.0, 4.9, 4.10 Sep 21, 2018
@Carreau
Copy link
Member

Carreau commented Sep 21, 2018

Marking as 4.10, the current master branch have diverged from 4.x, so this will need a backport.

@Carreau Carreau merged commit acb1e39 into ipython:master Sep 21, 2018
@lumberbot-app
Copy link

lumberbot-app bot commented Sep 21, 2018

Something went wrong ... Please have a look at my logs.

@Carreau
Copy link
Member

Carreau commented Sep 21, 2018

@meeseeksdev backport to 4.x

@lumberbot-app
Copy link

lumberbot-app bot commented Sep 21, 2018

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout 4.x
$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 acb1e39700ed33b4ecd62bc20c18172a3bbe1fa6
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #344: Check that sys.stdout/err is not None before flushing'
  1. Push to a named branch :
git push YOURFORK 4.x:auto-backport-of-pr-344-on-4.x
  1. Create a PR against branch 4.x, I would have named this PR:

"Backport PR #344 on branch 4.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to suggest an improvement.

@Carreau
Copy link
Member

Carreau commented Sep 21, 2018

branches were messed up, re-trying.

@Carreau
Copy link
Member

Carreau commented Sep 21, 2018

@meeseeksdev backport to 4.x

meeseeksmachine pushed a commit to meeseeksmachine/ipykernel that referenced this pull request Sep 21, 2018
@jenshnielsen jenshnielsen deleted the fix/sys_std_out_is_None branch September 21, 2018 14:05
Carreau added a commit to meeseeksmachine/ipykernel that referenced this pull request Sep 25, 2018
minrk added a commit that referenced this pull request Sep 26, 2018
…on-4.x

Backport PR #344 on branch 4.x (Check that sys.stdout/err is not None before flushing)
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.

3 participants