ZeroDivisionError in correct_indentation #558

Merged
merged 1 commit into from May 2, 2012

Projects

None yet

4 participants

@sonnym

Hi,

I have been encountering an error because cols is set to zero when the division occurs. Please get in touch if you would like me to make any corrections. Thanks!

  • Sonny
@ghost

Looks related to #557.

@ConradIrwin
pry member

Thanks, this needs fixing :).

@sonnym Just before we pull this into pry, do you know how cols is getting == 0? It might be that we need to change the order of the methods we try to calculate it.

@sonnym

Looks like Readline.get_screen_size is returning zero for me.

@ConradIrwin ConradIrwin merged commit f3990ea into pry:master May 2, 2012
@ConradIrwin
pry member

Thanks again! I've updated the code to try reading ENV["COLUMNS"] if that happens — and also kept your safeguard in there to prevent errors in future :).

@sonnym

Excellent. Thanks for the quick response and pulling my fork! Now I can't wait for the next version bump, heh.

@FND

On MRI 1.8.7-p358, this results in "TypeError: String can't be coerced into Fixnum", as cols is a string.

This appears to fix it:

cols = cols.to_i rescue cols

(I'm afraid I can't isolate it any further right now.)

pry member

@FND This has been fixed in b2facc3

@YorickPeterse: I know, @banister and I discussed it on IRC - thanks for letting me know though!

@banister banister added a commit that referenced this pull request May 10, 2012
@banister banister version 0.9.9.6 release
As a result of the 0.9.9.5 fix for #558 we got the following
error on 1.8.7:

"On MRI 1.8.7-p358, this results in "TypeError:
String can't be coerced into Fixnum",".

This commit should fix that.
b2facc3
@ghost Unknown pushed a commit that referenced this pull request Apr 6, 2014
@banister banister version 0.9.9.6 release
As a result of the 0.9.9.5 fix for #558 we got the following
error on 1.8.7:

"On MRI 1.8.7-p358, this results in "TypeError:
String can't be coerced into Fixnum",".

This commit should fix that.
454374d
@jazzonmymind jazzonmymind pushed a commit that referenced this pull request Nov 23, 2014
@banister banister version 0.9.9.6 release
As a result of the 0.9.9.5 fix for #558 we got the following
error on 1.8.7:

"On MRI 1.8.7-p358, this results in "TypeError:
String can't be coerced into Fixnum",".

This commit should fix that.
0efb691
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment