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

TypeError: 'float' object cannot be interpreted as an integer #56

Open
Eterale opened this issue Oct 11, 2024 · 8 comments
Open

TypeError: 'float' object cannot be interpreted as an integer #56

Eterale opened this issue Oct 11, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@Eterale
Copy link

Eterale commented Oct 11, 2024

Describe the bug
With every command I get an error with :

Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Users\matis\AppData\Local\Programs\Python\Python312\Scripts\jncep.exe_main
.py", line 4, in
from jncep.jncep import main
File "C:\Users\matis\AppData\Local\Programs\Python\Python312\Lib\site-packages\jncep\jncep.py", line 6, in
from .cli.config import config_manage
File "C:\Users\matis\AppData\Local\Programs\Python\Python312\Lib\site-packages\jncep\cli\config.py", line 5, in
from .. import config, track, utils
File "C:\Users\matis\AppData\Local\Programs\Python\Python312\Lib\site-packages\jncep\track.py", line 11, in
from . import config, core, jncweb, spec, utils
File "C:\Users\matis\AppData\Local\Programs\Python\Python312\Lib\site-packages\jncep\core.py", line 17, in
from . import epub, jnclabs, jncweb, spec, utils
File "C:\Users\matis\AppData\Local\Programs\Python\Python312\Lib\site-packages\jncep\jnclabs.py", line 6, in
import asks
File "C:\Users\matis\AppData\Local\Programs\Python\Python312\Lib\site-packages\asks_init
.py", line 5, in
from .base_funcs import *
File "C:\Users\matis\AppData\Local\Programs\Python\Python312\Lib\site-packages\asks\base_funcs.py", line 8, in
from .sessions import Session
File "C:\Users\matis\AppData\Local\Programs\Python\Python312\Lib\site-packages\asks\sessions.py", line 16, in
from .request_object import RequestProcessor
File "C:\Users\matis\AppData\Local\Programs\Python\Python312\Lib\site-packages\asks\request_object.py", line 31, in
_BOUNDARY = "8banana133744910kmmr13a56!102!" + str(randint(1e3, 9e3))
^^^^^^^^^^^^^^^^^
File "C:\Users\matis\AppData\Local\Programs\Python\Python312\Lib\random.py", line 336, in randint
return self.randrange(a, b+1)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\matis\AppData\Local\Programs\Python\Python312\Lib\random.py", line 301, in randrange
istart = _index(start)
^^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer

To Reproduce
Every command I do

Debug trace
Because of the bug, I can't

Environment (please complete the following information):

  • OS: Windows 11
  • Python version: Python 3.12.7
  • JNCEP version: v46
@Eterale Eterale added the bug Something isn't working label Oct 11, 2024
@H0R1Z0N
Copy link

H0R1Z0N commented Oct 11, 2024

See the bug report #45 for the fix.

@gvellut
Copy link
Owner

gvellut commented Oct 11, 2024

Thank you for your feedback.

This bug has come up a few times: you can also check out issue #46 (as well as #45 as mentioned by @H0R1Z0N). Here is what I wrote (maybe it will solve your issue):

I will make a new release at some point to solve that but I haven't finished testing...

@H0R1Z0N
Copy link

H0R1Z0N commented Oct 15, 2024

Update, i install the tmpfix branch using "pip install git+https://github.com/gvellut/jncep.git@tmpfix" and it seem ask was not the issue, unless it's requiring another version. It seem to point to trio, updating trio don't fix it either.

/home/hnt/.local/lib/python3.12/site-packages/trio/_core/_multierror.py:511: RuntimeWarning: You seem to already have a custom sys.excepthook handler installed. I'll skip installing Trio's custom handler, but this means MultiErrors will not show full tracebacks.
warnings.warn(
Traceback (most recent call last):
File "/home/hnt/.local/bin/jncep", line 5, in
from jncep.jncep import main
File "/home/hnt/.local/lib/python3.12/site-packages/jncep/jncep.py", line 6, in
from .cli.config import config_manage
File "/home/hnt/.local/lib/python3.12/site-packages/jncep/cli/config.py", line 5, in
from .. import config, track, utils
File "/home/hnt/.local/lib/python3.12/site-packages/jncep/track.py", line 11, in
from . import config, core, jncweb, spec, utils
File "/home/hnt/.local/lib/python3.12/site-packages/jncep/core.py", line 18, in
from . import epub, jnclabs, jncweb, spec, utils
File "/home/hnt/.local/lib/python3.12/site-packages/jncep/jnclabs.py", line 6, in
import asks
File "/home/hnt/.local/lib/python3.12/site-packages/asks/init.py", line 5, in
from .base_funcs import *
File "/home/hnt/.local/lib/python3.12/site-packages/asks/base_funcs.py", line 8, in
from .sessions import Session
File "/home/hnt/.local/lib/python3.12/site-packages/asks/sessions.py", line 16, in
from .request_object import RequestProcessor
File "/home/hnt/.local/lib/python3.12/site-packages/asks/request_object.py", line 31, in
_BOUNDARY = "8banana133744910kmmr13a56!102!" + str(randint(1e3, 9e3))
^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/random.py", line 336, in randint
return self.randrange(a, b+1)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/random.py", line 301, in randrange
istart = _index(start)
^^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer

Ask and Trio have been attempted to be updated, still won't work.

@Nitrousoxide
Copy link

Nitrousoxide commented Oct 15, 2024

which version of python are you using? I just tried it in this containerfile in podman/docker and it worked okay.

FROM python:3.11-alpine
ARG group=jncep
ARG user=jncep
ARG home=/home/$user
RUN apk --no-cache add bash git jq curl
RUN pip install --upgrade pip
#RUN pip install git+https://github.com/gvellut/jncep.git@$(curl -s https://api.github.com/repos/gvellut/jncep/releases/latest | jq -r '.tag_name')
RUN pip install git+https://github.com/gvellut/jncep.git@tmpfix
ENTRYPOINT /bin/sh

@H0R1Z0N
Copy link

H0R1Z0N commented Oct 15, 2024 via email

@gvellut
Copy link
Owner

gvellut commented Oct 17, 2024

In the last released version (v48), version 3.12 should work too (unfortunately, not 3.13 since there is a bigger change, maybe for next version...).

@H0R1Z0N
Copy link

H0R1Z0N commented Oct 17, 2024

On fedora, using "pip install -U jncep", which use python 3.12, it still fail with the same issue about trio on vertsion 48.

~$ jncep update
/home/hnt/.local/lib/python3.12/site-packages/trio/_core/_multierror.py:511: RuntimeWarning: You seem to already have a custom sys.excepthook handler installed. I'll skip installing Trio's custom handler, but this means MultiErrors will not show full tracebacks.
warnings.warn(
Traceback (most recent call last):
File "/home/hnt/.local/bin/jncep", line 5, in
from jncep.jncep import main
File "/home/hnt/.local/lib/python3.12/site-packages/jncep/jncep.py", line 6, in
from .cli.config import config_manage
File "/home/hnt/.local/lib/python3.12/site-packages/jncep/cli/config.py", line 5, in
from .. import config, track, utils
File "/home/hnt/.local/lib/python3.12/site-packages/jncep/track.py", line 11, in
from . import config, core, jncweb, spec, utils
File "/home/hnt/.local/lib/python3.12/site-packages/jncep/core.py", line 18, in
from . import epub, jnclabs, jncweb, spec, utils
File "/home/hnt/.local/lib/python3.12/site-packages/jncep/jnclabs.py", line 6, in
import asks
File "/home/hnt/.local/lib/python3.12/site-packages/asks/init.py", line 5, in
from .base_funcs import *
File "/home/hnt/.local/lib/python3.12/site-packages/asks/base_funcs.py", line 8, in
from .sessions import Session
File "/home/hnt/.local/lib/python3.12/site-packages/asks/sessions.py", line 16, in
from .request_object import RequestProcessor
File "/home/hnt/.local/lib/python3.12/site-packages/asks/request_object.py", line 31, in
_BOUNDARY = "8banana133744910kmmr13a56!102!" + str(randint(1e3, 9e3))
^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/random.py", line 336, in randint
return self.randrange(a, b+1)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/random.py", line 301, in randrange
istart = _index(start)
^^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer

Work on my android phone with termux which seem to use 3.11.10. I also got other issue where once updated with the previous 47 versions, if i do "jncep update", it will only work once on the first time, ripping everything, but would not download further part afterward. I checked and it seem it's marking it in weird way in the json file (unsure). it say "last check date" (with zilbagias in example) : "2024-10-17T14:52:28Z", "part" : "3.14", "part_date" : "2024-10-24T01:00:00Z", part 13 was the last one, is it waiting for the next part to release to rip it ? Is it because the API show unavailible yet further part (i do think it's the issue). It was not ripping the finished prepub of crossdress villainess or strong exorcist yesterday when i did the "jncep update" on 47. And no, version 48 don't fix python 3.12 for me nor the part ripping for newer prepub either (is it due to the json being butched with 47 ? If so, i will have to reinsert it.)

@H0R1Z0N
Copy link

H0R1Z0N commented Oct 21, 2024

Update from the discord server of JNC
Screenshot from 2024-10-21 09-16-28
Seem they might be using 32bits integer instead of 64bits.

Edit, did not realise there was an update, thank you, now it work on Python 3.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants