Giter Club home page Giter Club logo

Comments (7)

rfehren avatar rfehren commented on May 15, 2024

Hi,

I tried using pyslurm with python 3 but get e.g.:

->>> print(a.find('job_state', 'Running'))
Traceback (most recent call last):
File "", line 1, in
File "pyslurm/pyslurm.pyx", line 1723, in pyslurm.pyslurm.job.find (pyslurm/pyslurm.c:22792)
TypeError: expected bytes, str found

I guess this is due to unicode strings not fully supported. If you'd give me a hint of what to change we'd work on this.

from pyslurm.

gingergeeks avatar gingergeeks commented on May 15, 2024

Thanks for that report. I'm currently working on testing 15.08.0-preX so once this working branch is committed (soon) I will take a look at adding proper Python3 support to it as well, I think someone raised a ticket with some suggestions earlier so I will have a search.

from pyslurm.

gingergeeks avatar gingergeeks commented on May 15, 2024

Having had a play it looks like I will need to commit current 15.08.0-preX branch (Python2.x) and start making changes for Python3 after that. Which Slurm version are you using ?

from pyslurm.

rfehren avatar rfehren commented on May 15, 2024

I'm using 14.11.5. As I said, we're happy to help porting.

from pyslurm.

MikeDacre avatar MikeDacre commented on May 15, 2024

I am working on getting this working with python3 now, I fixed @rfehren problem by changing
def find(self, char *name='', val=''):
to
def find(self, name='', val='')

This works as expected in both python2 and python3, plus I think it makes more sense than making the round trip to C, which seems unnecessary and potentially costly in this instance.

I could be wrong though, I am not a C programmer (anymore) and I rarely use cython. Thoughts?

from pyslurm.

MikeDacre avatar MikeDacre commented on May 15, 2024

I just made a pull request for the 14.11.5 branch that applies this fix

from pyslurm.

giovtorres avatar giovtorres commented on May 15, 2024

PR #87 added python3 compatibility to PySlurm. If there are any lingering encoding issues in Python3, please raise a new, specific issue for it. Thanks.

from pyslurm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.