*** kgriffs_afk is now known as kgriffs | 00:06 | |
*** kgriffs is now known as kgriffs_afk | 00:19 | |
*** openstackgerrit has quit IRC | 00:24 | |
*** openstackgerrit has joined #openstack-marconi | 00:24 | |
*** ekarlso has quit IRC | 00:25 | |
*** ekarlso has joined #openstack-marconi | 00:25 | |
*** reed has quit IRC | 00:28 | |
*** haomaiwang has joined #openstack-marconi | 01:09 | |
*** kgriffs_afk is now known as kgriffs | 01:11 | |
*** haomaiwang has quit IRC | 01:14 | |
*** kgriffs is now known as kgriffs_afk | 01:21 | |
*** kgriffs_afk is now known as kgriffs | 02:12 | |
*** kgriffs is now known as kgriffs_afk | 02:22 | |
*** reed has joined #openstack-marconi | 02:37 | |
*** haomaiwang has joined #openstack-marconi | 03:11 | |
*** kgriffs_afk is now known as kgriffs | 03:13 | |
*** haomaiwang has quit IRC | 03:16 | |
*** flwang has joined #openstack-marconi | 03:20 | |
*** kgriffs is now known as kgriffs_afk | 03:22 | |
*** cpallares has quit IRC | 03:29 | |
*** cpallares has joined #openstack-marconi | 03:29 | |
*** cpallares has quit IRC | 03:52 | |
*** haomaiwang has joined #openstack-marconi | 04:11 | |
*** kgriffs_afk is now known as kgriffs | 04:13 | |
*** kgriffs is now known as kgriffs_afk | 04:23 | |
*** haomaiwang has quit IRC | 04:43 | |
*** haomaiwa_ has joined #openstack-marconi | 04:44 | |
*** haomaiwa_ has quit IRC | 04:47 | |
*** haomaiwang has joined #openstack-marconi | 04:47 | |
*** kgriffs_afk is now known as kgriffs | 05:14 | |
*** kgriffs is now known as kgriffs_afk | 05:24 | |
*** reed has quit IRC | 05:36 | |
*** Abhishek has joined #openstack-marconi | 05:39 | |
*** Abhishek has quit IRC | 05:44 | |
*** Abhishek_ has joined #openstack-marconi | 06:08 | |
*** kgriffs_afk is now known as kgriffs | 06:15 | |
*** kgriffs is now known as kgriffs_afk | 06:25 | |
*** flwang has quit IRC | 06:30 | |
*** flwang has joined #openstack-marconi | 06:33 | |
*** kgriffs_afk is now known as kgriffs | 07:16 | |
*** kgriffs is now known as kgriffs_afk | 07:26 | |
*** jamieh has joined #openstack-marconi | 07:45 | |
*** Abhishek_ has quit IRC | 07:46 | |
*** jamieh has quit IRC | 07:50 | |
*** flaper87|afk is now known as flaper87 | 08:06 | |
*** kgriffs_afk is now known as kgriffs | 08:17 | |
*** kgriffs is now known as kgriffs_afk | 08:27 | |
*** rongze has joined #openstack-marconi | 08:29 | |
*** nosnos has joined #openstack-marconi | 08:55 | |
*** yassine has joined #openstack-marconi | 08:58 | |
*** yassine has quit IRC | 09:00 | |
*** yassine has joined #openstack-marconi | 09:00 | |
*** yassine has quit IRC | 09:02 | |
*** rongze has quit IRC | 09:05 | |
*** yassine has joined #openstack-marconi | 09:06 | |
*** yassine has quit IRC | 09:06 | |
*** yassine has joined #openstack-marconi | 09:07 | |
*** Abhishek_ has joined #openstack-marconi | 09:14 | |
*** kgriffs_afk is now known as kgriffs | 09:18 | |
*** kgriffs is now known as kgriffs_afk | 09:27 | |
*** rongze has joined #openstack-marconi | 09:34 | |
*** nosnos has quit IRC | 09:51 | |
*** jamieh has joined #openstack-marconi | 09:53 | |
*** kgriffs_afk is now known as kgriffs | 10:18 | |
*** flwang has quit IRC | 10:25 | |
*** kgriffs is now known as kgriffs_afk | 10:28 | |
*** flaper87 is now known as flaper87|afk | 10:33 | |
*** chandankumar has quit IRC | 10:43 | |
*** chandankumar has joined #openstack-marconi | 10:46 | |
*** rongze has quit IRC | 11:06 | |
*** kgriffs_afk is now known as kgriffs | 11:19 | |
*** kgriffs is now known as kgriffs_afk | 11:29 | |
*** rongze has joined #openstack-marconi | 11:38 | |
*** rongze has quit IRC | 11:49 | |
*** exed has joined #openstack-marconi | 12:06 | |
*** rongze has joined #openstack-marconi | 12:15 | |
*** oz_akan_ has joined #openstack-marconi | 12:18 | |
*** kgriffs_afk is now known as kgriffs | 12:20 | |
*** malini is now known as malini_afk | 12:29 | |
*** kgriffs is now known as kgriffs_afk | 12:30 | |
*** Abhishek_ has quit IRC | 12:37 | |
*** thomasem has joined #openstack-marconi | 12:48 | |
*** oz_akan_ has quit IRC | 12:49 | |
*** kgriffs_afk is now known as kgriffs | 13:21 | |
*** kgriffs is now known as kgriffs_afk | 13:31 | |
*** cpallares has joined #openstack-marconi | 13:42 | |
*** oz_akan_ has joined #openstack-marconi | 13:51 | |
*** oz_akan_ has quit IRC | 13:52 | |
*** oz_akan_ has joined #openstack-marconi | 13:53 | |
*** rongze has quit IRC | 13:59 | |
*** kgriffs_afk is now known as kgriffs | 14:22 | |
*** mpanetta has joined #openstack-marconi | 14:23 | |
*** russellb is now known as rustlebee | 14:25 | |
*** flaper87|afk is now known as flaper87 | 14:26 | |
*** kgriffs is now known as kgriffs_afk | 14:32 | |
*** Abhishe__ has joined #openstack-marconi | 14:41 | |
*** rongze has joined #openstack-marconi | 14:44 | |
*** rektide has quit IRC | 14:46 | |
*** oz_akan_ has quit IRC | 14:46 | |
*** rektide has joined #openstack-marconi | 14:46 | |
*** oz_akan_ has joined #openstack-marconi | 14:47 | |
*** malini_afk is now known as malini | 14:49 | |
*** exed_ has joined #openstack-marconi | 14:54 | |
*** exed has quit IRC | 14:56 | |
*** exed_ is now known as exed | 14:56 | |
*** jcru has joined #openstack-marconi | 15:00 | |
malini | flaper87: ping | 15:08 |
---|---|---|
flaper87 | malini: pong | 15:08 |
malini | good afternoon!! how are you? | 15:08 |
flaper87 | malini: I'm doing well, how are you doing? | 15:09 |
malini | life would have been better, if I cud figure out devstack </sigh> | 15:09 |
*** rongze has quit IRC | 15:11 | |
*** flwang has joined #openstack-marconi | 15:20 | |
malini | flaper87: I am running into this http://paste.openstack.org/show/54957/ , when running devstack | 15:22 |
malini | any pointers? | 15:22 |
*** kgriffs_afk is now known as kgriffs | 15:22 | |
*** alcabrera has joined #openstack-marconi | 15:23 | |
alcabrera | Good morning/afternoon/evening! :D | 15:23 |
malini | flaper87: this is my oocalrc http://paste.openstack.org/show/54959/ | 15:23 |
malini | alcabrera: good morning!! | 15:23 |
alcabrera | malini: hey! :) | 15:24 |
malini | how's your friday starting? | 15:24 |
alcabrera | awesome. There's banana yogurt, warmth, and lots of rest. Yours? | 15:24 |
malini | its going great :) | 15:25 |
alcabrera | yay! | 15:26 |
*** rwsu has joined #openstack-marconi | 15:31 | |
*** kgriffs is now known as kgriffs_afk | 15:32 | |
*** kgriffs_afk is now known as kgriffs | 15:37 | |
* flaper87 back | 15:38 | |
flaper87 | alcabrera: good morning | 15:38 |
flwang | alcabrera: ping | 15:38 |
flaper87 | malini: mmh, that's wierd | 15:38 |
flaper87 | weird | 15:38 |
flaper87 | why isn't there a SERVICE_ID set | 15:39 |
flaper87 | mmh | 15:39 |
alcabrera | flaper87: hey! :) | 15:39 |
alcabrera | flwang: pong | 15:39 |
*** rongze has joined #openstack-marconi | 15:39 | |
flwang | alcabrera: may I get your attention on my baby https://review.openstack.org/#/c/61495/ ? | 15:40 |
alcabrera | flaper87: certainly. I'll check it now. | 15:40 |
flaper87 | alcabrera: and you obviously meant flwang | 15:41 |
flaper87 | :D | 15:41 |
flwang | flaper87: morning, superman | 15:41 |
flwang | alcabrera: thanks | 15:42 |
flaper87 | flwang: gooood morning, buddy! | 15:42 |
alcabrera | lol | 15:42 |
alcabrera | IRC autocomplete got me this time. | 15:43 |
alcabrera | flwang: +2 - approved! Thanks! | 15:43 |
flwang | alcabrera: cooooooooooooooooooooooooooool | 15:44 |
flwang | alcabrera: my 2nd baby on Marconi | 15:44 |
alcabrera | :D | 15:46 |
alcabrera | it's a good morning for merging. | 15:46 |
alcabrera | ask me for reviews while I'm still eating this yogurt. :P | 15:46 |
flwang | wow, enjoy it | 15:48 |
alcabrera | thanks! I did. It's all gone now. :) | 15:50 |
flaper87 | alcabrera: https://review.openstack.org/#/c/61041/ | 15:52 |
flaper87 | pls, thanks! | 15:52 |
*** etoews3 has quit IRC | 15:52 | |
*** etoews2 has joined #openstack-marconi | 15:52 | |
alcabrera | flaper87: even though the yogurt ran out... | 15:52 |
alcabrera | I'll do it. ;( | 15:52 |
alcabrera | hahaha, a Nova patch! | 15:53 |
alcabrera | I'll do it anyway. :P | 15:53 |
flaper87 | :P | 15:53 |
flaper87 | just kidding | 15:53 |
flaper87 | hahahah | 15:53 |
flaper87 | no need to waste your time in nova | 15:53 |
flaper87 | :D | 15:53 |
flaper87 | :D | 15:53 |
alcabrera | :P | 15:53 |
flaper87 | you asked for a review, I gave you one | 15:53 |
flaper87 | muahahaha | 15:54 |
flaper87 | muahahah | 15:54 |
flaper87 | Fridevilness | 15:54 |
* alcabrera gave up on Nova review, realized couldn't make an informed, fair decision to +1 or -1 | 15:55 | |
alcabrera | :D | 15:55 |
alcabrera | Even for a two line patch | 15:55 |
alcabrera | too much EC2 | 15:55 |
malini | flaper87: sorry stepped away | 15:58 |
flaper87 | alcabrera: :P | 15:59 |
kgriffs | flaper87: now I'm curious | 16:00 |
kgriffs | what are some examples of 'volume_type_id'' | 16:00 |
flaper87 | kgriffs: just uuids | 16:01 |
malini | flaper87: do you know if I need any env variables etc. ? | 16:01 |
flaper87 | kgriffs: or should I say: 8-4-4-4-12 ? | 16:02 |
kgriffs | flaper87: in EC2 the normal choices are io1 or standard | 16:02 |
kgriffs | right? | 16:02 |
kgriffs | flaper87: LOL | 16:02 |
kgriffs | I love it when you speak dirty | 16:02 |
flaper87 | kgriffs: yeah, in cinder volume types are custom, though. | 16:02 |
kgriffs | eeenteresting | 16:03 |
alcabrera | 8-4-4-4-12 is stuck with me forever | 16:04 |
mpanetta | sounds like memory timings from the good ole days | 16:06 |
alcabrera | mpanetta: oh yeah. I remember when I used to look at those numvers and worry about them when shopping on newegg. :P | 16:06 |
mpanetta | hahah yes | 16:07 |
alcabrera | *numbers, too | 16:07 |
mpanetta | meh, people seem to be using V's to represent all sorts of letters these days, so a B is acceptable :P | 16:08 |
*** flwang has quit IRC | 16:09 | |
openstackgerrit | A change was merged to openstack/marconi: Return relative URIs for href-template of homedoc https://review.openstack.org/61495 | 16:12 |
*** rongze has quit IRC | 16:14 | |
*** rongze has joined #openstack-marconi | 16:21 | |
*** etoews2 has quit IRC | 16:37 | |
*** openstackgerrit has quit IRC | 16:37 | |
*** Alex_Gaynor has quit IRC | 16:37 | |
*** 17WAAKZAN has joined #openstack-marconi | 16:38 | |
*** etoews2 has joined #openstack-marconi | 16:38 | |
*** openstackgerrit has joined #openstack-marconi | 16:38 | |
*** Alex_Gaynor has joined #openstack-marconi | 16:38 | |
*** haomaiwang has quit IRC | 16:39 | |
malini | flaper87: I could get devstack working finally :) | 16:41 |
flaper87 | malini: what was it? | 16:41 |
flaper87 | malini: is there a bug? | 16:41 |
malini | Had to make some changes in lib/marconi.sh | 16:42 |
malini | let me get you the exact line # | 16:42 |
malini | https://github.com/openstack-dev/devstack/blob/master/lib/marconi#L151 - removed 'get_id' | 16:43 |
malini | added | grep ' " id " | get_field 2)' after https://github.com/openstack-dev/devstack/blob/master/lib/marconi#L154 | 16:44 |
malini | I'll submit a patch for this, if it looks ok to you | 16:44 |
*** haomaiwang has joined #openstack-marconi | 16:44 | |
alcabrera | malini: awesome! | 16:47 |
*** etoews3 has joined #openstack-marconi | 16:47 | |
*** 17WAAKZAN has quit IRC | 16:49 | |
*** etoews2 has quit IRC | 16:49 | |
*** openstackgerrit has quit IRC | 16:49 | |
*** Alex_Gaynor has quit IRC | 16:49 | |
*** Alex_Gaynor has joined #openstack-marconi | 16:54 | |
*** ayoung has joined #openstack-marconi | 16:56 | |
flaper87 | malini: mmh, I wonder why that doesn't work. Did you look at other project's sh files? | 17:06 |
malini | yes..I looked at neutron | 17:07 |
malini | I was using tht as a reference | 17:07 |
malini | flaper87: were you able to get it running against ur devstack ? | 17:07 |
flaper87 | malini: if neutron does that grep, then fine! | 17:08 |
malini | cool..I'll submit a patch for this | 17:08 |
*** haomaiwang has quit IRC | 17:11 | |
*** openstackgerrit has joined #openstack-marconi | 17:22 | |
*** Alex_Gaynor has quit IRC | 17:26 | |
*** Alex_Gaynor has joined #openstack-marconi | 17:26 | |
* flaper87 heads to dinner | 17:42 | |
*** reed has joined #openstack-marconi | 17:43 | |
*** exed has quit IRC | 17:45 | |
malini | yayyy…I just submitted my first non-marconi Openstack patch :) | 17:47 |
malini | https://review.openstack.org/#/c/62051/ | 17:47 |
cpallares | malini, yay congrats :D | 17:48 |
malini | thanks cpallares ;) | 17:48 |
alcabrera | malini: sweet! I've yet to contribute outside of marconi, iirc. :) | 17:49 |
malini | It feels like I have stepped out into the big bad world :D | 17:49 |
alcabrera | malini: it's pretty nice out there - most of the time. ;) | 17:57 |
alcabrera | before too long, you'll find yourself submitting patches to | 17:57 |
alcabrera | oslo | 17:57 |
alcabrera | keystone | 17:57 |
alcabrera | tempest | 17:57 |
alcabrera | you'll have touched it all. :D | 17:57 |
malini | tempest is coming soon | 17:57 |
malini | tht's my top priority now | 17:58 |
alcabrera | good luck! | 17:59 |
*** alcabrera is now known as alcabrera|afk | 18:14 | |
*** rwsu has quit IRC | 18:32 | |
*** jergerber has joined #openstack-marconi | 18:35 | |
*** rwsu has joined #openstack-marconi | 18:40 | |
*** alcabrera|afk is now known as alcabrera | 18:59 | |
cpallares | where are the files that deal with server connection? | 19:12 |
cpallares | ...or are they spread out? | 19:12 |
cpallares | i'm looking into this bug https://bugs.launchpad.net/marconi/+bug/1245987 | 19:13 |
*** rongze has quit IRC | 19:20 | |
*** yassine has quit IRC | 19:30 | |
alcabrera | cpallares: hmmm | 19:31 |
alcabrera | cpallares: the places to look should all be in marconi/queues/transport | 19:32 |
alcabrera | for server connections, WSGI/HTTP style, marconi.queues.transport.wsgi.{app,driver} are especially relevant. | 19:32 |
cpallares | alcabrera: thanks! | 19:32 |
alcabrera | for handling specific requests, they | 19:32 |
alcabrera | 're the rest of the file sin transport/wsgi/*.py | 19:33 |
alcabrera | like queues.py, shards.py, etc. | 19:33 |
alcabrera | np. :) | 19:33 |
cpallares | alcabrera: i was looking in transport but there's a great deal of errors that aren't logged so I wasn't sure which ones are the server ones | 19:33 |
alcabrera | hmmm | 19:34 |
alcabrera | I'd say that whatever would result in an HTTP 500 is a server error. | 19:35 |
alcabrera | I think there's actually a candidate sitting in queues/storage/sharding.py | 19:35 |
alcabrera | I'm not sure if when kgriffs and I got together and implemented that file, if we logged exceptional conditions. | 19:35 |
cpallares | alcabrera: hmm, what causes an HTTP 500 error? Is that any storage error? | 20:04 |
* cpallares doesn't know anything about servers or server errors | 20:04 | |
alcabrera | cpallares: for the case of marconi, storage errors are a big part of it. If we try to communicate with storage and it fails -> 500 | 20:05 |
alcabrera | also | 20:05 |
alcabrera | if no shards are registered in a sharded marconi context -> 500 | 20:05 |
alcabrera | lemme see | 20:05 |
alcabrera | ... | 20:05 |
alcabrera | if we try to contact a shard that is registered with the wrong URL or is down -> 500 | 20:06 |
kgriffs | flaper87: ETA on a new cache patch? | 20:08 |
mpanetta | Oh yay, someone is looking at my bug. :) | 20:08 |
kgriffs | s/patch/patchset | 20:08 |
alcabrera | cpallares: That's all the cases I can think of at the moment. | 20:09 |
cpallares | thank you alcabrera, it gives me a start | 20:09 |
mpanetta | If the catalog DB is down... | 20:10 |
alcabrera | Any operation that communicate with storage or over the network are suspect for 500s. :) | 20:10 |
mpanetta | Pretty much | 20:10 |
mpanetta | I am trying to think if we hit anything else weird | 20:11 |
mpanetta | What about memcached access alcabrera? Does the code do anything to handle a down memcached server? | 20:11 |
alcabrera | mpanetta: memcached would do it, too. Good thought! | 20:11 |
alcabrera | Yeah, I don't think we handle caching errors, either | 20:12 |
alcabrera | In that case, I'd like to see an error logged, but just continue operating in a degraded state | 20:12 |
mpanetta | I know when a shard does not exist and you are trying to create a queue it throws an odd exception in the logs, something along the lins of ShardNotFound does not exist... | 20:12 |
mpanetta | But nothing else is logged. | 20:12 |
kgriffs | mpanetta: btw, in your latest marconi.conf file did you remove the governor options per my comment in the test config? | 20:13 |
mpanetta | yes | 20:13 |
mpanetta | And kept your comment | 20:13 |
kgriffs | kewl, thanks. That should help make rate limiting work better | 20:13 |
mpanetta | no problem :) | 20:14 |
*** Abhishe__ has quit IRC | 20:15 | |
openstackgerrit | Kurt Griffiths proposed a change to openstack/marconi: chore: Bump version to icehouse-2 dev https://review.openstack.org/62082 | 20:28 |
kgriffs | alcabrera: the python memcached driver fails silently when it can't reach a node iirc | 20:30 |
*** rongze has joined #openstack-marconi | 20:31 | |
kgriffs | I think it pretends to succeed or something. I can't remember exactly. :p | 20:31 |
alcabrera | If it returns None, it's perfect for me. :P | 20:32 |
alcabrera | lookup :: Cache -> a -> Maybe b | 20:32 |
alcabrera | I'll check out oslo.cache failure semantics later. | 20:32 |
alcabrera | That'll go on my TODO | 20:33 |
kgriffs | alcabrera: oslo.cache may not be able to help it, if the underlying library doesn't tell it anything went wrong | 20:35 |
kgriffs | but yeah, something to follow up on | 20:36 |
kgriffs | we need errors to be detected and surfaced to the app, then dealt with correctly there | 20:36 |
*** rongze has quit IRC | 20:36 | |
alcabrera | +1 | 20:37 |
kgriffs | alcabrera: question | 20:42 |
kgriffs | is u'fsfa' ok, or is size.text_type('ffo') preferred for string literals? | 20:42 |
kgriffs | s/size/six | 20:43 |
mpanetta | alcabrera: what do you think about controlling depolyment with an array of these https://www.sparkfun.com/products/11310 and then one of these: https://www.sparkfun.com/products/9181 | 20:43 |
mpanetta | lol it would be like setting off a missile in a military base | 20:44 |
*** cpallares has quit IRC | 20:45 | |
alcabrera | kgriffs: u'fsfa' is okay, as long we don't care to support py3.2 (which is fine, IMO) | 20:45 |
*** cpallares has joined #openstack-marconi | 20:45 | |
kgriffs | mpanetta: nice. I added that to my wishlist | 20:45 |
kgriffs | alcabrera: kk | 20:45 |
alcabrera | b'a' also works across py26, py27, and py33 | 20:46 |
alcabrera | the dangerous one is 'a' | 20:46 |
alcabrera | which means unicode in py3 and byte-like in py2 | 20:46 |
alcabrera | kgriffs: lol - now launching marconi... | 20:47 |
kgriffs | alcabrera: is there a "unicode" magic method? | 20:47 |
kgriffs | I know there is __str__ | 20:47 |
kgriffs | ah | 20:48 |
kgriffs | __unicode__ | 20:48 |
alcabrera | hmm, that's new to me. ^ | 20:48 |
alcabrera | kgriffs: I'm not sure __unicode__ is canonical. Lemme check the magic method docs. | 20:49 |
alcabrera | It isn't listed when I dir() a new class. | 20:49 |
kgriffs | I saw it here: http://www.rafekettler.com/magicmethods.html | 20:49 |
kgriffs | question is, what is the correct thing to do for py3 compat? | 20:50 |
alcabrera | kgriffs: it's legit - http://docs.python.org/2/reference/datamodel.html#object.__unicode__ | 20:50 |
kgriffs | in py3, __str__ is called for str(mything) | 20:50 |
kgriffs | and unicode(mything) doesn't work | 20:50 |
alcabrera | in python 3, NameError: name 'unicode' is not defined | 20:50 |
alcabrera | yup | 20:51 |
alcabrera | so the correct thing, I think, is to avoid __unicode__ entirely. | 20:51 |
alcabrera | and treat __str__ as if it should return a unicode display | 20:51 |
mpanetta | Ok, I think I am going to have to make a button->queue thingy | 20:52 |
kgriffs | alcabrera: if __unicode__ is not defined, then __str__ is called and the result is coerced to unicode | 20:53 |
mpanetta | are there python bindings to linux HID? Anyone know off hand? | 20:53 |
kgriffs | alcabrera: I don't like the sound of "coerced" - could mess things up if the wrong encoding is assumed | 20:53 |
alcabrera | kgriffs: hmmm... it certainly sounds tricky. | 20:54 |
alcabrera | __str__ magic makes me nervous | 20:54 |
kgriffs | alcabrera: https://review.openstack.org/#/c/60725/4/solum/common/exception.py | 20:55 |
kgriffs | I don't think this is done correctly, and am trying to work out a better approach | 20:56 |
kgriffs | may have to have an if six.PY3 | 20:56 |
kgriffs | I was thinking, first of all, that message and msg_fmt should be defined to be wide | 20:56 |
kgriffs | under py3 you just return the result directly from __str__ and __unicode__ is not needed | 20:57 |
kgriffs | under py2 you encode with utf8 in __str__ and you return directly in __unicode__ | 20:57 |
kgriffs | alcabrera: thoughts on that approach? | 20:57 |
alcabrera | I'm +1 for making message and msg_fmt wide | 20:58 |
alcabrera | That'll help things along. | 20:58 |
alcabrera | regarding the return mechanism | 20:59 |
alcabrera | I'm not sure, but I'm pondering on it | 20:59 |
alcabrera | I wonder what kind of weird things would be returned by u'é'.encode('utf8') under __str__ in python 2...? | 21:01 |
alcabrera | I like __unicode__ just passing through | 21:01 |
alcabrera | and __str__ just passing through in py3 | 21:01 |
alcabrera | it's that __str__ in py2 that makes me nervous | 21:01 |
alcabrera | I'm leaning towards agreeing with regards to using if PY3 | 21:01 |
alcabrera | kgriffs: ^^ | 21:02 |
alcabrera | u'é'.encode('utf8') -> '\xc3\xa9' | 21:02 |
alcabrera | so that might not be... desirable. :/ | 21:02 |
alcabrera | it seems like __str__ should always be readble. | 21:02 |
alcabrera | so my best guess is that the right choice might just be to pass through the __unicode__ in __str__ for py2. | 21:03 |
alcabrera | since the way forward depends on __str__ exposing a unicode string | 21:03 |
alcabrera | /endthoughts | 21:04 |
*** malini is now known as malini_afk | 21:04 | |
kgriffs | woah hold on | 21:16 |
kgriffs | nevermind | 21:16 |
kgriffs | alcabrera: what do you think of this - https://gist.github.com/anonymous/5b4f46cfcfaa9263ee14 | 21:19 |
* alcabrera checks | 21:20 | |
alcabrera | kgriffs: I'm concerned about return self.message.encode('utf-8') | 21:21 |
alcabrera | since if message contains any non-ascii characters, it's going to show up as an unreadable mess when displayed to the user. | 21:22 |
alcabrera | s/message/'message' | 21:22 |
kgriffs | what is the alternative? | 21:22 |
kgriffs | insert question marks? | 21:22 |
alcabrera | Just overload __str__ to return a unicode string | 21:22 |
alcabrera | I think the coercion only happens if __str__ is not overloaded. | 21:23 |
kgriffs | nope | 21:23 |
kgriffs | I tried it | 21:23 |
alcabrera | hmm | 21:23 |
kgriffs | if you return unicode you get | 21:23 |
kgriffs | UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128) | 21:23 |
alcabrera | yikes | 21:23 |
alcabrera | well then... | 21:23 |
kgriffs | ideally, you would just always use six.text_type(ex) | 21:24 |
alcabrera | self.message.encode('ascii') | 21:24 |
alcabrera | Though that will raise UnicodeDecodeError... | 21:25 |
kgriffs | yes, that is what the interpreter does automatically when it coerces | 21:26 |
kgriffs | idk if it is possible to tell it to use a different codec by default | 21:26 |
alcabrera | idk, either. | 21:27 |
kgriffs | alcabrera: here is my final draft: https://gist.github.com/kgriffs/7951625 | 21:28 |
kgriffs | look OK? | 21:28 |
alcabrera | kgriffs: yup | 21:28 |
alcabrera | I think that's the safest bet | 21:28 |
alcabrera | Needs to come with strong dissuasion against str(). | 21:29 |
alcabrera | six.text_type is best | 21:29 |
alcabrera | I'm heading out for the day. | 21:29 |
alcabrera | Have a good weekend, everyone. :) | 21:29 |
*** alcabrera has quit IRC | 21:30 | |
*** oz_akan_ has quit IRC | 22:08 | |
*** thomasem has quit IRC | 22:11 | |
*** mpanetta has quit IRC | 22:15 | |
*** cpallares has quit IRC | 22:33 | |
*** jamieh has quit IRC | 22:35 | |
*** jamieh has joined #openstack-marconi | 22:46 | |
*** kgriffs is now known as kgriffs_afk | 22:50 | |
*** ametts has quit IRC | 23:16 | |
*** oz_akan_ has joined #openstack-marconi | 23:19 | |
*** oz_akan_ has quit IRC | 23:23 | |
*** flaper87 is now known as flaper87|afk | 23:50 | |
*** jcru has quit IRC | 23:53 |
Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!