Re: Looking up a dictionary _key_ by key?

2015-06-24 Thread Marko Rauhamaa
Ian Kelly : > I don't think that it's fundamentally broken. A simple example would > be the int 3, vs. the float 3, vs. the Decimal 3. All of them compare > equal to one another, but they are distinct values, and sometimes it > might be useful to be able to determine which one is actually a key in

rhythmbox plugin problem

2015-06-24 Thread L E
Hello, I am trying to get some old plugins I wrote to wrote on anewer version of rhythmbox. When I try to load the plugin I see: (rhythmbox:3092): libpeas-WARNING **: nowplaying-lcd: /usr/lib/rhythmbox/plugins/nowplaying-lcd/libnowplaying-lcd.so: cannot open shared object file: No such file or d

Pure Python Data Mangling or Encrypting

2015-06-24 Thread Randall Smith
Chunks of data (about 2MB) are to be stored on machines using a peer-to-peer protocol. The recipient of these chunks can't assume that the payload is benign. While the data senders are supposed to encrypt data, that's not guaranteed, and I'd like to protect the recipient against exposure to n

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Devin Jeanpierre
How about a random substitution cipher? This will be ultra-weak, but fast (using bytes.translate/bytes.maketrans) and seems to be the kind of thing you're asking for. -- Devin On Tue, Jun 23, 2015 at 12:02 PM, Randall Smith wrote: > Chunks of data (about 2MB) are to be stored on machines using a

Re: Looking up a dictionary _key_ by key?

2015-06-24 Thread Mark Lawrence
On 24/06/2015 01:47, Dan Stromberg wrote: Would I have to do an O(n) search to find my key? can you use something from here https://pypi.python.org/pypi/sortedcontainers/0.9.6 with the bisect module? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do fo

Next CodinGame online programming contest on June, 27 - Python available

2015-06-24 Thread Maria Martin
Hi everyone! On June 27th, "Code of the Rings", an online coding battle will launch. It's Free & open to all. You will have 24 hours to code and optimize your solution to a puzzle. What will be exciting and fun is that it will be VERY EASY to start and to get something that works, but comple

Re: To write headers once with different values in separate row in CSV

2015-06-24 Thread kbtyo
On Tuesday, June 23, 2015 at 3:12:40 PM UTC-4, John Gordon wrote: > In Sahlusar > writes: > > > However, when I extrapolate this same logic with a list like: > > > ('Response.MemberO.PMembers.PMembers.Member.CurrentEmployer.EmployerAddress > > .TimeAtPreviousAddress.', None), where the headers

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Steven D'Aprano
On Wed, 24 Jun 2015 05:02 am, Randall Smith wrote: > Chunks of data (about 2MB) are to be stored on machines using a > peer-to-peer protocol. The recipient of these chunks can't assume that > the payload is benign. While the data senders are supposed to encrypt > data, that's not guaranteed, and

Re: To write headers once with different values in separate row in CSV

2015-06-24 Thread kbtyo
On Tuesday, June 23, 2015 at 9:50:50 PM UTC-4, Steven D'Aprano wrote: > On Wed, 24 Jun 2015 03:15 am, Sahlusar wrote: > > > That is not the underlying issue. Any thoughts or suggestions would be > > very helpful. > > > Thank you for spending over 100 lines to tell us what is NOT the underlying >

Re: Organizing function calls once files have been moved to a directory

2015-06-24 Thread kbtyo
On Tuesday, June 23, 2015 at 10:18:43 PM UTC-4, Steven D'Aprano wrote: > On Wed, 24 Jun 2015 06:16 am, kbtyo wrote: > > > I am working on a workflow module that will allow one to recursively check > > for file extensions and if there is a match move them to a folder for > > processing (parsing, da

Re: To write headers once with different values in separate row in CSV

2015-06-24 Thread Steven D'Aprano
On Wed, 24 Jun 2015 09:37 pm, kbtyo wrote: > On Tuesday, June 23, 2015 at 9:50:50 PM UTC-4, Steven D'Aprano wrote: >> On Wed, 24 Jun 2015 03:15 am, Sahlusar wrote: >> >> > That is not the underlying issue. Any thoughts or suggestions would be >> > very helpful. >> >> >> Thank you for spending o

Re: To write headers once with different values in separate row in CSV

2015-06-24 Thread kbtyo
On Wednesday, June 24, 2015 at 8:38:24 AM UTC-4, Steven D'Aprano wrote: > On Wed, 24 Jun 2015 09:37 pm, kbtyo wrote: > > > On Tuesday, June 23, 2015 at 9:50:50 PM UTC-4, Steven D'Aprano wrote: > >> On Wed, 24 Jun 2015 03:15 am, Sahlusar wrote: > >> > >> > That is not the underlying issue. Any tho

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Grant Edwards
On 2015-06-24, Steven D'Aprano wrote: > On Wed, 24 Jun 2015 05:02 am, Randall Smith wrote: > >> Chunks of data (about 2MB) are to be stored on machines using a >> peer-to-peer protocol. The recipient of these chunks can't assume that >> the payload is benign. While the data senders are supposed

EuroPython 2015: Beginner’s Day

2015-06-24 Thread M.-A. Lemburg
We’re pleased to announce a new venture at this year’s EuroPython... *** The EuroPython Beginner’s Day *** https://ep2015.europython.eu/en/events/beginners-day/ If you’re thinking of coming to the conference but you’re new to Python, this could be the session for you. Wh

Re: EuroPython 2015: Beginner’s Day

2015-06-24 Thread Chris Angelico
On Thu, Jun 25, 2015 at 12:06 AM, M.-A. Lemburg wrote: > * A high-level introduction to Python and programming in general. >Where did Python come from, what is programming all about, and what >do I need to know to understand all these in-jokes about cheese >shops? > > * A session on t

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Emile van Sebille
On 6/24/2015 7:02 AM, Grant Edwards wrote: And how does writing unmangled data to disk expose anybody to anything? I've never heard of an exploit where writing an evilly crafted bit-pattern to disk causes a any sort of problem. Unless that code is executed at boot. Mangling would at least pre

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Chris Angelico
On Thu, Jun 25, 2015 at 1:52 AM, Emile van Sebille wrote: > On 6/24/2015 7:02 AM, Grant Edwards wrote: >> >> And how does writing unmangled data to disk expose anybody to >> anything? I've never heard of an exploit where writing an evilly >> crafted bit-pattern to disk causes a any sort of proble

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Emile van Sebille
On 6/24/2015 8:55 AM, Chris Angelico wrote: On Thu, Jun 25, 2015 at 1:52 AM, Emile van Sebille wrote: On 6/24/2015 7:02 AM, Grant Edwards wrote: And how does writing unmangled data to disk expose anybody to anything? I've never heard of an exploit where writing an evilly crafted bit-pattern

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Grant Edwards
On 2015-06-24, Emile van Sebille wrote: > On 6/24/2015 7:02 AM, Grant Edwards wrote: >> And how does writing unmangled data to disk expose anybody to >> anything? I've never heard of an exploit where writing an evilly >> crafted bit-pattern to disk causes a any sort of problem. > > Unless that co

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Chris Angelico
On Thu, Jun 25, 2015 at 2:16 AM, Grant Edwards wrote: > On 2015-06-24, Emile van Sebille wrote: >> Mangling would at least prevent it from executing. > > If you don't want a file to be executed, then don't make it > executable. Or doesn't Windows have any way to control whether a file > is execu

Why does the unit test fail of the pyPDF2 package?

2015-06-24 Thread fl
Hi, I want to learn some coding on PDF. After I download and install pyPDF2, it cannot pass unit test, which is coming from the package. I put a screen shot link here to show the console message: http://tinypic.com/view.php?pic=fbdpg0&s=8#.VYre8_lVhBc [IMG]http://i57.tinypic.com/fbdpg0.png[/IMG]

Re: Why does the unit test fail of the pyPDF2 package?

2015-06-24 Thread Steven D'Aprano
On Thu, 25 Jun 2015 02:53 am, fl wrote: > Hi, > I want to learn some coding on PDF. After I download and install pyPDF2, > it cannot pass unit test, which is coming from the package. > > I put a screen shot link here to show the console message: Please don't use screen shots: (1) We cannot copy

Looking for people who are using Hypothesis and are willing to say so

2015-06-24 Thread David MacIver
Hi there, Author of Hypothesis here. (If you don't know what Hypothesis is, you're probably not the target audience for this email but you should totally check it out: https://hypothesis.readthedocs.org/ Unless you like spending ages writing tests and still shipping buggy code). I keep finding ou

Re: Why does the unit test fail of the pyPDF2 package?

2015-06-24 Thread fl
On Wednesday, June 24, 2015 at 9:54:12 AM UTC-7, fl wrote: > Hi, > I want to learn some coding on PDF. After I download and install pyPDF2, > it cannot pass unit test, which is coming from the package. > > I put a screen shot link here to show the console message: > > http://tinypic.com/view.php?

windows and file names > 256 bytes

2015-06-24 Thread Albert-Jan Roskam via Python-list
Hi, Consider the following calls, where very_long_path is more than 256 bytes: [1] os.mkdir(very_long_path) [2] os.getsize(very_long_path) [3] shutil.rmtree(very_long_path) I am using Python 2.7 and [1] and [2] fail under Windows XP [3] fails under Win7 (not sure about XP). This is even when I u

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Randall Smith
On 06/24/2015 06:36 AM, Steven D'Aprano wrote: I don't understand how mangling the data is supposed to protect the recipient. Don't they have the ability unmangle the data, and thus expose themselves to whatever nasties are in the files? They never look at the data and wouldn't care to unmangle

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Randall Smith
On 06/24/2015 02:44 AM, Devin Jeanpierre wrote: How about a random substitution cipher? This will be ultra-weak, but fast (using bytes.translate/bytes.maketrans) and seems to be the kind of thing you're asking for. -- Devin I tried this out and it seems to be just what I need. Thanks Devin!

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Grant Edwards
On 2015-06-24, Chris Angelico wrote: > On Thu, Jun 25, 2015 at 2:16 AM, Grant Edwards > wrote: >> On 2015-06-24, Emile van Sebille wrote: >> >>> Mangling would at least prevent it from executing. >> >> If you don't want a file to be executed, then don't make it >> executable. Or doesn't Window

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Grant Edwards
On 2015-06-24, Randall Smith wrote: > On 06/24/2015 06:36 AM, Steven D'Aprano wrote: > >> I don't understand how mangling the data is supposed to protect the >> recipient. Don't they have the ability unmangle the data, and thus >> expose themselves to whatever nasties are in the files? > > They ne

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Randall Smith
On 06/24/2015 07:19 AM, Dennis Lee Bieber wrote: Pardon, but that description has me confused. Perhaps I just don't understand the full use-case. Who exactly is supposed to be protected from what? You state "data senders are supposed to encrypt" which, if the recipient doesn't

Re: Why does the unit test fail of the pyPDF2 package?

2015-06-24 Thread MRAB
On 2015-06-24 18:52, fl wrote: On Wednesday, June 24, 2015 at 9:54:12 AM UTC-7, fl wrote: Hi, I want to learn some coding on PDF. After I download and install pyPDF2, it cannot pass unit test, which is coming from the package. I put a screen shot link here to show the console message: http://t

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Randall Smith
On 06/24/2015 01:29 PM, Grant Edwards wrote: On 2015-06-24, Randall Smith wrote: On 06/24/2015 06:36 AM, Steven D'Aprano wrote: I don't understand how mangling the data is supposed to protect the recipient. Don't they have the ability unmangle the data, and thus expose themselves to whatever

Re: Why does the unit test fail of the pyPDF2 package?

2015-06-24 Thread fl
On Wednesday, June 24, 2015 at 9:54:12 AM UTC-7, fl wrote: > Hi, > I want to learn some coding on PDF. After I download and install pyPDF2, > it cannot pass unit test, which is coming from the package. > > I put a screen shot link here to show the console message: > > http://tinypic.com/view.php?

Re: Why does the unit test fail of the pyPDF2 package?

2015-06-24 Thread John Gordon
In <16dfcef6-4740-45b9-b04f-0f5bc0899...@googlegroups.com> fl writes: > Excuse me. I don't understand your idea. On the command window, there is > no content copied through a mouse click/drag (even no screen difference). Right-click the command window title bar and select Edit -> Mark. Then use

Re: Why does the unit test fail of the pyPDF2 package?

2015-06-24 Thread Jon Ribbens
On 2015-06-24, fl wrote: > You can make a rectangular selection by dragging over the console > window the mouse pointer. > > Excuse me. I don't understand your idea. On the command window, there is > no content copied through a mouse click/drag (even no screen difference). > Do you mean using S

Re: Why does the unit test fail of the pyPDF2 package?

2015-06-24 Thread fl
On Wednesday, June 24, 2015 at 9:54:12 AM UTC-7, fl wrote: > Hi, > I want to learn some coding on PDF. After I download and install pyPDF2, > it cannot pass unit test, which is coming from the package. > > I put a screen shot link here to show the console message: > > http://tinypic.com/view.php?

Re: Why does the unit test fail of the pyPDF2 package?

2015-06-24 Thread Mark Lawrence
On 24/06/2015 19:48, MRAB wrote: On 2015-06-24 18:52, fl wrote: On Wednesday, June 24, 2015 at 9:54:12 AM UTC-7, fl wrote: Hi, I want to learn some coding on PDF. After I download and install pyPDF2, it cannot pass unit test, which is coming from the package. I put a screen shot link here to s

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Grant Edwards
On 2015-06-24, Randall Smith wrote: > On 06/24/2015 01:29 PM, Grant Edwards wrote: >> On 2015-06-24, Randall Smith wrote: >>> On 06/24/2015 06:36 AM, Steven D'Aprano wrote: >>> I don't understand how mangling the data is supposed to protect the recipient. Don't they have the ability unm

Re: Looking for people who are using Hypothesis and are willing to say so

2015-06-24 Thread Paul Rubin
David MacIver writes: > Author of Hypothesis here. (If you don't know what Hypothesis is, you're > probably not the target audience for this email but you should totally > check it out: https://hypothesis.readthedocs.org/ Oh very cool: a QuickCheck-like unit test library. I heard of something li

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Billy Earney
Freenet seems to come to mind.. :) On Wed, Jun 24, 2015 at 4:24 PM, Grant Edwards wrote: > On 2015-06-24, Randall Smith wrote: > > On 06/24/2015 01:29 PM, Grant Edwards wrote: > >> On 2015-06-24, Randall Smith wrote: > >>> On 06/24/2015 06:36 AM, Steven D'Aprano wrote: > >>> > I don't und

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Randall Smith
On 06/24/2015 04:24 PM, Grant Edwards wrote: OK. But if the recipient (the server) mangles the data and then never unmangles or reads the data, there doesn't seem to be any point in storing it. I must be misunderstanding your statement that the data is never read/unmangled. When the storag

Could you explain this rebinding (or some other action) on "nums = nums"?

2015-06-24 Thread fl
Hi, I read a blog written by Ned and find it is very interesting, but I am still unclear it in some parts. In the following example, I am almost lost at the last line: nums = num Could anyone explain it in a more detail to me? Thanks, ... The reason is that list imple

Re: Could you explain this rebinding (or some other action) on "nums = nums"?

2015-06-24 Thread Chris Angelico
On Thu, Jun 25, 2015 at 9:52 AM, fl wrote: > The reason is that list implements __iadd__ like this (except in C, not > Python): > > class List: > def __iadd__(self, other): > self.extend(other) > return self > When you execute "nums += more", you're getting the same effect as:

Re: Why does the unit test fail of the pyPDF2 package?

2015-06-24 Thread Steven D'Aprano
On Thu, 25 Jun 2015 03:52 am, fl wrote: > Thanks, Steven. I don't know how to copy command console window contents > to the forum post. I don't know either, because I don't use Windows, but you can google for instructions: https://duckduckgo.com/html/?q=copy+text+windows+console https://startpa

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Steven D'Aprano
On Thu, 25 Jun 2015 04:36 am, Randall Smith wrote: > On 06/24/2015 07:19 AM, Dennis Lee Bieber wrote: > > >> Pardon, but that description has me confused. Perhaps I just don't >> understand the full use-case. >> >> Who exactly is supposed to be protected from what? You state "data >> senders are

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Devin Jeanpierre
On Wed, Jun 24, 2015 at 9:07 PM, Steven D'Aprano wrote: > But just sticking to the three above, the first one is partially mitigated > by allowing virus scanners to scan the data, but that implies that the > owner of the storage machine can spy on the files. So you have a conflict > here. If it's