IRC logs of #tryton for Monday, 2018-11-12

chat.freenode.net #tryton log beginning Mon Nov 12 00:00:01 CET 2018
-!- csotelo(~csotelo@2800:200:f400:19c:2892:3d67:9264:7ff7) has joined #tryton00:11
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton00:11
-!- thaneor(~lenovo3@179.26.53.92) has joined #tryton01:11
-!- mono2(~mono@181.137.134.104) has joined #tryton01:11
-!- yangoon1(~mathiasb@224-75-142-46.pool.kielnet.net) has joined #tryton04:11
-!- JanGB(~jan@ip5f5ad17c.dynamic.kabel-deutschland.de) has joined #tryton06:11
-!- tafelgeschirr(~tafelgesc@5.104.149.54) has joined #tryton06:11
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton08:11
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton09:11
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton09:11
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton09:11
-!- udono(~udono@167-060-210-188.ip-addr.inexio.net) has joined #tryton09:11
semarieon 5.0 (untested on tip), when closing tryton desktop client, I see INFO:trytond.security:logout for 'None' from '127.0.0.1' on database 'mydatabase1' in log. Shouldn't the username to be showed instead of 'None' ?09:11
semariethe other side (login) is: INFO:trytond.security:login succeeded for 'admin' from '127.0.0.1' on database 'mydatabase1'09:11
-!- rpit(~rpit@p4FD19D28.dip0.t-ipconnect.de) has joined #tryton09:11
cedksemarie: None is displayed when the session was already removed09:11
cedkbut it will be good to investigate if there are no two logout request and also I think the log message should be better in this case09:11
semarieI see only one logout message09:11
semariean option is to add user_id on logout (and login too)09:11
semarie  INFO trytond.security logout for 'None' (user_id=1) from '127.0.0.1' on database 'mydatabase1'09:11
semariethe information is directly available (it is a parameter on logout), and it is available on login too09:11
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton10:11
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton10:11
cedksemarie: I think it is good to have the information that logout request was not done because the session was not found10:11
semariecedk: I think there is a problem. here is my log (with --dev) : https://p.iotek.org/ad010:11
semariethe database is fresh (sqlite)10:11
semarieI connect using desktop, login, close the configuration tab for module, and close the desktop windows10:11
semarieI saw the entry in ir_session table10:11
semarieonce logout it is removed10:11
semariefrom the log, there is: DELETE FROM "ir_session" WHERE (("id" IN (6)))10:11
semarieand *after*, a SELECT for searching the session10:11
semarieonly one 'trytond.security' for logout (with None)10:11
semarie(and these test is on tip)10:11
semarie(and there is a little patch for showing user_id)10:11
semarieI have the same behaviour with sao and postgresql database when clicking on "logout" icon : "logout for 'None'"10:11
semariewith additionnal logging in ir.session, Session.remove() is called several times on logout10:11
cedksemarie: yes I foud that too11:11
semariebut trytond.security.logout() is called once.11:11
semarieit might be a problem with the for loop in logout()11:11
semarieif "name = Session.remove(session)" success, there is no break to avoid looping11:11
semarieso first time, name="admin" and session removed11:11
semarieand next, no more session and name=None11:11
semarieas the logger.info is after the loop, it showed 'None'11:11
cedksemarie: https://bugs.tryton.org/issue785211:11
semariecedk: the following diff is enough for calling Session.remove() once : https://p.iotek.org/dec11:11
semarieit doesn't address logger.error for None11:11
semarieah I missed the review11:11
semarieACTION look at the diff11:11
semariecedk: the "logout failed" message should be different as it isn't a logname that is used but a user_id. else if someone create a user with '1' as logname it will be confusing11:11
cedksemarie: this is free parameter from the caller so we should not care too much11:11
semariecedk: oh, and for login(), I think the break isn't necessary: there is already a break at end of the loop11:11
semarieoh, you removed it11:11
cedksemarie: yes I want to same pattern in all the metohds otherwise same issue will be happen again11:11
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton11:11
-!- csotelo(~csotelo@2800:200:f400:19c:2892:3d67:9264:7ff7) has joined #tryton12:11
-!- mariomop(~quassel@181.111.12.102) has joined #tryton12:11
pokolii've noticed the following exception on sentry: https://pastebin.com/zXaDi9KN any idea on how to fix it?12:11
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton12:11
-!- thaneor1(~lenovo3@179.26.229.45) has joined #tryton13:11
-!- JanGB(~jan@p54B05A67.dip0.t-ipconnect.de) has joined #tryton13:11
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton14:11
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton14:11
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton14:11
-!- tafelgeschirr(~tafelgesc@5.104.149.54) has joined #tryton16:11
-!- mariomop(~quassel@181.111.12.102) has joined #tryton16:11
-!- lucascastro(~lucascast@177-185-139-186.isotelco.net.br) has joined #tryton17:11
-!- Seburath(bf649377@gateway/web/freenode/ip.191.100.147.119) has joined #tryton17:11
-!- Sebu(bf649377@gateway/web/freenode/ip.191.100.147.119) has joined #tryton18:11
-!- Seburath(bf649377@gateway/web/freenode/ip.191.100.147.119) has joined #tryton18:11
-!- udono(~udono@167-060-210-188.ip-addr.inexio.net) has joined #tryton19:11
-!- andrespoliti(~andrespol@200.50.173.5) has joined #tryton21:11
andrespolitigood afternoon21:11
andrespolitihow can i check the mimetype of a binary field? i'm trying to use the magic library like this:21:11
andrespolitimime = magic.Magic(mime=True)21:11
andrespolitireturn mime.from_buffer(buffer(dato.archivo))21:11
andrespolitibut it gives me an error: ArgumentError: argument 2: <type 'exceptions.TypeError'>: wrong type21:11
andrespolitii also tried without converting to buffer, and it gives me: TypeError: decoding bytearray is not supported21:11
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has left #tryton21:11
cedkandrespoliti: what type is magic expecting?21:11
andrespolitimagic.from_buffer() Accepts a binary string21:11
andrespolitisorry, it's mime.from_buffer()21:11
cedkandrespoliti: there is no binary string in Python21:11
andrespolitithis is the example in the docstring of from_buffer: magic.from_buffer(open("testdata/test.pdf").read(1024))21:11
cedkandrespoliti: so it is string which is strange for pdf file21:11
andrespolitiis there any other way of checking the mimetype instead of using magic?21:11
cedkandrespoliti: the best is to be explicit so store it with data21:11
andrespolitii wanted to know the type to do a validation21:11
cedkandrespoliti: can not see what validation can be done on binary data21:11
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton22:11
andrespolitiI'm making an user configurable workflow system, and in each step they can configure required data. If the data is of type 'file', they can select the type of file (image, audio, pdf, etc)22:11
andrespolitithen, when the actual workflow is executed, the system would validate that the file they uploaded is of the correct mimetype22:11
-!- Seburath_(uid331224@gateway/web/irccloud.com/x-wlhijxvqkxijxxra) has joined #tryton22:11
cedkandrespoliti: I guess you should make a propose to implement filters on the binary widget23:11

Generated by irclog2html.py 2.16.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!