Re: Why exception from os.path.exists()?

2018-06-08 Thread Antoon Pardon
On 08-06-18 05:12, Ben Finney wrote:
> That is immediately followed by more specific advice that says when to
> use bytes:
>
> Unfortunately, some file names may not be representable as strings
> on Unix, so applications that need to support arbitrary file names
> on Unix should use bytes objects to represent path names. Vice
> versa, using bytes objects cannot represent all file names on
> Windows (in the standard mbcs encoding), hence Windows applications
> should use string objects to access all files.
>
> (That needs IMO a correction, because as already explored in this
> thread, it's not Unix or Windows that makes the distinction there. It's
> the specific *filesystem type* which records either bytes or text, and
> that is true no matter what operating system happens to be reading the
> filesystem.)

But it is the Unix or Windows api that is used. If the unix-api wants
bytes, then you don't have to care about what ends up on the file-system.
Just as you don't care whether the file-system uses encryption or not
to store it's data. That is all hidden in layers that are normally
inaccessible to the user.

Maybe some FS that is hooked up to my linux box does allow embedded NUL
bytes. I won't be able to notice that because even if there are such
files, they will need some remapping in order to make them accessible.
To the user the actuale filenames are the remapped filenames, not what
is actually on the FS.

-- 
Antoon Pardon.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sorting NaNs

2018-06-08 Thread Chris Angelico
On Fri, Jun 8, 2018 at 12:15 PM, Steven D'Aprano
 wrote:
> If you truly were limited to 2**32 different values (we're not), then it
> would be exactly right and proper to expect a collision in 2**16 samples.
> Actually, a lot less than that: more like 78000.
>
> https://en.wikipedia.org/wiki/Birthday_problem

2**16 is 65536, so the figure you give is pretty close to the
rule-of-thumb estimate that the square root of your pool is where
you're likely to have collisions.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [ZODB] Django-hotsauce/ZODB 5.4.0/PyPy nightly sprint!!

2018-06-08 Thread Mauro Amico
seems to me really similar to https://github.com/zopefoundation/ZEO/pull/96
try to upgrade to ZEO 5.1.2

mauro.

Il Ven 8 Giu 2018, 03:29 Etienne Robillard  ha scritto:

> Yo people I'm doing a nightly hacking sprint for django-hotsauce on pypy
> and got some cool bugs I would like to share:
>
> Traceback (most recent call last):
>File "/usr/local/bin/schevo", line 11, in 
>  load_entry_point('libschevo', 'console_scripts', 'schevo')()
>File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
> 32, in __call__
>  return self.main(arg0, args)
>File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
> 74, in main
>  return command()(*args)
>File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
> 32, in __call__
>  return self.main(arg0, args)
>File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
> 74, in main
>  return command()(*args)
>File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
> 32, in __call__
>  return self.main(arg0, args)
>File "/home/erob/src/libschevo/lib/schevo/script/db_evolve.py", line
> 86, in main
>  db = schevo.database.open(url)
>File "/home/erob/src/libschevo/lib/schevo/database.py", line 371, in
> open
>  db = Database(backend)
>File "/home/erob/src/libschevo/lib/schevo/database2.py", line 95, in
> __init__
>  self._update_extent_maps_by_name()
>File "/home/erob/src/libschevo/lib/schevo/database2.py", line 1633,
> in _update_extent_maps_by_name
>  for extent in self._extent_maps_by_id.itervalues():
>File "/usr/local/lib/python2.7/dist-packages/ZODB/Connection.py",
> line 791, in setstate
>  p, serial = self._storage.load(oid)
>File "/usr/local/lib/python2.7/dist-packages/ZODB/mvccadapter.py",
> line 143, in load
>  r = self._storage.loadBefore(oid, self._start)
>File "/home/erob/work/ZEO-5.1.0/src/ZEO/ClientStorage.py", line 520,
> in loadBefore
>  return self._server.load_before(oid, tid)
>File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/client.py", line 783,
> in load_before
>  return self.__call(self.client.load_before_threadsafe, oid, tid)
>File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/client.py", line 748,
> in call
>  return self.wait_for_result(result, self.timeout)
>File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/client.py", line 756,
> in wait_for_result
>  return future.result(timeout)
>File
> "/usr/local/lib/python2.7/dist-packages/futures-3.0.5-py2.7.egg/concurrent/futures/_base.py",
>
> line 405, in result
>  return self.__get_result()
>File
> "/usr/local/lib/python2.7/dist-packages/futures-3.0.5-py2.7.egg/concurrent/futures/_base.py",
>
> line 357, in __get_result
>  raise type(self._exception), self._exception, self._traceback
> ZEO.Exceptions.ClientDisconnected: connection lost
> erob@marina:/home/www/isotopesoftware.ca/trunk$
>
>
> Not sure about this first one! :)
>
> The command I'm trying to run is:
>
> % schevo db evolve --app blogengine2 zodb://127.0.0.1:4545 31
>
> The ZODB 5.4.0 server then produce the following traceback:
>
> 2018-06-07T21:14:55 INFO ZEO.asyncio.base Connected server protocol
> --
> 2018-06-07T21:14:55 INFO ZEO.asyncio.server received handshake 'Z5'
> --
> 2018-06-07T21:14:55 ERROR ZEO.asyncio.marshal can't decode message:
> '((ccopy_reg\n_reconstructor\n(czodbpickle\nbinary\nc__b...'
> --
> 2018-06-07T21:14:55 ERROR ZEO.asyncio.server Can't deserialize message
> Traceback (most recent call last):
>File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/server.py", line 89,
> in message_received
>  message_id, async, name, args = self.decode(message)
>File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/marshal.py", line
> 114, in pickle_server_decode
>  return unpickler.load() # msgid, flags, name, args
>File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/marshal.py", line
> 164, in server_find_global
>  raise ImportError("import error %s: %s" % (module, msg))
> ImportError: import error copy_reg:
> --
> 2018-06-07T21:14:55 ERROR ZEO.asyncio.base data_received 4 0 True
> Traceback (most recent call last):
>File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/base.py", line 128,
> in data_received
>  self.message_received(collected)
>File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/server.py", line 94,
> in message_received
>  if message_id == -1:
> UnboundLocalError: local variable 'message_id' referenced before assignment
> --
> 2018-06-07T21:14:55 INFO ZEO.StorageServer (127.0.0.1:4545) disconnected
> --
> 2018-06-07T21:14:55 INFO ZEO.asyncio.base Connected server protocol
> --
> 2018-06-07T21:14:55 INFO ZEO.asyncio.server received handshake 'Z5'
> --
> 2018-06-07T21:14:55 INFO ZEO.StorageServer (127.0.0.1:4545) disconnected
>
> Please hit me up if you know how to fix theses errors! :)
>
> I'm using PyPy 5.9 and 5.10 for dev and Python 2.7.13 for production
> with Cython bindings!
>
>
>

Re: Problem finding my folder via terminal

2018-06-08 Thread Tamara Berger
Hi Cameron,

Before I reply to the meat of your email, I guess we'd better clear up
your initial issues. You write:

"Replies inline below, which is the style we prefer on this list. (And to reply,
please reply to the specific message, not your original post. This will let you
pick up that branch of the conversation directly and not confuse your readers.)"

1.  I don't know what you mean by "inline," though I do notice all the
single and double carets at the left margin. I don't understand the
underlying rationale for the different patterns. And how do I create
them, manually?

2.  I also don't understand your instruction that I reply to the
specific message and not to my original post. I did not reply to my
own post but to Steven's comments. And then I brought up my main
issue, which had remained unaddressed by his email.

Thanks,

Tamara
On Thu, Jun 7, 2018 at 10:27 PM Cameron Simpson  wrote:
>
> Hi,
>
> Replies inline below, which is the style we prefer on this list. (And to 
> reply,
> please reply to the specific message, not your original post. This will let 
> you
> pick up that branch of the conversation directly and not confuse your 
> readers.)
>
> On 07Jun2018 08:39, T Berger  wrote:
> >On Wednesday, June 6, 2018 at 12:19:35 PM UTC-4, T Berger wrote:
> >> I’m learning Python on my own and have been stuck for two days trying to 
> >> get modules I created into site-packages. As a trial step, we were asked 
> >> to change directly into the folder containing our modules. I typed “cd 
> >> mymodules” per instructions, but got this error message: “-bash: cd: 
> >> mymodules: No such file or directory.” I saved mymodules to my documents. 
> >> What is going wrong here?
> >>
> >> When I tried to create a distribution file, I typed “192:~ TamaraB$ 
> >> mymodules$ python3 setup.py sdist.” I got this error message: “-bash: 
> >> mymodules$: command not found.” What should I do?
> [...snip...]
> > “We'll need some more information about the computer you are using: what OS
> > are you using (Mac, Linux, Windows, something else), what shell are you
> > using, perhaps a file listing of your home directory. “
> >
> >I’m using Terminal in Mac Sierra (10.12.6).
>
> Cool.
>
> >“(I'm not sure what the 192 part means. Does that increase each time you 
> >type a command?) “
> >
> >I'm new to Terminal, but that 192 looked weird to me too. It doesn’t 
> >increase, just stays at 192. There is also a thin gray left bracket in front 
> >of the “192” which didn’t copy into my email. Is there some way to restore 
> >the default prompt in Terminal (and what is the default prompt)?
>
> On a Mac, it tends to be like this: "{hostname}:~ {username}$ " where
> {hostname} is your Mac's name and {username} is your login name; that is 
> called
> the "shell prompt", and "the shell" is the command line interpreter running 
> the
> commands you type. On a Mac, this is usually bash, a UNIX Bourne shell.
>
> There is a secondary prompt like this "> ". That indicates that you're typing 
> a
> compond command, or at least that the shell believes you're typing a compond
> command, which is just a command which extends to more than one line. The
> common way to confuse the shell about this is to forget to close a quote - the
> shell expects that string to continue until it sees a closing quote.
>
> You can leave the secondary prompt by typing Control-C (often denoted "^C").
> That will cancel the incomplete command and get you back to a clean empty
> primary prompt.
>
> Note that if you start some interactive command, such as the interactive 
> Python
> interpreter, you will then be dealing with _its_ prompts until you leave that
> command.
>
> >Back to my problem. Your email helped me get into the mymodules folder, but 
> >I’m still stuck at the next step of the exercise, which is to get the module 
> >I created into site-packages. mymodules contains three files: the module we 
> >created, a setup file (setup.py), and a readme file. The line of text we 
> >were instructed to type into our terminal was: “python3 setup.py sdist.” In 
> >response, I got this error message: 
> >“/Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python:
> > can't open file 'setup.py': [Errno 2] No such file or directory”.
> >
> >Why is this not working for me?
>
> I would expect that your shell is not actually in the "mymodules" directory
> when you typed "python3 setup.py sdist". Usually your shell prompt includes 
> the
> current working directory (the "~" in my example above, which is your home
> directory), which is a useful contextual clue.
>
> You can also find out your current working directory by running the "pwd"
> command (the "print working directory" command).
>
> The "ls" (list) command without arguments will list what is in the current
> directory, so you can now check (a) whether you're where you thought you were,
> and (b) what is in the current directory (in case it doesn't contain what you
> expected).
>
>

Re: Problem finding my folder via terminal

2018-06-08 Thread Tamara Berger
Hi Cameron,

I'm replying via email because the Post Reply button is missing from
the forum website.

In answer to your comments, I am in the correct folder. But the "ls"
command did not return any files. Did I enter the command incorrectly?
Or are the files not recognized? Here is what I typed into terminal:

"Last login: Fri Jun  8 01:40:07 on ttys001

192:~ TamaraB$ cd Desktop/mymodules

192:mymodules TamaraB$ pwd

/Users/TamaraB/Desktop/mymodules

192:mymodules TamaraB$ ls

mymodules

192:mymodules TamaraB$"

Thanks,

Tamara
On Thu, Jun 7, 2018 at 10:27 PM Cameron Simpson  wrote:
>
> Hi,
>
> Replies inline below, which is the style we prefer on this list. (And to 
> reply,
> please reply to the specific message, not your original post. This will let 
> you
> pick up that branch of the conversation directly and not confuse your 
> readers.)
>
> On 07Jun2018 08:39, T Berger  wrote:
> >On Wednesday, June 6, 2018 at 12:19:35 PM UTC-4, T Berger wrote:
> >> I’m learning Python on my own and have been stuck for two days trying to 
> >> get modules I created into site-packages. As a trial step, we were asked 
> >> to change directly into the folder containing our modules. I typed “cd 
> >> mymodules” per instructions, but got this error message: “-bash: cd: 
> >> mymodules: No such file or directory.” I saved mymodules to my documents. 
> >> What is going wrong here?
> >>
> >> When I tried to create a distribution file, I typed “192:~ TamaraB$ 
> >> mymodules$ python3 setup.py sdist.” I got this error message: “-bash: 
> >> mymodules$: command not found.” What should I do?
> [...snip...]
> > “We'll need some more information about the computer you are using: what OS
> > are you using (Mac, Linux, Windows, something else), what shell are you
> > using, perhaps a file listing of your home directory. “
> >
> >I’m using Terminal in Mac Sierra (10.12.6).
>
> Cool.
>
> >“(I'm not sure what the 192 part means. Does that increase each time you 
> >type a command?) “
> >
> >I'm new to Terminal, but that 192 looked weird to me too. It doesn’t 
> >increase, just stays at 192. There is also a thin gray left bracket in front 
> >of the “192” which didn’t copy into my email. Is there some way to restore 
> >the default prompt in Terminal (and what is the default prompt)?
>
> On a Mac, it tends to be like this: "{hostname}:~ {username}$ " where
> {hostname} is your Mac's name and {username} is your login name; that is 
> called
> the "shell prompt", and "the shell" is the command line interpreter running 
> the
> commands you type. On a Mac, this is usually bash, a UNIX Bourne shell.
>
> There is a secondary prompt like this "> ". That indicates that you're typing 
> a
> compond command, or at least that the shell believes you're typing a compond
> command, which is just a command which extends to more than one line. The
> common way to confuse the shell about this is to forget to close a quote - the
> shell expects that string to continue until it sees a closing quote.
>
> You can leave the secondary prompt by typing Control-C (often denoted "^C").
> That will cancel the incomplete command and get you back to a clean empty
> primary prompt.
>
> Note that if you start some interactive command, such as the interactive 
> Python
> interpreter, you will then be dealing with _its_ prompts until you leave that
> command.
>
> >Back to my problem. Your email helped me get into the mymodules folder, but 
> >I’m still stuck at the next step of the exercise, which is to get the module 
> >I created into site-packages. mymodules contains three files: the module we 
> >created, a setup file (setup.py), and a readme file. The line of text we 
> >were instructed to type into our terminal was: “python3 setup.py sdist.” In 
> >response, I got this error message: 
> >“/Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python:
> > can't open file 'setup.py': [Errno 2] No such file or directory”.
> >
> >Why is this not working for me?
>
> I would expect that your shell is not actually in the "mymodules" directory
> when you typed "python3 setup.py sdist". Usually your shell prompt includes 
> the
> current working directory (the "~" in my example above, which is your home
> directory), which is a useful contextual clue.
>
> You can also find out your current working directory by running the "pwd"
> command (the "print working directory" command).
>
> The "ls" (list) command without arguments will list what is in the current
> directory, so you can now check (a) whether you're where you thought you were,
> and (b) what is in the current directory (in case it doesn't contain what you
> expected).
>
> The "ls -la" command will provide a longer and more detailed listing too.
>
> Let us know what you find out.
>
> Cheers,
> Cameron Simpson 
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why exception from os.path.exists()?

2018-06-08 Thread Antoon Pardon
On 08-06-18 04:19, Steven D'Aprano wrote:
> On Thu, 07 Jun 2018 17:45:06 +1000, Chris Angelico wrote:
>
>> So... an ASCIIZ string *can* contain that character, or
>> at least a representation of it. Yet it cannot contain "\0".
> You keep saying that as if it made one whit of difference to what 
> os.path.exists should do. I completely agree that ASCIIZ strings cannot 
> contain NUL bytes. What does that have to do with os.path.exists()?
>
> NTFS file systems use UTF-16 encoded strings. For typical mostly-ASCII 
> pathnames, the bytes on disk are *full* of NUL bytes. 

This is irrelevant. If you are on a linux box, you will still need to
pass an ASCIIZ string to the OS and won't be able to pass an embedded
NUL byte as part of a file name.

What is on the disk and what kind of remapping the OS performs to get
at the actual data, is something that happens in layer the user is
mostly not aware off.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why exception from os.path.exists()?

2018-06-08 Thread Marko Rauhamaa
Antoon Pardon :

> On 08-06-18 04:19, Steven D'Aprano wrote:
>> On Thu, 07 Jun 2018 17:45:06 +1000, Chris Angelico wrote:
>>
>>> So... an ASCIIZ string *can* contain that character, or
>>> at least a representation of it. Yet it cannot contain "\0".
>> [...]
>> NTFS file systems use UTF-16 encoded strings. For typical mostly-ASCII 
>> pathnames, the bytes on disk are *full* of NUL bytes. 
>
> This is irrelevant.

As for what is relevant for the original question is that the ValueError
exception is a practical trap that I have fallen into, and, as I
demonstrated yesterday, the http.server module has fallen into (through
os.path.isdir()). In fact, I couldn't spot a single instance of
os.path.exists() in the Python standard library that would guard against
a ValueError (to be sure, in almost all of the cases you could argue it
would be redundant).

Whatever your philosophical tastes, this unexpected feature of
os.path.exists() (& co) leads to unexpected application behavior IRL,
and, in the GhostBusters sense, that is bad.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Re: FULLSCREEN and DOUBLEBUF

2018-06-08 Thread Paul St George
Excellent. Now I know what to do in this instance and I understand the 
principle.


I hesitantly tried this:

    screen = pygame.display.set_mode((720,480), pygame.FULLSCREEN | 
pygame.DOUBLEBUF)


Hesitantly because I expected the *bitwise or operator* (|) to work like 
a toggle, so FULLSCREEN or DOUBLEBUF.


No errors were reported, but how would I check that DOUBLEBUF had been 
set? Is there a general rule, such as replace 'set_something' with 
'get_something'?


Paul St George


On 07/06/2018 19:56, Chris Angelico wrote:

On Fri, Jun 8, 2018 at 3:12 AM, Paul St George  wrote:

This is both a narrow question about some code and a more general question
about syntax in Python

Using the Pygame modules, I want to set both FULLSCREEN and DOUBLEBUF

I can use
screen =
pygame.display.set_mode((screen_width,screen_height),pygame.FULLSCREEN)
to set a FULLSCREEN display

Or, I can use
screen =
pygame.display.set_mode((screen_width,screen_height),pygame.DOUBLEBUF)
to set DOUBLEBUF

But how do I set both FULLSCREEN and DOUBLEBUF?

And, how can I test or check that DOUBLEBUF is set?

This is definitely a pygame question. So let's grab the docos for that
set_mode function.

https://www.pygame.org/docs/ref/display.html#pygame.display.set_mode

You're passing two parameters in each of your examples. The first is a
tuple of (w,h) for the dimensions; the second is a constant for the
mode you want. The name of the second argument is "flags", according
to the documentation. That usually means that you can provide
multiple. The exact mechanism for combining flags is given in the last
paragraph of the docs. I'll let you take the credit for figuring out
the details yourself :)

ChrisA



--
Paul St George
http://www.paulstgeorge.com
http://www.devices-of-wonder.com

+44(0)7595 37 1302

--
https://mail.python.org/mailman/listinfo/python-list


Re: Why exception from os.path.exists()?

2018-06-08 Thread Antoon Pardon
On 08-06-18 09:45, Marko Rauhamaa wrote:
> Whatever your philosophical tastes, this unexpected feature of
> os.path.exists() (& co) leads to unexpected application behavior IRL,
> and, in the GhostBusters sense, that is bad.

Sure, I agree that it is unexpected behaviour. But does that mean the
behaviour
should be fixed or that the behaviour should be better documented?

Either could be an answer and in trying to find the answer I don't think
the actual
FS is relevant because the doesn't access the FS directly but through
the OS api.

-- 
Antoon Pardon.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [ZODB] Django-hotsauce/ZODB 5.4.0/PyPy nightly sprint!!

2018-06-08 Thread Etienne Robillard



Le 2018-06-08 à 02:25, Mauro Amico a écrit :
seems to me really similar to 
https://github.com/zopefoundation/ZEO/pull/96 try to upgrade to ZEO 5.1.2


mauro.


Hey man!

Thanks for the heads up!

Looks like I messed up again... :)

That error was caused because my zodb database file was out of sync with 
the schema definition.


peace,

Etienne



Il Ven 8 Giu 2018, 03:29 Etienne Robillard > ha scritto:


Yo people I'm doing a nightly hacking sprint for django-hotsauce
on pypy
and got some cool bugs I would like to share:

Traceback (most recent call last):
   File "/usr/local/bin/schevo", line 11, in 
 load_entry_point('libschevo', 'console_scripts', 'schevo')()
   File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
32, in __call__
 return self.main(arg0, args)
   File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
74, in main
 return command()(*args)
   File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
32, in __call__
 return self.main(arg0, args)
   File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
74, in main
 return command()(*args)
   File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
32, in __call__
 return self.main(arg0, args)
   File "/home/erob/src/libschevo/lib/schevo/script/db_evolve.py",
line
86, in main
 db = schevo.database.open(url)
   File "/home/erob/src/libschevo/lib/schevo/database.py", line
371, in open
 db = Database(backend)
   File "/home/erob/src/libschevo/lib/schevo/database2.py", line
95, in
__init__
 self._update_extent_maps_by_name()
   File "/home/erob/src/libschevo/lib/schevo/database2.py", line
1633,
in _update_extent_maps_by_name
 for extent in self._extent_maps_by_id.itervalues():
   File "/usr/local/lib/python2.7/dist-packages/ZODB/Connection.py",
line 791, in setstate
 p, serial = self._storage.load(oid)
   File "/usr/local/lib/python2.7/dist-packages/ZODB/mvccadapter.py",
line 143, in load
 r = self._storage.loadBefore(oid, self._start)
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/ClientStorage.py", line
520,
in loadBefore
 return self._server.load_before(oid, tid)
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/client.py",
line 783,
in load_before
 return self.__call(self.client.load_before_threadsafe, oid, tid)
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/client.py",
line 748,
in call
 return self.wait_for_result(result, self.timeout)
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/client.py",
line 756,
in wait_for_result
 return future.result(timeout)
   File

"/usr/local/lib/python2.7/dist-packages/futures-3.0.5-py2.7.egg/concurrent/futures/_base.py",

line 405, in result
 return self.__get_result()
   File

"/usr/local/lib/python2.7/dist-packages/futures-3.0.5-py2.7.egg/concurrent/futures/_base.py",

line 357, in __get_result
 raise type(self._exception), self._exception, self._traceback
ZEO.Exceptions.ClientDisconnected: connection lost
erob@marina:/home/www/isotopesoftware.ca/trunk$



Not sure about this first one! :)

The command I'm trying to run is:

% schevo db evolve --app blogengine2 zodb://127.0.0.1:4545
 31

The ZODB 5.4.0 server then produce the following traceback:

2018-06-07T21:14:55 INFO ZEO.asyncio.base Connected server protocol
--
2018-06-07T21:14:55 INFO ZEO.asyncio.server received handshake 'Z5'
--
2018-06-07T21:14:55 ERROR ZEO.asyncio.marshal can't decode message:
'((ccopy_reg\n_reconstructor\n(czodbpickle\nbinary\nc__b...'
--
2018-06-07T21:14:55 ERROR ZEO.asyncio.server Can't deserialize message
Traceback (most recent call last):
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/server.py",
line 89,
in message_received
 message_id, async, name, args = self.decode(message)
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/marshal.py", line
114, in pickle_server_decode
 return unpickler.load() # msgid, flags, name, args
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/marshal.py", line
164, in server_find_global
 raise ImportError("import error %s: %s" % (module, msg))
ImportError: import error copy_reg:
--
2018-06-07T21:14:55 ERROR ZEO.asyncio.base data_received 4 0 True
Traceback (most recent call last):
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/base.py", line
128,
in data_received
 self.message_received(collected)
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/server.py",
line 94,
in message_received
 if message_id == -1:
Unboun

Re: [ZODB] Django-hotsauce/ZODB 5.4.0/PyPy nightly sprint!!

2018-06-08 Thread Etienne Robillard



Le 2018-06-08 à 02:25, Mauro Amico a écrit :
seems to me really similar to 
https://github.com/zopefoundation/ZEO/pull/96 try to upgrade to ZEO 5.1.2


mauro.


Hey man!

Thanks for the heads up!

Looks like I messed up again... :)

That error was caused because my zodb database file was out of sync with 
the schema definition.


peace,

Etienne



Il Ven 8 Giu 2018, 03:29 Etienne Robillard > ha scritto:


Yo people I'm doing a nightly hacking sprint for django-hotsauce
on pypy
and got some cool bugs I would like to share:

Traceback (most recent call last):
   File "/usr/local/bin/schevo", line 11, in 
 load_entry_point('libschevo', 'console_scripts', 'schevo')()
   File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
32, in __call__
 return self.main(arg0, args)
   File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
74, in main
 return command()(*args)
   File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
32, in __call__
 return self.main(arg0, args)
   File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
74, in main
 return command()(*args)
   File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
32, in __call__
 return self.main(arg0, args)
   File "/home/erob/src/libschevo/lib/schevo/script/db_evolve.py",
line
86, in main
 db = schevo.database.open(url)
   File "/home/erob/src/libschevo/lib/schevo/database.py", line
371, in open
 db = Database(backend)
   File "/home/erob/src/libschevo/lib/schevo/database2.py", line
95, in
__init__
 self._update_extent_maps_by_name()
   File "/home/erob/src/libschevo/lib/schevo/database2.py", line
1633,
in _update_extent_maps_by_name
 for extent in self._extent_maps_by_id.itervalues():
   File "/usr/local/lib/python2.7/dist-packages/ZODB/Connection.py",
line 791, in setstate
 p, serial = self._storage.load(oid)
   File "/usr/local/lib/python2.7/dist-packages/ZODB/mvccadapter.py",
line 143, in load
 r = self._storage.loadBefore(oid, self._start)
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/ClientStorage.py", line
520,
in loadBefore
 return self._server.load_before(oid, tid)
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/client.py",
line 783,
in load_before
 return self.__call(self.client.load_before_threadsafe, oid, tid)
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/client.py",
line 748,
in call
 return self.wait_for_result(result, self.timeout)
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/client.py",
line 756,
in wait_for_result
 return future.result(timeout)
   File

"/usr/local/lib/python2.7/dist-packages/futures-3.0.5-py2.7.egg/concurrent/futures/_base.py",

line 405, in result
 return self.__get_result()
   File

"/usr/local/lib/python2.7/dist-packages/futures-3.0.5-py2.7.egg/concurrent/futures/_base.py",

line 357, in __get_result
 raise type(self._exception), self._exception, self._traceback
ZEO.Exceptions.ClientDisconnected: connection lost
erob@marina:/home/www/isotopesoftware.ca/trunk$



Not sure about this first one! :)

The command I'm trying to run is:

% schevo db evolve --app blogengine2 zodb://127.0.0.1:4545
 31

The ZODB 5.4.0 server then produce the following traceback:

2018-06-07T21:14:55 INFO ZEO.asyncio.base Connected server protocol
--
2018-06-07T21:14:55 INFO ZEO.asyncio.server received handshake 'Z5'
--
2018-06-07T21:14:55 ERROR ZEO.asyncio.marshal can't decode message:
'((ccopy_reg\n_reconstructor\n(czodbpickle\nbinary\nc__b...'
--
2018-06-07T21:14:55 ERROR ZEO.asyncio.server Can't deserialize message
Traceback (most recent call last):
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/server.py",
line 89,
in message_received
 message_id, async, name, args = self.decode(message)
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/marshal.py", line
114, in pickle_server_decode
 return unpickler.load() # msgid, flags, name, args
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/marshal.py", line
164, in server_find_global
 raise ImportError("import error %s: %s" % (module, msg))
ImportError: import error copy_reg:
--
2018-06-07T21:14:55 ERROR ZEO.asyncio.base data_received 4 0 True
Traceback (most recent call last):
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/base.py", line
128,
in data_received
 self.message_received(collected)
   File "/home/erob/work/ZEO-5.1.0/src/ZEO/asyncio/server.py",
line 94,
in message_received
 if message_id == -1:
Unboun

Re: Problem finding my folder via terminal

2018-06-08 Thread Cameron Simpson

On 08Jun2018 01:20, Tamara Berger  wrote:

Before I reply to the meat of your email, I guess we'd better clear up
your initial issues. You write:

"Replies inline below, which is the style we prefer on this list. (And to reply,
please reply to the specific message, not your original post. This will let you
pick up that branch of the conversation directly and not confuse your readers.)"

1.  I don't know what you mean by "inline," though I do notice all the
single and double carets at the left margin. I don't understand the
underlying rationale for the different patterns. And how do I create
them, manually?


The inline style lets messages read like conversations, and lets you reply to 
the preceeding message point by point.


If you look at the text above, you'll see:

 On 08Jun2018 01:20, Tamara Berger  wrote:
 >Before I reply to the meat of your email, I guess we'd better clear up

and so on. You (the previous message) are identified and your text indented 
with a leading ">" symbol. My replies come below each point in your email, 
unindented and with a blank line separating them out.


Generally you keep just the context needed for your reply to make sense.  
Sometimes that involves keeping some message quote from even earlier messages, 
in which case _their_ intro line and text is preserved, with an extra level of 
">", like this:


 On Thu, Jun 7, 2018 at 10:27 PM Cameron Simpson  wrote:
 > Replies inline below, which is the style we prefer on this list. (And to 
 > reply,

 > please reply to the specific message, not your original post. This will let 
you
 > pick up that branch of the conversation directly and not confuse your 
readers.)
 >
 > On 07Jun2018 08:39, T Berger  wrote:
 > >... message text from you, now 2 messages back ...

Most mailers will arrange this nesting automatically for you. When you hit 
Reply you get a new message with the previous message already quoted in the 
text with leading ">" markers. All you need to do is trim it to just what you 
need to keep for context.


If you're doing this via the Post Reply button here:

 https://groups.google.com/forum/#!forum/comp.lang.python

you'll find the previous message quoted.

Instead of just putting your reply at the top, and maybe hand quoting soe line 
of text with cut/paste (which you seem to be doing), start scrolling down the 
quoted text. Just cut out anything no longer needed (but keeping the 
attribution. Then where you want to reply to a specifi point, insert a nice 
blank line and put in your reply, and leave another blank line. Then proceed 
down the rest of the quote deleting what isn't relevant and replying where you 
want to.


The advantages here are (a) you can keep as much context at you like and 
everyone can see that context because you've left it there and (b) the reply 
reads like a discussion - people can see what you said right after the text to 
which you're responding. For a reader, that is a huge advantage.


Anyway, that is the "inline" style, and a lot of techincal lists/groups use it 
because it keeps things very understandable, not just for the people directly 
involved but also for anyone else reading, who may decide to participate.



2.  I also don't understand your instruction that I reply to the
specific message and not to my original post. I did not reply to my
own post but to Steven's comments. And then I brought up my main
issue, which had remained unaddressed by his email.


Ah, here the fun begins. There are several forums for this list/group :-( The 
main two are the mailing list "python-list@pythonorg" and the newsgroup 
"comp.lang.python". It looks like you're using the latter, but via the Google 
Groups interface here (I'm guessing here from your message header lines):


 https://groups.google.com/forum/#!forum/comp.lang.python

Posts to one side are copied to the other. The mailing list has a lot less spam 
(witness the many "solution manual" posts etc in the google groups forum view).


Anyway, at least one gateway between the newsgroup and the list is known to 
mangle to In-Reply-To header on the the group->mail copy, which is what led me 
to think you'd replied to the wrong message.


My apologies for that.

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: Why exception from os.path.exists()?

2018-06-08 Thread Marko Rauhamaa
Antoon Pardon :

> On 08-06-18 09:45, Marko Rauhamaa wrote:
>> Whatever your philosophical tastes, this unexpected feature of
>> os.path.exists() (& co) leads to unexpected application behavior IRL,
>> and, in the GhostBusters sense, that is bad.
>
> Sure, I agree that it is unexpected behaviour. But does that mean the
> behaviour should be fixed or that the behaviour should be better
> documented?

I'd say it should be fixed. I would go so far as to say that os.stat()
should be fixed so that "" and "\0" result in the same exception (EINVAL
~ ValueError).

If the documentation option is taken, the documentation should emphasize
the issue. Furthermore, the http.server module should be fixed because
it is broken at the moment.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem finding my folder via terminal

2018-06-08 Thread Cameron Simpson

On 08Jun2018 01:52, Tamara Berger  wrote:

In answer to your comments, I am in the correct folder. But the "ls"
command did not return any files. Did I enter the command incorrectly?
Or are the files not recognized? Here is what I typed into terminal:

"Last login: Fri Jun  8 01:40:07 on ttys001
192:~ TamaraB$ cd Desktop/mymodules
192:mymodules TamaraB$ pwd
/Users/TamaraB/Desktop/mymodules
192:mymodules TamaraB$ ls
mymodules
192:mymodules TamaraB$"


It looks like you have a "mymodules" folder _inside_ your "Desktop/mymodules" 
folder. Form the /Users/TamaraB/Desktop/mymodules folder, type these commands.


 ls -la
 ls -la mymodules

(Feel free to omit any other stuff in your Desktop folder listing for privacy 
reasons.)


Or:

 cd ~/Desktop/mymodules
 ls -laR

The "R" option will create a recursive listing. Or you could just open the 
folder in the Finder and look around:


 open ~/Desktop/mymodules

I'm thinking you've just made an additional "mymodules" inside your main 
"mymodules" by accident.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-08 Thread bellcanadardp
On Sunday, 3 June 2018 20:11:43 UTC-4, Steven D'Aprano  wrote:
> On Sun, 03 Jun 2018 16:36:12 -0700, bellcanadardp wrote:
> 
> > hello peter ...how exactly would i solve this issue .i have a script
> > that works in python 2 but not pytho3..i did 2 to 3.py ...but i still
> > get the errro...character undefieed..unicode decode error cant decode
> > byte 1x09 in line 7414 from cp 1252..like would you have a sraright
> > solution answer??..i cant get a straight answer..it was ported from ansi
> > to python...so its utf-8 as far asi can see
> 
> You won't get a straight answer because you won't tell us *precisely* 
> what is happening.
> 
> Don't retype a summary of what you think the error is. "character 
> undefieed" is not a thing, and there is no such thing as "byte 1x09".
> 
> You need to COPY AND PASTE the EXACT error that you get. Not just the 
> last line, the error message, but the FULL TRACEBACK starting from the 
> line "Traceback" and going to the end.
> 
> Until you do that, we cannot give you a straight answer.
> 
> You also need to COPY AND PASTE the EXACT line of code that gives the 
> error, plus enough code so that it works. For a file read error, that 
> probably means code that opens the file, and then tries to read from it.
> 
> Until you do that, we cannot give you a straight answer.
> 
> You need to tell us what version of Python you are using, and the 
> operating system.
> 
> You should read this:
> 
> http://sscce.org/
> 
> Even though it is written for Java programmers, it applies to Python to.
> 
> If you think that your file is UTF-8, why are you using CP-1252 to read 
> the file?
> 
> https://en.wikipedia.org/wiki/Windows-1252
> 
> https://en.wikipedia.org/wiki/UTF-8
> 
> 
> 
> I recommend you start with reading this if you haven't already:
> 
> https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-
> software-developer-absolutely-positively-must-know-about-unicode-and-
> character-sets-no-excuses/
> 
> Sorry for the huge URL, try this if your mail client breaks it:
> 
> https://tinyurl.com/h8yg9d7
> 
> 
> Until you read that, you will probably remain confused about text  
> encodings and Unicode and will probably not understand the straight 
> answer we give you.
> 
> Also read: https://nedbatchelder.com/text/unipain.html
> 
> 
> 
> -- 
> Steven D'Aprano
> "Ever since I learned about confirmation bias, I've been seeing
> it everywhere." -- Jon Ronson

hello steven are you there??
i posted the full error message...plz  let me know if you need from traceback
if so..can you provide an email address where i can send a computer pic??
its a long error and it seems i cant post pics here...here is my email
tommy.ross@thefriendsnetwork,.ca

tommy
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Valid encodings for a Python source file

2018-06-08 Thread Richard Damon
On 6/7/18 4:40 PM, Daniel Glus wrote:
> I'm trying to figure out the entire list of possible encodings for a Python
> source file - that is, encodings that can go in a PEP 263
>  encoding specification, like #
> -*- encoding: foo -*-.
>
> Is this list the same as the list given in the documentation for the codecs
> library, under "Standard Encodings"
> ? If
> not, where can I find the actual list?
>
> (I know that list is the same as the set of unique values in CPython's
> /Lib/encodings/aliases.py
> ,
> or equivalently, the set of filenames in /Lib/encodings/
> , but again
> I'm not sure.)
> -Daniel

Reading the proposal, I see one thing that seems worthy of a comment,
the proposal specifically calls out the UTF-8 'BOM" sequence, (which the
Unicode standard actually doesn't recommend using, as UTF-8 doesn't have
a 'Byte Order Problem', but doesn't allow the UTF-16 (0xFF, 0xFE or
0xFE, 0xFF) or UCS-4 BOM (0x00, 0x00, 0xFE, 0xFF or 0xFF, 0xFE, 0x00,
0x00)  marks which while the formats are unlikely are very likely to
have the marks, and detecting the marks are very important to detect
those encoding as they are NOT 'ACSII Compatible' formats, so the rest
of the header doesn't match what would be expected.

-- 
Richard Damon

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Valid encodings for a Python source file

2018-06-08 Thread Thomas Jollans
On 2018-06-07 22:40, Daniel Glus wrote:
> I'm trying to figure out the entire list of possible encodings for a Python
> source file - that is, encodings that can go in a PEP 263
>  encoding specification, like #
> -*- encoding: foo -*-.
> 
> Is this list the same as the list given in the documentation for the codecs
> library, under "Standard Encodings"
> ? If
> not, where can I find the actual list?
> 
> (I know that list is the same as the set of unique values in CPython's
> /Lib/encodings/aliases.py
> ,
> or equivalently, the set of filenames in /Lib/encodings/
> , but again
> I'm not sure.)
> -Daniel


It's none of these.

To quote PEP 263:

> Any encoding which allows processing the first two lines in the way indicated 
> above is allowed as source code encoding, this includes ASCII compatible 
> encodings as well as certain multi-byte encodings such as Shift_JIS. It does 
> not include encodings which use two or more bytes for all characters like 
> e.g. UTF-16. The reason for this is to keep the encoding detection algorithm 
> in the tokenizer simple.

All of the lists above include encodings like UTF-16 that are not
sufficiently ASCII-compatible.

Of course, as Terry Reedy writes,
> For new code for python 3, don't use an encoding cookie.  Use an editor that 
> can save in utf-8 and tell it to do so if it does not do so by default. 


-- Thomas
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: FULLSCREEN and DOUBLEBUF

2018-06-08 Thread Rhodri James

On 08/06/18 09:00, Paul St George wrote:
Excellent. Now I know what to do in this instance and I understand the 
principle.


I hesitantly tried this:

     screen = pygame.display.set_mode((720,480), pygame.FULLSCREEN | 
pygame.DOUBLEBUF)


Hesitantly because I expected the *bitwise or operator* (|) to work like 
a toggle, so FULLSCREEN or DOUBLEBUF.


The bitwise OR operator peforms a bitwise OR, i.e. *both* flags get set.

No errors were reported, but how would I check that DOUBLEBUF had been 
set? Is there a general rule, such as replace 'set_something' with 
'get_something'?


There's documentation.  The link Chris gave you for 
pygame.display.set_mode() tells you that you get a Surface out of it. 
Reaching for the docs for that, this leaps out:


https://www.pygame.org/docs/ref/surface.html#pygame.Surface.get_flags
PS: it's generally considered polite not to top post on this mailing list.

--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-08 Thread Steven D'Aprano
On Fri, 08 Jun 2018 03:35:12 -0700, bellcanadardp wrote:

> hello steven are you there??
> i posted the full error message...

No you didn't.

I saw your post, and ignored it, because you didn't follow instructions. 
I told you we need to see the *full* traceback, starting from the line 
beginning "Traceback". You only posted the end of the traceback.

I told you we needed to see the actual line of code you are trying to 
run. You didn't show us the line of code you are trying to run.

We're not mind-readers. We can't fix code that we can't see, giving 
errors from a line you won't tell us, using a file we don't have.

Please read this before replying:

http://sscce.org/

Thank you.

-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why exception from os.path.exists()?

2018-06-08 Thread Steven D'Aprano
On Fri, 08 Jun 2018 09:27:17 +0200, Antoon Pardon wrote:

> On 08-06-18 04:19, Steven D'Aprano wrote:
>> On Thu, 07 Jun 2018 17:45:06 +1000, Chris Angelico wrote:
>>
>>> So... an ASCIIZ string *can* contain that character, or at least a
>>> representation of it. Yet it cannot contain "\0".
>> You keep saying that as if it made one whit of difference to what
>> os.path.exists should do. I completely agree that ASCIIZ strings cannot
>> contain NUL bytes. What does that have to do with os.path.exists()?
>>
>> NTFS file systems use UTF-16 encoded strings. For typical mostly-ASCII
>> pathnames, the bytes on disk are *full* of NUL bytes.
> 
> This is irrelevant.

Of course it is irrelevant, JUST LIKE I SAID IN THE PARAGRAPH YOU DELETED:

They're actually both equally implementation details and 
utterly irrelevant to the behaviour of os.path.exists.

(referring to both the NUL bytes in UTF-16 encoded NTFS file names, and 
the lack of NUL bytes in common Linux file names).

I think that's dirty debating tactics, a variant of "Strawman argument". 
I make a statement. You delete it, and respond saying the same thing I 
said, but making it out as if it were a devastating response to my 
argument.

Pretty pathetic really.

The existence or use of ASCIIZ strings by the Linux kernel are not the 
least bit relevant to the question of why, alone of a near-infinite 
number of possible invalid pathnames, those containing NUL are singled 
out for an exception when all others simply return False.



-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: FULLSCREEN and DOUBLEBUF

2018-06-08 Thread Darren Pardoe
On Friday, 8 June 2018 12:24:26 UTC+1, Rhodri James  wrote:
> On 08/06/18 09:00, Paul St George wrote:
> PS: it's generally considered polite not to top post on this mailing list.
> 
> -- 
> Rhodri James *-* Kynesim Ltd

Rhodri, Guys,
I have always top posted even though most editors start with the cursor at the 
bottom. Is there any foundation to this methodology as my logic suggest we top 
post?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sorting NaNs

2018-06-08 Thread Steven D'Aprano
On Fri, 08 Jun 2018 12:23:40 +1000, Chris Angelico wrote:

> On Fri, Jun 8, 2018 at 12:15 PM, Steven D'Aprano
>  wrote:
>> If you truly were limited to 2**32 different values (we're not), then
>> it would be exactly right and proper to expect a collision in 2**16
>> samples. Actually, a lot less than that: more like 78000.
>>
>> https://en.wikipedia.org/wiki/Birthday_problem
> 
> 2**16 is 65536, so the figure you give is pretty close to the
> rule-of-thumb estimate that the square root of your pool is where you're
> likely to have collisions.

D'oh!


I mean, I knew that, I was just testing to see if anyone was paying 
attention.





-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why exception from os.path.exists()?

2018-06-08 Thread Antoon Pardon
On 08-06-18 13:35, Steven D'Aprano wrote:
> On Fri, 08 Jun 2018 09:27:17 +0200, Antoon Pardon wrote:
>
>> On 08-06-18 04:19, Steven D'Aprano wrote:
>>> On Thu, 07 Jun 2018 17:45:06 +1000, Chris Angelico wrote:
>>>
 So... an ASCIIZ string *can* contain that character, or at least a
 representation of it. Yet it cannot contain "\0".
>>> You keep saying that as if it made one whit of difference to what
>>> os.path.exists should do. I completely agree that ASCIIZ strings cannot
>>> contain NUL bytes. What does that have to do with os.path.exists()?
>>>
>>> NTFS file systems use UTF-16 encoded strings. For typical mostly-ASCII
>>> pathnames, the bytes on disk are *full* of NUL bytes.
>> This is irrelevant.
> Of course it is irrelevant, JUST LIKE I SAID IN THE PARAGRAPH YOU DELETED:
>
> They're actually both equally implementation details and 
> utterly irrelevant to the behaviour of os.path.exists.
>
> (referring to both the NUL bytes in UTF-16 encoded NTFS file names, and 
> the lack of NUL bytes in common Linux file names).
>
> I think that's dirty debating tactics, a variant of "Strawman argument". 
> I make a statement. You delete it, and respond saying the same thing I 
> said, but making it out as if it were a devastating response to my 
> argument.
>
> Pretty pathetic really.

Get of your high horse. Sure I was too quick in my reaction, without
reading your contribution through. That is regretable but it happens.

But you are in no situation to cast the first stone. These things
and worse have been happening to you too.

> The existence or use of ASCIIZ strings by the Linux kernel are not the 
> least bit relevant to the question of why, alone of a near-infinite 
> number of possible invalid pathnames, those containing NUL are singled 
> out for an exception when all others simply return False.

Only if you phrase the question as being about eliminating an exception.
If you phrase the question as being about how invalid pathnames should
be treated and may consider that they all should raise an exception then
ASCIIZ is relevant as an illustration of what is in some situation an invalid
pathname.

-- 
Antoon.


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sorting NaNs

2018-06-08 Thread Chris Angelico
On Fri, Jun 8, 2018 at 9:37 PM, Steven D'Aprano
 wrote:
> On Fri, 08 Jun 2018 12:23:40 +1000, Chris Angelico wrote:
>
>> On Fri, Jun 8, 2018 at 12:15 PM, Steven D'Aprano
>>  wrote:
>>> If you truly were limited to 2**32 different values (we're not), then
>>> it would be exactly right and proper to expect a collision in 2**16
>>> samples. Actually, a lot less than that: more like 78000.
>>>
>>> https://en.wikipedia.org/wiki/Birthday_problem
>>
>> 2**16 is 65536, so the figure you give is pretty close to the
>> rule-of-thumb estimate that the square root of your pool is where you're
>> likely to have collisions.
>
> D'oh!
>
>
> I mean, I knew that, I was just testing to see if anyone was paying
> attention.
>

Plus, you were making another very clear point: Humans are *terrible*
at estimating exponentiation. Unless you've memorized specific values
(2**16 and 2**32 are fairly common and familiar), it's really hard to
estimate the value of x**y. Want to hazard a guess as to what
0.99**100 is? (That's the chances that a one-in-a-hundred event won't
happen after a hundred opportunities.) What about 85**8? (Theoretical
password entropy if you have uppercase, lowercase, digit, symbol.)
What is the smallest n such that 26**n > 85**8? (That's the length of
monocase password required for equivalent theoretical entropy.)

Thank you for that elegant demonstration of an important fact about humans. :-)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Ned Batchelder

On 6/8/18 2:34 AM, Thomas Jollans wrote:

On 07/06/18 22:36, Peter Pearson wrote:


X-Copyright: (C) Copyright 2018 Stefan Ram. All rights reserved. Distribution 
through any means
   other than regular usenet channels is forbidden. It is forbidden to publish 
this article in the
   Web, to change URIs of this article into links,and to transfer the 
body without this
   notice, but quotationsof parts in other Usenet posts are allowed.

As discussed previously [1], this arguably means that it's best if you
don't even quote his messages if your posts are mirrored on the mailing
list (as most people's are).

[1]. https://mail.python.org/pipermail/python-list/2017-November/728635.html


The restriction is absurd, and the idea that people will obey the 
restriction in the headers is absurd. If Stefan posts to a newsgroup in 
this day and age, he knows full well that his words will end up on http 
servers somewhere.  He needs to get over it, or stop posting to newsgroups.


--Ned.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Why exception from os.path.exists()?

2018-06-08 Thread eryk sun
On Fri, Jun 8, 2018 at 11:35 AM, Steven D'Aprano
 wrote:
>
> (referring to both the NUL bytes in UTF-16 encoded NTFS file names, and
> the lack of NUL bytes in common Linux file names).

NTFS filenames are stored as wchar_t strings, for which NUL is
L"\x00\x00". Individual null bytes are irrelevant to this problem,
unless we're using an encoding such as an ASCII superset that stores
the character NUL as "\x00".
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Chris Angelico
On Fri, Jun 8, 2018 at 10:13 PM, Ned Batchelder  wrote:
> On 6/8/18 2:34 AM, Thomas Jollans wrote:
>>
>> On 07/06/18 22:36, Peter Pearson wrote:
>>
>>> X-Copyright: (C) Copyright 2018 Stefan Ram. All rights reserved.
>>> Distribution through any means
>>>other than regular usenet channels is forbidden. It is forbidden to
>>> publish this article in the
>>>Web, to change URIs of this article into links,and to transfer
>>> the body without this
>>>notice, but quotationsof parts in other Usenet posts are
>>> allowed.
>>
>> As discussed previously [1], this arguably means that it's best if you
>> don't even quote his messages if your posts are mirrored on the mailing
>> list (as most people's are).
>>
>> [1].
>> https://mail.python.org/pipermail/python-list/2017-November/728635.html
>
>
> The restriction is absurd, and the idea that people will obey the
> restriction in the headers is absurd. If Stefan posts to a newsgroup in this
> day and age, he knows full well that his words will end up on http servers
> somewhere.  He needs to get over it, or stop posting to newsgroups.

Are news servers guaranteed to carry the X-Copyright header in all
transmissions? If not, the copyright notice isn't part of the message,
and is most likely unenforceable.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem finding my folder via terminal

2018-06-08 Thread MRAB

On 2018-06-08 09:53, Cameron Simpson wrote:
[snip]

Instead of just putting your reply at the top, and maybe hand quoting soe line
of text with cut/paste (which you seem to be doing), start scrolling down the
quoted text. Just cut out anything no longer needed (but keeping the
attribution. Then where you want to reply to a specifi point, insert a nice
blank line and put in your reply, and leave another blank line. Then proceed
down the rest of the quote deleting what isn't relevant and replying where you
want to.

If you omit some of the text, for clarity it's a good idea to show that 
you've done so by adding a line "[snip]", "[cut]" or something similar.


[snip]
--
https://mail.python.org/mailman/listinfo/python-list


Re: Problem finding my folder via terminal

2018-06-08 Thread Tamara Berger
Nope. No duplicate folder.
On Fri, Jun 8, 2018 at 5:35 AM Cameron Simpson  wrote:
>
> On 08Jun2018 01:52, Tamara Berger  wrote:
> >In answer to your comments, I am in the correct folder. But the "ls"
> >command did not return any files. Did I enter the command incorrectly?
> >Or are the files not recognized? Here is what I typed into terminal:
> >
> >"Last login: Fri Jun  8 01:40:07 on ttys001
> >192:~ TamaraB$ cd Desktop/mymodules
> >192:mymodules TamaraB$ pwd
> >/Users/TamaraB/Desktop/mymodules
> >192:mymodules TamaraB$ ls
> >mymodules
> >192:mymodules TamaraB$"
>
> It looks like you have a "mymodules" folder _inside_ your "Desktop/mymodules"
> folder. Form the /Users/TamaraB/Desktop/mymodules folder, type these commands.
>
>   ls -la
>   ls -la mymodules
>
> (Feel free to omit any other stuff in your Desktop folder listing for privacy
> reasons.)
>
> Or:
>
>   cd ~/Desktop/mymodules
>   ls -laR
>
> The "R" option will create a recursive listing. Or you could just open the
> folder in the Finder and look around:
>
>   open ~/Desktop/mymodules
>
> I'm thinking you've just made an additional "mymodules" inside your main
> "mymodules" by accident.
>
> Cheers,
> Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: FULLSCREEN and DOUBLEBUF

2018-06-08 Thread MRAB

On 2018-06-08 12:41, Darren Pardoe wrote:

On Friday, 8 June 2018 12:24:26 UTC+1, Rhodri James  wrote:

On 08/06/18 09:00, Paul St George wrote:
PS: it's generally considered polite not to top post on this mailing list.

--
Rhodri James *-* Kynesim Ltd


Rhodri, Guys,
I have always top posted even though most editors start with the cursor at the 
bottom. Is there any foundation to this methodology as my logic suggest we top 
post?

Those who invented and first used email decades ago found that the 
interleaved style with trimming of unwanted text worked best in practice.


Many years later, when the internet and World Wide Web gained widespread 
usage, people weren't told about what had been found to work best, and 
the email programs they used created a reply that quoted the original 
message and left the cursor at the top, so people just put their reply 
there.

--
https://mail.python.org/mailman/listinfo/python-list


Distribution file error

2018-06-08 Thread T Berger
Hi,

I really need help here.

I’m trying to create a distribution file for my module, but got an error 
message. The module, including the setup and read me files, are contained 
within the folder “mymodules.” I typed this command (per instructions from my 
workbook) from within mymodules folder:

192:~ TamaraB$ cd Desktop/mymodules/
192:mymodules TamaraB$ python3 setup.py sdist
/Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python:
 can't open file 'setup.py': [Errno 2] No such file or directory.

Why is this not working?

(I’m working in the OS Sierra terminal.)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Gene Heskett
On Friday 08 June 2018 08:18:19 Chris Angelico wrote:

> On Fri, Jun 8, 2018 at 10:13 PM, Ned Batchelder  
wrote:
> > On 6/8/18 2:34 AM, Thomas Jollans wrote:
> >> On 07/06/18 22:36, Peter Pearson wrote:
> >>> X-Copyright: (C) Copyright 2018 Stefan Ram. All rights reserved.
> >>> Distribution through any means
> >>>other than regular usenet channels is forbidden. It is
> >>> forbidden to publish this article in the
> >>>Web, to change URIs of this article into links,and to
> >>> transfer the body without this
> >>>notice, but quotationsof parts in other Usenet posts
> >>> are allowed.
> >>
> >> As discussed previously [1], this arguably means that it's best if
> >> you don't even quote his messages if your posts are mirrored on the
> >> mailing list (as most people's are).
> >>
> >> [1].
> >> https://mail.python.org/pipermail/python-list/2017-November/728635.
> >>html
> >
> > The restriction is absurd, and the idea that people will obey the
> > restriction in the headers is absurd. If Stefan posts to a newsgroup
> > in this day and age, he knows full well that his words will end up
> > on http servers somewhere.  He needs to get over it, or stop posting
> > to newsgroups.
>
> Are news servers guaranteed to carry the X-Copyright header in all
> transmissions? If not, the copyright notice isn't part of the message,
> and is most likely unenforceable.
>
> ChrisA

As the courts have so found when this has come up over the last 30 years. 
Basically, its just some newly minted lawyer trying to earn his place at 
the feeding trough.

It does have a tendency to scare off the copyright violators that can't 
afford a legal dept, pushing them under the bus.

Copyrights, Patents, often interchangeable in civil court, and
having been the victim  (because I was the designated Chief Operator at a 
tv station) of a frivolous patent that attacked every broadcast facility 
in the US, demanding royalties in the 5 digit range per month for 
implementing what the FCC edict said we had to do WRT the EAS system. 

The courts weren't amused. I don't know as any of us ever cut those 
patent troll turkey's a check, but if they did, they were also awarded 
triple damages. I've not heard that name in the press since. Probably 
changed to protect the guilty.

-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


Project tree and import module

2018-06-08 Thread ftg
Hello,

here is my project hierarchy:
myproject
 |
 |- django-project-name
 | |- django-project-name
 | | |-urls.py
 | | |-views.py
 | |- manage.py
 |- my-package

Is my projet tree correct? Shouldn't I put my-package into my 
django-project-name folder?
Because I am facing some questionning about how to reach my-package from 
views.py and in the current situation, 
I have to insert a sys.path.append line (with full path) in my views.py file, 
and I don't find this very elegant.
What if my package is really in another folder location? Should I need to use 
the sys.path.append function anyway?

Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: FULLSCREEN and DOUBLEBUF

2018-06-08 Thread Rhodri James

On 08/06/18 12:41, Darren Pardoe wrote:

On Friday, 8 June 2018 12:24:26 UTC+1, Rhodri James  wrote:

On 08/06/18 09:00, Paul St George wrote:
PS: it's generally considered polite not to top post on this mailing list.

--
Rhodri James *-* Kynesim Ltd


Rhodri, Guys,
I have always top posted even though most editors start with the cursor at the 
bottom. Is there any foundation to this methodology as my logic suggest we top 
post?



Others have given you the history, but I think this sums up the 
practicality nicely:


A: Because it reverses the order of the conversation
Q: Why is top posting unhelpful?

--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Distributing a Python module as .rpm and .deb packages across major distributions

2018-06-08 Thread adam . preble
I have a situation where internally I need to distribute some Python code using 
Linux packages rather than simply relying on wheel files. This seems to be a 
solved problem because a lot of Python modules clearly get distributed as .rpm 
and .deb. It's not completely unreasonable because soon I will have some other 
modules that are depending on binary applications that are also coming in from 
packages, and having the system package manage resolve and install all this is 
convenient. I'm not really in a political position to change that policy, for 
what it's worth.

I'm still stuck in Python 2.7 here for at least a few more months. Also, it 
probably helps to know this is a pure Python module that doesn't have to 
compile any native code.

Creating a package itself isn't a problem. In my case, I bandied with the 
bdist_rpm rule in setup.py, and used stdeb to add a bdist_deb rule. I get rpm 
and deb files from these, but they seem to be plagued with a problem of making 
assumptions about paths based on my build environment. I'm building on an 
Ubuntu rig where Python modules are installed into dist-packages. The rpm 
package will try to install my module into dist-packages instead of 
site-packages on a Red Hat rig. I haven't yet tried the Debian package on 
different rigs, but the stdeb documentation did call out that this likely won't 
work.

I'm wondering first if many of the modules we see in packages right now are 
actually literally being built using Jenkins or some other CD tool on every 
major OS distribution. If that's the case then at least I know and I can try to 
do that. I was surprised that I couldn't easily provide some additional flags. 
I believe I can specify a setup.cfg that can override the module installation 
path, and I think I can do a little shell script to just rotate different 
setup.cfg files through, but I can't help but wonder if I'm even on the right 
path.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Marko Rauhamaa
Gene Heskett :
> On Friday 08 June 2018 08:18:19 Chris Angelico wrote:
>> Are news servers guaranteed to carry the X-Copyright header in all
>> transmissions? If not, the copyright notice isn't part of the message,
>> and is most likely unenforceable.
>
> As the courts have so found when this has come up over the last 30 years. 
> Basically, its just some newly minted lawyer trying to earn his place at 
> the feeding trough.

Copyrights exist whether they are declared or not.

If I publish a poem or, say, a Python application on Usenet, you will
need my permission to distribute it. Of course, its dissemination via
Usenet and remailers is ultimately *me* distributing my work.

In one Usenet discussion I published my translation of a Finnish
Christmas carol. The author of the original lyrics had died more than 70
years before so that was ok. However, the melody was still under
copyright so I didn't have a right to *explain* in any direct manner how
the melody went.

Luckily, someone had posted the song on Youtube so I could provide a
link (although even that could be considered criminal in some
jurisdictions).


Marko

PS IMO copyright laws should be abolished altogether. At the very least
one should pay for copyright protection. One €1 for the first year, €2
for the second, €4 for the third and so on exponentially.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sorting NaNs

2018-06-08 Thread Peter Pearson
On Fri, 8 Jun 2018 02:15:02 + (UTC), Steven D'Aprano wrote:
> On Thu, 07 Jun 2018 20:43:10 +, Peter Pearson wrote:
[snip]
>> 
>> But gosh, if there are only 2**32 different "random" floats, then you'd
>> have about a 50% chance of finding a collision among any set of 2**16
>> samples.  Is that really tolerable?
>
> Why wouldn't it be? It would be shocking if a sufficiently large sequence 
> of numbers contained no collisions at all: that would imply the values 
> were very much NON random.

[snip]

> . . . I understand that Python's Mersenne Twister implementation 
> is based on 64-bit ints.

OK, I'll relax, particularly since Michael Lamparski's experiment
strongly indicates that random floats are drawn from a population much
larger than 2**16.

You're completely correct, of course, in noting that an absence of
collisions would condemn the random-number generator just as badly
as an excess.  What bothered me was my feeling that a "reasonable
observer" would expect the random-float population to be much larger
than 2**32, and the probably-collision-free sample size to be accordingly
much larger than 2**16, which is, after all, small enough to appear
in many applications.

Exactly what the "reasonable observer" would expect that population to
be, I don't know.  To a mathematician, there's zero chance of collision
in any finite sample of real numbers, or even just rational numbers; but
I don't think anybody would expect that from a computer.  When I picture
the diligent software engineer asking himself, "Wait, how large can I
make this sample before I'll start seeing collisions," I imagine his
first guess is going to be the size of a float's mantissa.

What applications would have to worry about colliding floats?  I
don't know.  I'm coming from cryptology, where worrying about such
things becomes a reflex.

-- 
To email me, substitute nowhere->runbox, invalid->com.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Thomas Jollans
On 08/06/18 14:13, Ned Batchelder wrote:
> On 6/8/18 2:34 AM, Thomas Jollans wrote:
>> On 07/06/18 22:36, Peter Pearson wrote:
>>
>>> X-Copyright: (C) Copyright 2018 Stefan Ram. All rights reserved.
>>> Distribution through any means
>>>    other than regular usenet channels is forbidden. It is forbidden
>>> to publish this article in the
>>>    Web, to change URIs of this article into links,    and to
>>> transfer the body without this
>>>    notice, but quotations    of parts in other Usenet posts are
>>> allowed.
>> As discussed previously [1], this arguably means that it's best if you
>> don't even quote his messages if your posts are mirrored on the mailing
>> list (as most people's are).
>>
>> [1].
>> https://mail.python.org/pipermail/python-list/2017-November/728635.html
> 
> The restriction is absurd, and the idea that people will obey the
> restriction in the headers is absurd. If Stefan posts to a newsgroup in
> this day and age, he knows full well that his words will end up on http
> servers somewhere.  He needs to get over it, or stop posting to newsgroups.
> 
> --Ned.

Quite right. Of course it's probably unenforceable, but that's not
really the point.

I have nothing against Stefan. In fact, back when I could (illegally)
see his posts, I quite enjoyed them. However, if he writes in a public
forum like this, he should accept that he's writing in a public forum.
As long as he doesn't, it's only right that he should be banned (from
the list) and ignored (by the few remaining comp.lang.python users).

-- Thomas
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Chris Angelico
On Sat, Jun 9, 2018 at 3:34 AM, Marko Rauhamaa  wrote:
> Gene Heskett :
>> On Friday 08 June 2018 08:18:19 Chris Angelico wrote:
>>> Are news servers guaranteed to carry the X-Copyright header in all
>>> transmissions? If not, the copyright notice isn't part of the message,
>>> and is most likely unenforceable.
>>
>> As the courts have so found when this has come up over the last 30 years.
>> Basically, its just some newly minted lawyer trying to earn his place at
>> the feeding trough.
>
> Copyrights exist whether they are declared or not.

Yes, this is true. It's not copyright that is unenforceable, but the
copyright notice in his message. Nobody is denying that he owns his
own words; but by posting them on a public forum, he - like everyone
else here - is implicitly granting us the right to read them.

> If I publish a poem or, say, a Python application on Usenet, you will
> need my permission to distribute it. Of course, its dissemination via
> Usenet and remailers is ultimately *me* distributing my work.

Right. Imagine if I write a poem, just like you say, and then I have
the words posted on a gigantic billboard. In small print in the bottom
corner of the billboard, I say "Copyright 2018 Chris Angelico. Taking
photographs of this billboard is forbidden.". Do I still own copyright
in the poem? Definitely. Can I stop people from (or sue people for)
taking photos of the billboard? Probably not, although that's one for
the lawyers to argue.

> In one Usenet discussion I published my translation of a Finnish
> Christmas carol. The author of the original lyrics had died more than 70
> years before so that was ok. However, the melody was still under
> copyright so I didn't have a right to *explain* in any direct manner how
> the melody went.
>
> Luckily, someone had posted the song on Youtube so I could provide a
> link (although even that could be considered criminal in some
> jurisdictions).

That's the flip side of copyright: you're taking someone else's
copyrighted material and posting it in public. Since you are not the
author, you do not inherently have the right to do that. There are
various legal permissions (very old works, "fair use", etc), but
absent those, you would be violating copyright.

(Whether linking to a third-party Youtube video is itself a violation
of the original author's copyright is even more complicated. IANAL and
I am not going to even think about how messy that situation could
get.)

> PS IMO copyright laws should be abolished altogether. At the very least
> one should pay for copyright protection. One €1 for the first year, €2
> for the second, €4 for the third and so on exponentially.

Why should I have to pay money for the right to own my own creations?
At what point does a creation have to be paid for - do I pay only if I
think that I can make money off it? If I fail to pay, what happens -
are people allowed to completely reuse and remix my work without even
acknowledging me?

And who would you pay that to anyway? The one world government?

Copyright laws and international treaties are there to protect content
creators and encourage creation. They need to have set expiration time
(IMO 50 years is long enough - not "50 years since author's death" but
50 years since publication) after which the work becomes free to use,
but the protections are important and extremely useful. Open source
would not exist without copyright, because it is copyright law that
gives license terms their meaning. Even if your license terms amount
to "do what you like with this but be sure to credit me as the
author", that's only enforceable because of copyright law. If people
had to pay exorbitant rates for the privilege of being properly
credited for their work, theft would completely trump generosity.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Marko Rauhamaa
Chris Angelico :

> On Sat, Jun 9, 2018 at 3:34 AM, Marko Rauhamaa  wrote:
>> PS IMO copyright laws should be abolished altogether. At the very
>> least one should pay for copyright protection. One €1 for the first
>> year, €2 for the second, €4 for the third and so on exponentially.
>
> Why should I have to pay money for the right to own my own creations?

You shouldn't have to. IMO the government shouldn't interfere with other
people distributing your creations without your permission.

I offered a compromise: the government steps in to defend your monopoly
to your creation and you will pay for the protection -- exponentially.

> At what point does a creation have to be paid for - do I pay only if I
> think that I can make money off it? If I fail to pay, what happens -

No money, no protection.

> are people allowed to completely reuse and remix my work without even
> acknowledging me?

That would be ideal, absolutely!

> And who would you pay that to anyway? The one world government?

A good question! If I violate your foreign copyright in my country,
which country should enforce the collection of damages?

There's a precedent. If I send you a letter by mail, only my country's
postal service gets money but your country's postal service will deliver
it to you without compensation.

> the protections are important and extremely useful.

Disagree there.

> Open source would not exist without copyright, because it is copyright
> law that gives license terms their meaning.

Some people would lose, others would win. On the balance, society would
win out by dropping the concept of a copyright.

> If people had to pay exorbitant rates for the privilege of being
> properly credited for their work, theft would completely trump
> generosity.

That wouldn't be theft.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Gene Heskett
On Friday 08 June 2018 13:34:44 Marko Rauhamaa wrote:

> Gene Heskett :
> > On Friday 08 June 2018 08:18:19 Chris Angelico wrote:
> >> Are news servers guaranteed to carry the X-Copyright header in all
> >> transmissions? If not, the copyright notice isn't part of the
> >> message, and is most likely unenforceable.
> >
> > As the courts have so found when this has come up over the last 30
> > years. Basically, its just some newly minted lawyer trying to earn
> > his place at the feeding trough.
>
> Copyrights exist whether they are declared or not.
>
> If I publish a poem or, say, a Python application on Usenet, you will
> need my permission to distribute it. Of course, its dissemination via
> Usenet and remailers is ultimately *me* distributing my work.
>
> In one Usenet discussion I published my translation of a Finnish
> Christmas carol. The author of the original lyrics had died more than
> 70 years before so that was ok. However, the melody was still under
> copyright so I didn't have a right to *explain* in any direct manner
> how the melody went.
>
> Luckily, someone had posted the song on Youtube so I could provide a
> link (although even that could be considered criminal in some
> jurisdictions).
>
>
> Marko
>
> PS IMO copyright laws should be abolished altogether. At the very
> least one should pay for copyright protection. One €1 for the first
> year, €2 for the second, €4 for the third and so on exponentially.

I rather like that idea. Unforch, who would be in charge of keeping the 
books uptodate? The USTPO? Of course that would expand another guvmnt 
agencies payroll x10, and its a waste of taxpayer dollars since Albert 
retired anyway.

Here in the hew hess aye, we originally had a copyright term of 7 years, 
renewable just once for another 7. I will date myself by saying I can 
actually remember those days.  But then Disney started buying senators 
and congressmen, and we now have this asinine lifetime +70 years just to 
keep Mickey Mouse and Company's (oh, and don't forget a widow named 
Cher) income rolling in.

Thats the sort of stuff usually found, warm and squishy, on the ground 
behind the male of the bovine specie.

-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


How to install matplotlib in Debian 9

2018-06-08 Thread Markos

Hi,

I'm starting my studies with Python 3 on Debian 9 that I just installed.

I have to install the matplotlib module, but I am in doubt what is the 
difference of the commands:


pip3 install matplotlib

or

apt-get install python3-matplotlib

Is there any difference in the packages which are installed?

Thanks,

Markos

--
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Marko Rauhamaa
Gene Heskett :

> On Friday 08 June 2018 13:34:44 Marko Rauhamaa wrote:
>> PS IMO copyright laws should be abolished altogether. At the very
>> least one should pay for copyright protection. One €1 for the first
>> year, €2 for the second, €4 for the third and so on exponentially.
>
> I rather like that idea. Unforch, who would be in charge of keeping the 
> books uptodate? The USTPO? Of course that would expand another guvmnt 
> agencies payroll x10, and its a waste of taxpayer dollars since Albert 
> retired anyway.

That exponential system would pay for itself. At the moment nobody pays
the government to enforce copyrights.

> But then Disney started buying senators and congressmen, and we now
> have this asinine lifetime +70 years just to keep Mickey Mouse and
> Company's (oh, and don't forget a widow named Cher) income rolling in.

In my scheme, €15/$15 would buy you four years of exclusive rights to
your creation. If it turns profitable, an extra $1,008 would give you
six more years (10 years total -- not too bad). And if you hit a
jackpot, $1,000,000 for twenty years of exclusive rights shouldn't be
too much to ask.

And speaking of Disney, for a mere $1,000,000,000 it could get a
whopping 30 years of exclusive rights to Mickey Mouse!


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Larry Martell
On Fri, Jun 8, 2018 at 3:16 PM, Marko Rauhamaa  wrote:
> At the moment nobody pays
> the government to enforce copyrights.

No, everyone pays for what the government does.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread MRAB

On 2018-06-08 19:11, Marko Rauhamaa wrote:

Chris Angelico :


On Sat, Jun 9, 2018 at 3:34 AM, Marko Rauhamaa  wrote:

PS IMO copyright laws should be abolished altogether. At the very
least one should pay for copyright protection. One €1 for the first
year, €2 for the second, €4 for the third and so on exponentially.


Why should I have to pay money for the right to own my own creations?


You shouldn't have to. IMO the government shouldn't interfere with other
people distributing your creations without your permission.

I offered a compromise: the government steps in to defend your monopoly
to your creation and you will pay for the protection -- exponentially.


At what point does a creation have to be paid for - do I pay only if I
think that I can make money off it? If I fail to pay, what happens -


No money, no protection.


So those with the most money can buy the most protection?

[snip]
--
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Chris Angelico
On Sat, Jun 9, 2018 at 6:59 AM, MRAB  wrote:
> On 2018-06-08 19:11, Marko Rauhamaa wrote:
>>
>> Chris Angelico :
>>
>>> On Sat, Jun 9, 2018 at 3:34 AM, Marko Rauhamaa  wrote:

 PS IMO copyright laws should be abolished altogether. At the very
 least one should pay for copyright protection. One €1 for the first
 year, €2 for the second, €4 for the third and so on exponentially.
>>>
>>>
>>> Why should I have to pay money for the right to own my own creations?
>>
>>
>> You shouldn't have to. IMO the government shouldn't interfere with other
>> people distributing your creations without your permission.
>>
>> I offered a compromise: the government steps in to defend your monopoly
>> to your creation and you will pay for the protection -- exponentially.
>>
>>> At what point does a creation have to be paid for - do I pay only if I
>>> think that I can make money off it? If I fail to pay, what happens -
>>
>>
>> No money, no protection.
>>
> So those with the most money can buy the most protection?

Yes, or more specifically, those who believe they can make the most
money from that protection. Ownership becomes pay-to-win, literally.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: logging with multiprocessing

2018-06-08 Thread Schachner, Joseph
Multiprocessing, not multithreading.  Different processes.   This is pretty 
easy to do.

I have done this from a Python script to run an analysis program on many sets 
of data, at once.  To do it: 1) if there is going to be an output file, each 
output file must have a distinct name.   2) To use logging, log to file, and 
each log file will have to have  a distinct name.   This is not hard to do.  I 
assume input data is different for each run, so we don't have to do anything 
about that.  Then there won't be any conflict.  Input files are distinct output 
files are distinct, and log files are distinct.  

When I did this, we had the pleasure of running on a 20 core dual Xeon based 
system,  I don't remember if ran 20 processes at a time or slightly less.  
Anyway, we really did achieve nearly linear speed up. Windows did assign these 
processes to separate cores.

--- Joe S. 

-Original Message-
From: jenil.desa...@gmail.com  
Sent: Thursday, June 7, 2018 2:46 PM
To: python-list@python.org
Subject: logging with multiprocessing

Hello,

I am new to logging module. I want to use logging module with multiprocessing. 
can anyone help me understand how can I do it?. Any help would be appreciated.

Thank you.


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem finding my folder via terminal

2018-06-08 Thread Cameron Simpson

On 08Jun2018 10:23, Tamara Berger  wrote:

On Fri, Jun 8, 2018 at 5:35 AM Cameron Simpson  wrote:

On 08Jun2018 01:52, Tamara Berger  wrote:
>192:~ TamaraB$ cd Desktop/mymodules
>192:mymodules TamaraB$ pwd
>/Users/TamaraB/Desktop/mymodules
>192:mymodules TamaraB$ ls
>mymodules

It looks like you have a "mymodules" folder _inside_ your "Desktop/mymodules"
folder. Form the /Users/TamaraB/Desktop/mymodules folder, type these commands.

  ls -la
  ls -la mymodules


Nope. No duplicate folder.


Your Terminal transcript above says otherwise, because (a) you're standing in 
"/Users/TamaraB/Desktop/mymodules" and (b) the "ls" command shows:


 mymodules

Therefore, _inside_ the "/Users/TamaraB/Desktop/mymodules" folder there is 
something called "mymodules", unless the transcript above is not complete.


Please pos the result of:

 ls -laR /Users/TamaraB/Desktop/mymodules

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: Distribution file error

2018-06-08 Thread Cameron Simpson

On 08Jun2018 07:52, Tamara Berger  wrote:
I’m trying to create a distribution file for my module, but got an error 
message. The module, including the setup and read me files, are contained 
within the folder “mymodules.” I typed this command (per instructions from my 
workbook) from within mymodules folder:


192:~ TamaraB$ cd Desktop/mymodules/
192:mymodules TamaraB$ python3 setup.py sdist
/Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python:
 can't open file 'setup.py': [Errno 2] No such file or directory.

Why is this not working?

(I’m working in the OS Sierra terminal.)


The immediate reason that comes to mind is that there's isn't a "setup.py" file 
in that folder. What _is_ in that folder?


We're already discussing this in another thread; it's better to keep all this 
stuff together.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-08 Thread Cameron Simpson

On 05Jun2018 06:42, bellcanada...@gmail.com  wrote:

On Sunday, 3 June 2018 20:11:43 UTC-4, Steven D'Aprano  wrote:

Don't retype a summary of what you think the error is. "character
undefieed" is not a thing, and there is no such thing as "byte 1x09".

You need to COPY AND PASTE the EXACT error that you get. Not just the
last line, the error message, but the FULL TRACEBACK starting from the
line "Traceback" and going to the end.

[...]


here is the exact error full message
in the attachment...UPDATE..i am manually modifying this reply..i tried to 
answer by my gmail but i get errors and i couldnt find this webpage till today 
and it doesnt accept attachments..so many you can for future provide an email 
if thats ok...anyway i will write the error manually here:


Many of us read this group/list via the mailing list python-list@python.org.  
I've CCed it here. Just avoid Google Groups, they're an awful interface to both 
usenet and mailing lists.


File 
"C:\Users\Robert\AppData\Local\Programs\Python\Python36\lib\encodings\cp1252.py", 
line 23, in decode

return codecs.charmap_decode(input,self.errors,decoding_table[0]
UnicodeDecodeError: 'charmap'codec can't decode byte 0x9d in position 7414: character 
maps to 


As Steven has remarked, this is not the complete traceback he requested, just 
the end. We need to know the entire execution stack.


for the record i did not puprosely set the code or decode o encode to cp-1252; 
this is a 3rd party script i have from the internet thats all


Can you say where it came from and how you fetched it? That may affect how the 
file got into this situation and how it might be repaired.


It might also let us fetch the file ourselves to look at it.


this a  set of files that runs find in python 2.7
i am trying to run it in python 3 becuz i was told in 2020 python 2 will no 
longer be supported
not sure if that really matters for my script


It may not matter, but as a general rule you should try to use Python 3 for new 
stuff. Python 2 is effectively end of life.


it runs completey fine in python 2, so for me the issue is with python 3 and 
its changes relative to python 2


It is possible that Python 2 is just glossing over the problem; Python 3 has a 
more rigorous view of character data.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Marko Rauhamaa
Chris Angelico :

> On Sat, Jun 9, 2018 at 6:59 AM, MRAB  wrote:
>> So those with the most money can buy the most protection?
>
> Yes, or more specifically, those who believe they can make the most
> money from that protection. Ownership becomes pay-to-win, literally.

In the words of Scrooge McDuck:

   https://i.stack.imgur.com/rMeiB.png>


But guys, surely you are familiar with the exponential function:

 * Everybody can afford a year for $1.

 * Every worthwhile creation is worth $1,000 for ten years.

 * And if Disney can pay the fee for Mickey Mouse for fifty years, the
   United States Government can quit all taxation, pay off the national
   debt and buy every American a luxury yacht and a private island in
   the Caribbean.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to install matplotlib in Debian 9

2018-06-08 Thread Jim Lee


On 06/08/2018 11:54 AM, Markos wrote:

Hi,

I'm starting my studies with Python 3 on Debian 9 that I just installed.

I have to install the matplotlib module, but I am in doubt what is the 
difference of the commands:


pip3 install matplotlib

or

apt-get install python3-matplotlib

Is there any difference in the packages which are installed?

Thanks,

Markos

It's generally preferable to use your distribution's package manager 
(apt-get) to install packages, as you will then receive updates as they 
become available.  However, Debian is notorious for having 
stale/outdated packages in its repository.  If you need the latest 
version of matplotlib, use pip (you'll have to update it manually).  If 
you want old but stable, use apt-get.


-Jim


--
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Gene Heskett
On Friday 08 June 2018 16:01:06 Larry Martell wrote:

> On Fri, Jun 8, 2018 at 3:16 PM, Marko Rauhamaa  
wrote:
> > At the moment nobody pays
> > the government to enforce copyrights.
>
> No, everyone pays for what the government does, poorly.

There, I fixed it for you Larry. :)

-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sorting NaNs

2018-06-08 Thread Steven D'Aprano
On Fri, 08 Jun 2018 17:45:58 +, Peter Pearson wrote:

> What bothered me was my feeling that a "reasonable observer"
> would expect the random-float population to be much larger than 2**32,
> and the probably-collision-free sample size to be accordingly much
> larger than 2**16, which is, after all, small enough to appear in many
> applications.

People's intuition about probability is crap. Hence the Birthday Paradox 
I already linked to, and the Monty Hall Problem, which you can google 
for, and the Prosecutor's Fallacy:

http://www.conceptstew.co.uk/pages/prosecutors_fallacy.html

which sometimes (often?) leads to real miscarriages of justice:

https://en.wikipedia.org/wiki/Sally_Clark




-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

-- 
https://mail.python.org/mailman/listinfo/python-list


Django-hotsauce 0.9.4.1 is out

2018-06-08 Thread Etienne Robillard

Hi everyone,

Django-hotsauce 0.9.4.1 (open source edition) is out!

What's new

- Maintenance bugfixes for ZODBController class (cPython, PyPy)

- Minor bugfixes and updates

Download

- https://pypi.org/pypi/Django-hotsauce/

- 
https://www.isotopesoftware.ca/pub/django-hotsauce/django-hotsauce-0.9.4.1.tar.gz


Have fun!

Etienne



--
Etienne Robillard
tkad...@yandex.com
https://www.isotopesoftware.ca/

--
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Chris Angelico
On Sat, Jun 9, 2018 at 8:19 AM, Marko Rauhamaa  wrote:
> Chris Angelico :
>
>> On Sat, Jun 9, 2018 at 6:59 AM, MRAB  wrote:
>>> So those with the most money can buy the most protection?
>>
>> Yes, or more specifically, those who believe they can make the most
>> money from that protection. Ownership becomes pay-to-win, literally.
>
> In the words of Scrooge McDuck:
>
>https://i.stack.imgur.com/rMeiB.png>
>
>
> But guys, surely you are familiar with the exponential function:
>
>  * Everybody can afford a year for $1.

$1 per what, though? According to GitHub, I have 157 repositories. Is
that 157 separate things that cost $1 for a single year of protection?
Or do I pay per file of source code?

>  * Every worthwhile creation is worth $1,000 for ten years.

Not true by a long shot, and if you don't believe me, you can pay me
$1000 right now for ten years' use of any of my free software.

>  * And if Disney can pay the fee for Mickey Mouse for fifty years, the
>United States Government can quit all taxation, pay off the national
>debt and buy every American a luxury yacht and a private island in
>the Caribbean.

And if you think that Disney would actually let it compound according
to your theoretical definition, you're a dupe AND a fool. They'd
figure out some way to reset the counter every five years.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Steven D'Aprano
On Sat, 09 Jun 2018 03:54:25 +1000, Chris Angelico wrote:

> Right. Imagine if I write a poem, just like you say, and then I have the
> words posted on a gigantic billboard. In small print in the bottom
> corner of the billboard, I say "Copyright 2018 Chris Angelico. Taking
> photographs of this billboard is forbidden.". Do I still own copyright
> in the poem? Definitely. Can I stop people from (or sue people for)
> taking photos of the billboard? Probably not, although that's one for
> the lawyers to argue.

If it were you? Probably not.

If it were a building owned by a major company with deep pockets and 
powerful friends, or one with a "special relationship" to the government, 
especially if they can make a buck from it? Then yes, taking photos of 
publicly visible buildings and even natural features can be copyright 
infringement.

https://www.diyphotography.net/10-famous-landmarks-youre-allowed-
photograph-commercial-use/

[,...]
> (Whether linking to a third-party Youtube video is itself a violation of
> the original author's copyright is even more complicated. IANAL and I am
> not going to even think about how messy that situation could get.)

Describing a link to a Youtube video as copyright infringement is an 
incredibly egregious example of copyright creep. Such a link in no way 
copies the copyrighted work, nor does it distribute the work.

(The video itself may or may not infringe, but that's another question.)

It might be argued that it *facilitates copyright infringement*, in the 
same way telling people that they can buy a crowbar from Bunnings 
facilitates breaking and entering. But it does not and should not be 
considered copyright infringement under any circumstances.

The fact that people even fear that it might is a good example of how the 
necessary and useful monopoly of copyright has grown to be a monster.


[...]
> Why should I have to pay money for the right to own my own creations?

Because such a right is no right at all, but a privilege granted to you 
by the government for specific purposes. Copyright is not a natural right.

Because such a privilege infringes on other people's natural rights to 
copy what they see and hear. If somebody tells you a story, it is the 
most natural thing in the world to repeat it if you liked it.

> And who would you pay that to anyway? The one world government?

No, your national government of course, which would then have treaties 
with other trading blocks or countries that effectively say "you respect 
and enforce our copyrights and we'll respect and enforce yours".

But how quickly we forget the past. In my lifetime, copyright was not 
automatic. You had to officially register a work, or else it was in the 
public domain. If it wasn't worth it to you to fill out a registration 
form and post it, why should you be given a monopoly on the work?

For decades the US government charged a fee to register copyright, and 
the vast bulk of copyrighted works were not renewed after the first 13 
year term expired. Which is perfectly normal: the vast bulk of copyright 
works have no real value to the creator and no reasonable prospect of 
earning them income after a decade or two. And yet we impoverish our 
cultural commons by keeping works locked up under monopolistic laws for a 
lifetime past the death the author.

I think that the monopolization of so-called "intellectual property" 
rights has grown to a harmful extent. Economists who study this have 
found that copyright hurts the economy more than it helps (it discourages 
creators more than encourages) but if we could roll it back somewhat, I 
think it would be a good and useful tool:

- automatic, free copyright for an initial term of, let's say, 20 years;

- followed by one more free term of ten years requiring registration;

- followed by additional ten-year copyright terms, paid for at (say)
  $100 a term;

- up to a maximum length of sixty years, or the author's life plus
  30 years, whichever comes first;

- and a real commitment to recognising the public domain and free
  culture it as an asset to be protected and encouraged, not just
  a commons to be looted, monetized and locked up.



-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-06-08 Thread Steven D'Aprano
On Sat, 09 Jun 2018 08:26:10 +1000, Cameron Simpson wrote:

> It is possible that Python 2 is just glossing over the problem; Python 3
> has a more rigorous view of character data.

I would say that is more than just possible, it is almost certain.



-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Chris Angelico
On Sat, Jun 9, 2018 at 10:53 AM, Steven D'Aprano
 wrote:
> On Sat, 09 Jun 2018 03:54:25 +1000, Chris Angelico wrote:
>> (Whether linking to a third-party Youtube video is itself a violation of
>> the original author's copyright is even more complicated. IANAL and I am
>> not going to even think about how messy that situation could get.)
>
> Describing a link to a Youtube video as copyright infringement is an
> incredibly egregious example of copyright creep. Such a link in no way
> copies the copyrighted work, nor does it distribute the work.
>
> (The video itself may or may not infringe, but that's another question.)
>
> It might be argued that it *facilitates copyright infringement*, in the
> same way telling people that they can buy a crowbar from Bunnings
> facilitates breaking and entering. But it does not and should not be
> considered copyright infringement under any circumstances.

It was the "facilitates" part that I was referring to. If the video in
question infringes, and I share a link to it, am I guilty of sharing
something around? What if the original owner uploaded it as an
unlisted video, and I share that link around? What if the uploader
(who is not the owner) legitimately stayed within "fair use", but I
piece together the entire original from a bunch of links, creating a
playlist with all of the content, and share that?

I'm sure there are legal answers to all of those questions, but it's
definitely hairy territory.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sorting NaNs

2018-06-08 Thread Gregory Ewing

Peter Pearson wrote:

What applications would have to worry about colliding floats?  I
don't know.  I'm coming from cryptology, where worrying about such
things becomes a reflex.


If collisions are something to be feared, then you're into
hash territory, where you're probably going to want *much*
more than even 52 bits.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: Problem finding my folder via terminal

2018-06-08 Thread Tamara Berger
Hi Cameron,

I have to answer you via email because I haven't gotten the hang of
the inline style yet. Here is the result of your suggestion:

Last login: Fri Jun  8 22:43:58 on ttys001
192:~ TamaraB$ cd Desktop/mymodules/
192:mymodules TamaraB$ ls -laR /Users/TamaraB/Desktop/mymodules
total 16
drwxr-xr-x   4 TamaraB  staff   136 Jun  7 01:32 .
drwx--+ 37 TamaraB  staff  1258 Jun  8 22:30 ..
-rw-r--r--@  1 TamaraB  staff  6148 Jun  7 10:54 .DS_Store
drwxr-xr-x   5 TamaraB  staff   170 Jun  7 01:32 mymodules

/Users/TamaraB/Desktop/mymodules/mymodules:
total 16
drwxr-xr-x  5 TamaraB  staff  170 Jun  7 01:32 .
drwxr-xr-x  4 TamaraB  staff  136 Jun  7 01:32 ..
-rw-r--r--@ 1 TamaraB  staff0 Jun  5 09:47 README.py
-rw-r--r--@ 1 TamaraB  staff  253 Jun  7 10:55 setup.py
-rw-r--r--@ 1 TamaraB  staff  166 Jun  5 10:01 vsearch.py
192:mymodules TamaraB$

(When I copied the coding into the email, I got a line of space
between each line of coding, and had to delete the extra lines one by
one? Any way to do this job nonmanually or to transfer the coding into
an email without the extra lines of space?)

Thanks for all your help.

Tamara




On Fri, Jun 8, 2018 at 6:03 PM Cameron Simpson  wrote:
>
> On 08Jun2018 10:23, Tamara Berger  wrote:
> >On Fri, Jun 8, 2018 at 5:35 AM Cameron Simpson  wrote:
> >> On 08Jun2018 01:52, Tamara Berger  wrote:
> >> >192:~ TamaraB$ cd Desktop/mymodules
> >> >192:mymodules TamaraB$ pwd
> >> >/Users/TamaraB/Desktop/mymodules
> >> >192:mymodules TamaraB$ ls
> >> >mymodules
> >>
> >> It looks like you have a "mymodules" folder _inside_ your 
> >> "Desktop/mymodules"
> >> folder. Form the /Users/TamaraB/Desktop/mymodules folder, type these 
> >> commands.
> >>
> >>   ls -la
> >>   ls -la mymodules
> >
> >Nope. No duplicate folder.
>
> Your Terminal transcript above says otherwise, because (a) you're standing in
> "/Users/TamaraB/Desktop/mymodules" and (b) the "ls" command shows:
>
>   mymodules
>
> Therefore, _inside_ the "/Users/TamaraB/Desktop/mymodules" folder there is
> something called "mymodules", unless the transcript above is not complete.
>
> Please pos the result of:
>
>   ls -laR /Users/TamaraB/Desktop/mymodules
>
> Cheers,
> Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Gregory Ewing

Gene Heskett wrote:
The courts weren't amused. I don't know as any of us ever cut those 
patent troll turkey's a check,


Patent troll turkeys: Don't cut them checks, cut their necks!

(Insert suitable stock photo of a turkey about to have its
head removed.)

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Gregory Ewing

MRAB wrote:

So those with the most money can buy the most protection?


That's the way it works with patents...

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Gregory Ewing

Chris Angelico wrote:

Open source would not exist without copyright,because it is
copyright law that gives license terms their meaning.


That statement doesn't make any sense. If there were no
copyright laws, there would be no need for licences to
distribute software.

You seem to be saying that nobody would ever release the
source of their software unless they could impose some
kind of restrictions on what people could do with it.

But I don't think that's true at all. Open sharing of
software was the *default* before people got the idea
of applying copyright laws to it. If there were no
copyright laws, people who wanted to share their source
would still do so, and people who wanted to keep it a
trade secret would still do so. The only difference is
there would be less lawyers making money out of it.


Even if your license terms amount
to "do what you like with this but be sure to credit me as the
author", that's only enforceable because of copyright law.


If attribution is all that really matters, it could
be addressed by quite a different kind of law. Or
tackle it socially rather than legally. Get it out
there first with your name all over it, so that anyone
who tries to "steal" it later will receive the
appropriate level of public shaming.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: Problem finding my folder via terminal

2018-06-08 Thread Cameron Simpson

On 08Jun2018 22:55, Tamara Berger  wrote:

I have to answer you via email because I haven't gotten the hang of
the inline style yet.


I'm using email :-) We use the inline style for that, too. Just walk down the 
quoted previous message and insert your responses below the relevant parts with 
blank lines separating the quoted material from your text. Anyway...



Here is the result of your suggestion:

Last login: Fri Jun  8 22:43:58 on ttys001
192:~ TamaraB$ cd Desktop/mymodules/
192:mymodules TamaraB$ ls -laR /Users/TamaraB/Desktop/mymodules
total 16
drwxr-xr-x   4 TamaraB  staff   136 Jun  7 01:32 .
drwx--+ 37 TamaraB  staff  1258 Jun  8 22:30 ..
-rw-r--r--@  1 TamaraB  staff  6148 Jun  7 10:54 .DS_Store
drwxr-xr-x   5 TamaraB  staff   170 Jun  7 01:32 mymodules


Ok, so here we see that there _is_ a "mymodules" folder inside your 
"/Users/TamaraB/Desktop/mymodules" folder.



/Users/TamaraB/Desktop/mymodules/mymodules:
total 16
drwxr-xr-x  5 TamaraB  staff  170 Jun  7 01:32 .
drwxr-xr-x  4 TamaraB  staff  136 Jun  7 01:32 ..
-rw-r--r--@ 1 TamaraB  staff0 Jun  5 09:47 README.py
-rw-r--r--@ 1 TamaraB  staff  253 Jun  7 10:55 setup.py
-rw-r--r--@ 1 TamaraB  staff  166 Jun  5 10:01 vsearch.py
192:mymodules TamaraB$


And inside that second "mymodules" folder is your vsearch module and its 
accompanying files. This kind of mistake is easy to make (the doubled 
directory).


You can do 2 things at this point.

1: Just:

  cd /Users/TamaraB/Desktop/mymodules/mymodules

and run the setup.py from in there.

Or:

2: Repair the mistake:

  cd /Users/TamaraB/Desktop/mymodules
  mv mymodules/* .
  rmdir mymodules

which will move all the files from the lower directory up to where they should 
be. Then run the setup.py.


BTW, the README is normally a text file named README.txt or maybe a markdown 
file named README.md.



(When I copied the coding into the email, I got a line of space
between each line of coding, and had to delete the extra lines one by
one? Any way to do this job nonmanually or to transfer the coding into
an email without the extra lines of space?)


That is odd. My guess would be that your cut/paste is sending the end of line 
as a CR (carriage return) and a NL (newline), and both of those are being 
"typed" at the paste end, resulting in double spaced text. Annoying.


Are you using mail.google.com to read your GMail? I just tried cut/paste some 
text from both iTerm and Terminal on my Mac into a scratch message there and 
didn't get doubled lines. Can you describe _exactly_ what you did to copy the 
text into your email? Presumably you're doing something different from what I'm 
doing: select text in the terminal, type Cmd-C to copy it, click in my new 
message window and type Cmd-V to paste the copied text.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: Problem finding my folder via terminal

2018-06-08 Thread Tamara Berger
Hi Cameron,

Re inline style: When I hit reply, this is the window I get. I don't
get my previous email with the carets appended to the beginning of the
line.

Before I look at the rest of your email, I'd like for you to explain
how there is a mymodule folder nested within another mymodule folder.
I don't see this second folder in Finder, and I definitely didn't
create it.

Thanks,

Tamara
On Sat, Jun 9, 2018 at 1:15 AM Cameron Simpson  wrote:
>
> On 08Jun2018 22:55, Tamara Berger  wrote:
> >I have to answer you via email because I haven't gotten the hang of
> >the inline style yet.
>
> I'm using email :-) We use the inline style for that, too. Just walk down the
> quoted previous message and insert your responses below the relevant parts 
> with
> blank lines separating the quoted material from your text. Anyway...
>
> >Here is the result of your suggestion:
> >
> >Last login: Fri Jun  8 22:43:58 on ttys001
> >192:~ TamaraB$ cd Desktop/mymodules/
> >192:mymodules TamaraB$ ls -laR /Users/TamaraB/Desktop/mymodules
> >total 16
> >drwxr-xr-x   4 TamaraB  staff   136 Jun  7 01:32 .
> >drwx--+ 37 TamaraB  staff  1258 Jun  8 22:30 ..
> >-rw-r--r--@  1 TamaraB  staff  6148 Jun  7 10:54 .DS_Store
> >drwxr-xr-x   5 TamaraB  staff   170 Jun  7 01:32 mymodules
>
> Ok, so here we see that there _is_ a "mymodules" folder inside your
> "/Users/TamaraB/Desktop/mymodules" folder.
>
> >/Users/TamaraB/Desktop/mymodules/mymodules:
> >total 16
> >drwxr-xr-x  5 TamaraB  staff  170 Jun  7 01:32 .
> >drwxr-xr-x  4 TamaraB  staff  136 Jun  7 01:32 ..
> >-rw-r--r--@ 1 TamaraB  staff0 Jun  5 09:47 README.py
> >-rw-r--r--@ 1 TamaraB  staff  253 Jun  7 10:55 setup.py
> >-rw-r--r--@ 1 TamaraB  staff  166 Jun  5 10:01 vsearch.py
> >192:mymodules TamaraB$
>
> And inside that second "mymodules" folder is your vsearch module and its
> accompanying files. This kind of mistake is easy to make (the doubled
> directory).
>
> You can do 2 things at this point.
>
> 1: Just:
>
>cd /Users/TamaraB/Desktop/mymodules/mymodules
>
> and run the setup.py from in there.
>
> Or:
>
> 2: Repair the mistake:
>
>cd /Users/TamaraB/Desktop/mymodules
>mv mymodules/* .
>rmdir mymodules
>
> which will move all the files from the lower directory up to where they should
> be. Then run the setup.py.
>
> BTW, the README is normally a text file named README.txt or maybe a markdown
> file named README.md.
>
> >(When I copied the coding into the email, I got a line of space
> >between each line of coding, and had to delete the extra lines one by
> >one? Any way to do this job nonmanually or to transfer the coding into
> >an email without the extra lines of space?)
>
> That is odd. My guess would be that your cut/paste is sending the end of line
> as a CR (carriage return) and a NL (newline), and both of those are being
> "typed" at the paste end, resulting in double spaced text. Annoying.
>
> Are you using mail.google.com to read your GMail? I just tried cut/paste some
> text from both iTerm and Terminal on my Mac into a scratch message there and
> didn't get doubled lines. Can you describe _exactly_ what you did to copy the
> text into your email? Presumably you're doing something different from what 
> I'm
> doing: select text in the terminal, type Cmd-C to copy it, click in my new
> message window and type Cmd-V to paste the copied text.
>
> Cheers,
> Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Gene Heskett
On Friday 08 June 2018 23:11:22 Gregory Ewing wrote:

> Gene Heskett wrote:
> > The courts weren't amused. I don't know as any of us ever cut those
> > patent troll turkey's a check,
>
> Patent troll turkeys: Don't cut them checks, cut their necks!
>
> (Insert suitable stock photo of a turkey about to have its
> head removed.)
>
> --
> Greg

That was my first impulse. But thats pretty sick bird, highly frowned on 
by the "authorities". People like that really should be removed from the 
gene pool, which would markedly enhance the human race after a while.

Stress, that feeling created by resisting the urge to strangle someone 
who desperately needs it.

But I've had the ultimate revenge, I've had the great good fortune to 
have outlived all my enemies save one, me. My clumsiness is getting 
worse. I bitch and belly-ache, to those that will listen, and someone 
will tell me they they hope to get along as well as I do when they are 
83.

-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem finding my folder via terminal

2018-06-08 Thread Gene Heskett
On Saturday 09 June 2018 01:36:17 Tamara Berger wrote:

> Hi Cameron,
>
> Re inline style: When I hit reply, this is the window I get. I don't
> get my previous email with the carets appended to the beginning of the
> line.
>
That might be a config choice, but since its gmail it may not be. I tried 
to use gmail as a pop server years ago, and bailed out in about a week, 
way too much was hard coded.

> Before I look at the rest of your email, I'd like for you to explain
> how there is a mymodule folder nested within another mymodule folder.
> I don't see this second folder in Finder, and I definitely didn't
> create it.

Finder, if thats what you are using, I am not familiar with it, is 
probably showing you that which it has cached, before that folder was 
created.  Back out one layer and go back in so it actually reads a fresh 
copy of that directory(folder).

> Thanks,
>
> Tamara
>
> On Sat, Jun 9, 2018 at 1:15 AM Cameron Simpson  wrote:
> > On 08Jun2018 22:55, Tamara Berger  wrote:
> > >I have to answer you via email because I haven't gotten the hang of
> > >the inline style yet.
> >
> > I'm using email :-) We use the inline style for that, too. Just walk
> > down the quoted previous message and insert your responses below the
> > relevant parts with blank lines separating the quoted material from
> > your text. Anyway...
> >
> > >Here is the result of your suggestion:
> > >
> > >Last login: Fri Jun  8 22:43:58 on ttys001
> > >192:~ TamaraB$ cd Desktop/mymodules/
> > >192:mymodules TamaraB$ ls -laR /Users/TamaraB/Desktop/mymodules
> > >total 16
> > >drwxr-xr-x   4 TamaraB  staff   136 Jun  7 01:32 .
> > >drwx--+ 37 TamaraB  staff  1258 Jun  8 22:30 ..
> > >-rw-r--r--@  1 TamaraB  staff  6148 Jun  7 10:54 .DS_Store
> > >drwxr-xr-x   5 TamaraB  staff   170 Jun  7 01:32 mymodules
> >
> > Ok, so here we see that there _is_ a "mymodules" folder inside your
> > "/Users/TamaraB/Desktop/mymodules" folder.
> >
> > >/Users/TamaraB/Desktop/mymodules/mymodules:
> > >total 16
> > >drwxr-xr-x  5 TamaraB  staff  170 Jun  7 01:32 .
> > >drwxr-xr-x  4 TamaraB  staff  136 Jun  7 01:32 ..
> > >-rw-r--r--@ 1 TamaraB  staff0 Jun  5 09:47 README.py
> > >-rw-r--r--@ 1 TamaraB  staff  253 Jun  7 10:55 setup.py
> > >-rw-r--r--@ 1 TamaraB  staff  166 Jun  5 10:01 vsearch.py
> > >192:mymodules TamaraB$
> >
> > And inside that second "mymodules" folder is your vsearch module and
> > its accompanying files. This kind of mistake is easy to make (the
> > doubled directory).
> >
> > You can do 2 things at this point.
> >
> > 1: Just:
> >
> >cd /Users/TamaraB/Desktop/mymodules/mymodules
> >
> > and run the setup.py from in there.
> >
> > Or:
> >
> > 2: Repair the mistake:
> >
> >cd /Users/TamaraB/Desktop/mymodules
> >mv mymodules/* .
> >rmdir mymodules
> >
> > which will move all the files from the lower directory up to where
> > they should be. Then run the setup.py.
> >
> > BTW, the README is normally a text file named README.txt or maybe a
> > markdown file named README.md.
> >
> > >(When I copied the coding into the email, I got a line of space
> > >between each line of coding, and had to delete the extra lines one
> > > by one? Any way to do this job nonmanually or to transfer the
> > > coding into an email without the extra lines of space?)
> >
> > That is odd. My guess would be that your cut/paste is sending the
> > end of line as a CR (carriage return) and a NL (newline), and both
> > of those are being "typed" at the paste end, resulting in double
> > spaced text. Annoying.
> >
> > Are you using mail.google.com to read your GMail? I just tried
> > cut/paste some text from both iTerm and Terminal on my Mac into a
> > scratch message there and didn't get doubled lines. Can you describe
> > _exactly_ what you did to copy the text into your email? Presumably
> > you're doing something different from what I'm doing: select text in
> > the terminal, type Cmd-C to copy it, click in my new message window
> > and type Cmd-V to paste the copied text.
> >
> > Cheers,
> > Cameron Simpson 



-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list