Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Python: OverflowError: float too large to convert
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
haceye
Apprentice
Apprentice


Joined: 22 May 2003
Posts: 187
Location: Stuttgart, Germany

PostPosted: Tue Jun 24, 2003 11:21 am    Post subject: Python: OverflowError: float too large to convert Reply with quote

Hi,

Ich bin mir nicht ganz sicher, aber irgendwie sieht es so aus, als ob Python unter Gentoo einen Bug hat, den ich sonst nirgends entdecken kann (andere Umgebungen - Betriebssysteme).

Ich habe zwischenzeitlich auch schon das ~x86 Python 2.2.3 ausprobiert, doch da kommt der gleiche Fehler vor.
Dieser Fehler tritt immer auf, wenn ein float in ein int umgewandelt werden soll. Am meisten stört mich das im "random"-Modul, da ich keine Arrays mehr "shuffle"n kann und auch keine randints erzeugen kann.
Der gleiche Fehler tritt aber auch u.a. bei Bittorrent und diversen Python-Programmen auf.

Code:
shark@gentoo shark $ python
Python 2.2.2 (#1, Jun 24 2003, 12:45:20)
[GCC 3.2.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from random import shuffle
>>> a = [1, 2, 3]
>>> shuffle(a) # Eventuell öfters ausführen, tritt nicht immer auf
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.2/random.py", line 373, in shuffle
    j = int(random() * (i+1))
OverflowError: float too large to convert


Tritt der Fehler noch bei mehreren Leuten auf, oder bin ich der einzigste?

Code:
dev-lang/python-2.2.2  +readline +tcltk +berkdb -bootstrap


ciao David
_________________
faster 'emerge -s'? emerge esearch
Back to top
View user's profile Send private message
MasterOfMagic
l33t
l33t


Joined: 20 Aug 2002
Posts: 677
Location: Vienna, Austria

PostPosted: Tue Jun 24, 2003 11:26 am    Post subject: Reply with quote

hm und in deinen kompilerflags ist vielleicht derartiges wie -march=pentium4 drinnen?

mfg
masterofmagic
_________________
Gentoo 1.4
Kernel 2.4.24
KDE 3.1.5
Back to top
View user's profile Send private message
haceye
Apprentice
Apprentice


Joined: 22 May 2003
Posts: 187
Location: Stuttgart, Germany

PostPosted: Tue Jun 24, 2003 11:37 am    Post subject: Reply with quote

MasterOfMagic wrote:
hm und in deinen kompilerflags ist vielleicht derartiges wie -march=pentium4 drinnen?


Hi,
Genau das gleiche ist mir grad nachdem ich das Posting geschrieben hab auch gekommen und ich hab dann schnell Python mit den Standard C*FLAGS übersetzt, aber genau das gleiche Problem.

Benutze nämlich normalerweise
Code:
CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"


Hatte aber noch nie Probleme damit.

Falls sonst noch irgendwas benötigt wird hier mal:

Code:
shark@gentoo shark $ emerge info
Portage 2.0.48-r1 (default-x86-1.4, gcc-3.2.2, glibc-2.3.1-r4)
=================================================================
System uname: 2.4.20-gentoo-r5 i686 Intel(R) Pentium(R) 4 CPU 2.60GHz
GENTOO_MIRRORS="http://sunsite.cnlab-switch.ch/ftp/mirror/gentoo/ http://gentoo.inode.at/ http://ftp.easynet.nl/mirror/gentoo/ ftp://gentoo.inode.at/source/ ftp://ftp.tu-clausthal.de/pub/linux/gentoo/"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb:/usr/kde/3.1/share/config:/usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY="/usr/local/portage"
USE="x86 oss 3dnow apm avi crypt cups encode gif jpeg libg++ mikmod mmx mpeg ncurses nls pdflib png quicktime spell truetype xml2 xmms xv zlib alsa gdbm berkdb slang readline arts tetex svga tcltk java guile ruby mysql X sdl gpm tcpd pam libwww ssl perl python esd imlib oggvorbis gnome gtk qt kde motif opengl mozilla cdr gtk2 moznocompose moznoirc moznomail vim-with-x"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
ACCEPT_KEYWORDS="x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache"


Trotzdem vielen Dank für die Antwort

ciao David
_________________
faster 'emerge -s'? emerge esearch
Back to top
View user's profile Send private message
MasterOfMagic
l33t
l33t


Joined: 20 Aug 2002
Posts: 677
Location: Vienna, Austria

PostPosted: Tue Jun 24, 2003 1:55 pm    Post subject: Reply with quote

dann guck dir mal diesen thread an zur problembehebung.

dein kompiler generiert nämlich bei manchen paketen fehlerhafte sachen. ein neuerliches mergen von glibc wie in dem link beschrieben sollte das problem beheben.

https://forums.gentoo.org/viewtopic.php?t=43373
_________________
Gentoo 1.4
Kernel 2.4.24
KDE 3.1.5
Back to top
View user's profile Send private message
haceye
Apprentice
Apprentice


Joined: 22 May 2003
Posts: 187
Location: Stuttgart, Germany

PostPosted: Tue Jun 24, 2003 3:02 pm    Post subject: Reply with quote

So,

Erstmal vielen Dank, habe glibc neu übersetzt und jetzt läuft es einwandfrei. Ich frag mich jetzt blos, warum ich zu blöd bin um das hier im Forum selbst zu finden. Keine Ahnung was ich da falsch gemacht habe.

Aber darauf wäre ich nie gekommen, dass es an der glibc hängt. Das ein Fehler im GCC dann ausgerechnet bei einem selbst-geschriebenem Python Script auftaucht...

Also nochmals Danke, kann jetzt auch endlich Pathological mal ausprobieren ;-)

ciao David
_________________
faster 'emerge -s'? emerge esearch
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum