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

Feature python3 #105

Open
wants to merge 170 commits into
base: master
Choose a base branch
from
Open

Feature python3 #105

wants to merge 170 commits into from

Conversation

elterrien
Copy link

code review

M3te0r added 30 commits June 2, 2020 16:30
…atic_history

Desactivate git patch and static history
…json_export

(#MOBI-5212) improve newjsonencoder + fix Empty element closing
elieterrien and others added 25 commits February 18, 2022 17:49
psutils used in ikaaro, not itools
This fixes an error in ikaaro's test/test_metadata.py
As far as itools.datatypes is concerned, we don't have to deal with
bytes anymore, because in Python 3 we're getting unicode strings
(itools.datatypes is only used for text files).

We still have the String and Unicode datatypes, where the behaviour
of Unicode has not changed. The difference between them is:

- String.default is None, Unicode.default is the empty string
- The catalog will index a String field as is, but will split a Unicode
  field in words.

What has changed spicifically is that now String decodes/encodes from/to
str instead of bytes.
@staverne
Copy link
Member

Thank's a lot for the works ! I will take time to read/merge/improve the PR.

Copy link
Member

@staverne staverne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added some comments, i will check all theses points.

for name, info in self._metadata.iteritems():
try:
self._metadata = loads(metadata)
except ValueError:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will see if we can do better.

raise ValueError(msg.format(name, key))
pass
#### Python 3 pass error
#raise ValueError(msg.format(name, key))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will see for better solution

os_remove(path)
except OSError as error:
print(error)
print("File path can not be removed")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why ?

def to_str(self, encoding='utf-8'):
return self.data.encode(encoding)
# XXX self.data should always be unicode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to test it

from itools.core import get_abspath
from itools.pkg import setup as itools_setup
from itools.pkg.utils import setup as itools_setup
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should fix it.

else:
sources = ['itools/office/doctotext.cc']
extension = Extension('itools.office.doctotext', sources, **flags)
ext_modules.append(extension)

# if sys.version_info[0] == 3:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REMOVE

cls.internal_server_error(context)

# Cookies for authentification
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check where it's done now ?


class JWTExpiredException(TokenAuthorizationException):

message = MSG("Jeton expiré")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be in english

@@ -125,6 +125,7 @@ def git_describe(self):
return None

# Parse
print(data)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIXME

@@ -40,13 +40,17 @@ def get_start_tag(value):
qname = get_attribute_qname(attr_uri, attr_name)
value = XMLAttribute.encode(value)
s += ' %s="%s"' % (qname, value)
# Close the start tag
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check why it was missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants