[issue32859] os.dup2() tests dup3() availability on each call

2018-02-19 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset bab4fe320ad2e24c1084fd57d2059ef342688aa9 by Benjamin Peterson 
(Miss Islington (bot)) in branch '3.7':
closes bpo-32859: Don't retry dup3() if it is not available at runtime (GH-5708)
https://github.com/python/cpython/commit/bab4fe320ad2e24c1084fd57d2059ef342688aa9


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32859] os.dup2() tests dup3() availability on each call

2018-02-19 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5548

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32859] os.dup2() tests dup3() availability on each call

2018-02-19 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5547

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32859] os.dup2() tests dup3() availability on each call

2018-02-19 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset b3caf388a0418f6c031e4dbdcc0c1ce7e5cc36bd by Benjamin Peterson 
(Alexey Izbyshev) in branch 'master':
closes bpo-32859: Don't retry dup3() if it is not available at runtime (GH-5708)
https://github.com/python/cpython/commit/b3caf388a0418f6c031e4dbdcc0c1ce7e5cc36bd


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread breamoreboy
On Monday, February 19, 2018 at 1:07:02 PM UTC, Anders Wegge Keller wrote:
> På Mon, 19 Feb 2018 04:39:31 + (UTC)
> Steven D'Aprano skrev:
> > On Mon, 19 Feb 2018 04:26:32 +0100, Anders Wegge Keller wrote:
> > 
> > > På Mon, 19 Feb 2018 08:47:14 +1100
> > > Tim Delaney skrev:  
> > >> On 18 February 2018 at 22:55, Anders Wegge Keller 
> > >> wrote:  
> > > 
> > >   
> >  [...]  
> > >   
> > >> You couldn't have got the above much more wrong.  
> > >
> > >> As others have said, typing is about how the underlying memory is
> > >> treated.  
> > > 
> > >  And that is exactly my point. Python does not have a typed list. It
> > >  have a list that takes whatever is thrown into it.
> > > 
> > >  I'll skip the rest, as you totally missed the point.  
> > 
> > I think its actually you have totally missed the point. What you want is 
> > a homogeneous list, a list which only accepts items of the same type. The 
> > built-in list is not that data structure, but Python already has 
> > something similar: see the array module.
> 
>  Given that I'm the one making a point about the unwarranted smugness, I
> know that I'm not missing anything. Array is not even close to providing a
> strongly typed container. For all of the yakking about other languages
> weak, blah, BCPL, blah, I still wonder where that need to feel superior to
> anything else comes from.  
> 
>  Python isn't particular strong typed. In fact, apart from asking an object
> what type it is, types are not that important. It's the interface that
> matters. I wonder why this is a sore point for Python developers?
> 
> 
> -- 
> //Wegge

Congratulations, you're the first new person I've had on my Dream Team for some 
months, fresh blood is always so welcome.

--
Kindest regards.

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


Re: Gmane seems to be gone

2018-02-19 Thread breamoreboy
On Sunday, February 18, 2018 at 8:23:03 PM UTC, Mark Lawrence wrote:
> On 18/02/18 18:03, Grant Edwards wrote:
> > On 2018-02-18, Dennis Lee Bieber wrote:
> >> On Sun, 18 Feb 2018 17:26:54 + (UTC), Grant Edwards
> >>  declaimed the following:
> >>
> >>>
> >>> It was Yomura who picked up the archive and continued the gateway
> >>> service a couple years ago, and they just renewed the domain for
> >>> another year, so perhaps it's just a temporary DNS problem?
> >>
> >>Looks like the DNS update is propagating -- I can now reach gmane; but
> >> it hasn't shown any new traffic on any of the groups/lists I follow.
> > 
> > Yay!
> > 
> > Gmane.org just started resolving again, and I'm posting this followup
> > from slrn via news.gmane.org.  I really should donate some money to
> > gmane's operators...
> > 
> 
> Great stuff :)  Of course as gmane wasn't working I posted earlier today 
> on gg but I believe you've opted out of that so wouldn't have seen it :( 
>   What the hell, normal service is resumed :)
> 
> -- 
> My fellow Pythonistas, ask not what our language can do for you, ask
> what you can do for our language.
> 
> Mark Lawrence

Blast, seems like it's down again.  Can somebody confirm that I'm correct 
please, cheers :(

--
Kindest regards.

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


Re: could use some help with this problem! I've been working on it for days but cant seem to get it right !

2018-02-19 Thread breamoreboy
On Tuesday, February 20, 2018 at 5:08:49 AM UTC, Marc Cohen wrote:
> USING PYTHON 2:
> 
> Write a program to play this game. This may seem tricky, so break it down 
> into parts. Like many programs, we have to use nested loops (one loop inside 
> another). In the outermost loop, we want to keep playing until we are out of 
> stones.
> 
> Inside that, we want to keep alternating players. You have the option of 
> either writing two blocks of code, or keeping a variable that tracks the 
> current player. The second way is slightly trickier since we haven't learned 
> lists yet, but it's definitely do-able!
> 
> Finally, we might want to have an innermost loop that checks if the user's 
> input is valid. Is it a number? Is it a valid number (e.g. between 1 and 5)? 
> Are there enough stones in the pile to take off this many? If any of these 
> answers are no, we should tell the user and re-ask them the question
> 
> So, the basic outline of the program should be something like this:
> 
> totalStones = 100
> 
> maxStones = 5
> 
> pile = TOTAL # all stones are in the pile to start
> 
> while [pile is not empty]:
> 
> while [player 1's answer is not valid]:
> 
> [ask player 1]
> 
> [execute player1’s move]
> 
> Do the same for player 2…. (this can be achieved by a for loop)
> 
> Note how the important numbers 100 and 5 are stored in a single variable at 
> the top. This is good practice -- it allows you to easily change the 
> constants of a program. For example, for testing, you may want to start with 
> only 15 or 20 stones.
> 
> Be careful with the validity checks. Specifically, we want to keep asking 
> player 1 for their choice as long as their answer is not valid, BUT we want 
> to make sure we ask them at least ONCE. So, for example, we will want to keep 
> a variable which tracks whether their answer is valid, and set it to False 
> initially.
> 
> Hint: the final number of stones can’t be negative. The game automatically 
> stops when the number of stones reach zero.

Sorry old bean but we don't write code for you.  So you show us the code that 
you've been working on for days and tell us what's wrong with it, and we'll 
point you in the right direction.

--
Kindest regards.

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


could use some help with this problem! I've been working on it for days but cant seem to get it right !

2018-02-19 Thread Marc Cohen
USING PYTHON 2:

Write a program to play this game. This may seem tricky, so break it down into 
parts. Like many programs, we have to use nested loops (one loop inside 
another). In the outermost loop, we want to keep playing until we are out of 
stones.

Inside that, we want to keep alternating players. You have the option of either 
writing two blocks of code, or keeping a variable that tracks the current 
player. The second way is slightly trickier since we haven't learned lists yet, 
but it's definitely do-able!

Finally, we might want to have an innermost loop that checks if the user's 
input is valid. Is it a number? Is it a valid number (e.g. between 1 and 5)? 
Are there enough stones in the pile to take off this many? If any of these 
answers are no, we should tell the user and re-ask them the question

So, the basic outline of the program should be something like this:

totalStones = 100

maxStones = 5

pile = TOTAL # all stones are in the pile to start

while [pile is not empty]:

while [player 1's answer is not valid]:

[ask player 1]

[execute player1’s move]

Do the same for player 2…. (this can be achieved by a for loop)

Note how the important numbers 100 and 5 are stored in a single variable at the 
top. This is good practice -- it allows you to easily change the constants of a 
program. For example, for testing, you may want to start with only 15 or 20 
stones.

Be careful with the validity checks. Specifically, we want to keep asking 
player 1 for their choice as long as their answer is not valid, BUT we want to 
make sure we ask them at least ONCE. So, for example, we will want to keep a 
variable which tracks whether their answer is valid, and set it to False 
initially.

Hint: the final number of stones can’t be negative. The game automatically 
stops when the number of stones reach zero.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32881] pycapsule:PyObject * is NULL pointer

2018-02-19 Thread zhaoya

New submission from zhaoya :

i have question:call,c-->python-->c. 
1.the c pointer void* abc="123" by pycapsule in the c code.
..
void* lpContext = "abc";
PyObject * lpPyContext = PyCapsule_New(lpContext, "Context",NULL);
..
PyTuple_SetItem(pArgs, 1, lpPyContext);
PyObject* pyResult = PyObject_CallObject(pFunc, pArgs);

2.c call python:

in the python code:
import ctypes
pycapsule = ctypes.windll.LoadLibrary("C:\Users\zhaoya16975\Documents\Visual 
Studio 2017\Projects\cpython\Release\pycapsule.dll")
def test( lpContext,lpRequest,lpAnswer):
print lpContext
pycapsule.hello()
pycapsule.GetContext(lpContext)
.
the lpContest is ""
but,i can't lpContext in the pycapsule.GetContest:
the capsule is null poniter,the GetContext no execute!!

void* FUNCTION_CALL_MODE GetContext(PyObject  *capsule) {
printf(" GetContext..\n");
//if (!PyCapsule_IsValid((PyObject *)capsule, "Context")) {
//  printf(" the Capsule Context is no Valid\n");
//  return NULL;
//}
//return PyCapsule_GetPointer((PyObject *)capsule, "Context");
return NULL;

}


i hope c call python  pass void* ,and python call c pass void* ,but the capsule 
call no success.

--
components: Windows
messages: 312399
nosy: paul.moore, steve.dower, tim.golden, zach.ware, zhaoya
priority: normal
severity: normal
status: open
title: pycapsule:PyObject * is NULL pointer
type: crash
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-19 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

set_str sets self.str and self.study_level.  After the first call, attempts to 
access unset instance parse attributes from other modules will raise 
AttributeError.  Removing the unneeded class setting will just add 2 more names 
to the list of things that should not be called directly.  The get_xyz 
functions (get_continuation_type is another) avoid AttributeError (unless 
self.str is not set) and ensure validity.

If set_str is called more than once, instance parse attributes will initially 
be set but invalid.  So it seems they should be either deleted or set to None.  
In the latter case, they should also be set to None initially.  I will look 
more at how the module is used.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32872] backport of #32305 causes regressions in various packages

2018-02-19 Thread Nick Coghlan

Nick Coghlan  added the comment:

+1 from me for making the change 3.7.0+ only - 3.6 isn't doing the right thing, 
but given folks are relying on it doing the wrong thing, then let's leave it 
alone given where it is in its lifecycle.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32820] Add bits method to ipaddress

2018-02-19 Thread Nick Coghlan

Nick Coghlan  added the comment:

The python-ideas discussion didn't turn up any major concerns we hadn't already 
considered, so you're in "wait for PR review" mode now. If you wanted to do a 
self-review in the meantime, then 
https://devguide.python.org/committing/#accepting-pull-requests covers the 
kinds of additional things a reviewer will be looking for.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread Rick Johnson
On Saturday, February 17, 2018 at 12:58:49 AM UTC-6, Paul Rubin wrote:
[...]
> Beyond that, the Python community (with some exceptions) seems to have a
> widespread hatred of threads.  It instead prefers to handle concurrent
> i/o with in-thread async schemes that the rest of the world left behind
> in the 1960s.  

Hmm... and many wonder if the source of that hatred is a direct result of
CPython's unholy alliance with the GIL?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-19 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Let's consider the todo questions at the end of the class Parser code.
---
# XXX - is this used?
lastopenbracketpos = None

def get_last_open_bracket_pos(self):
"Return index of last open bracket or None."
self._study2()
return self.lastopenbracketpos

# XXX - is this used?
stmt_bracketing = None

def get_last_stmt_bracketing(self):
"""Return a tuple of the structure of the bracketing of the last
interesting statement.

Tuple is in the format defined in _study2().
"""
self._study2()
return self.stmt_bracketing
---

get_last_open_bracket_pos is not called anywhere. TODO remove it.
get_last_stmt_bracketing is called once in hyperparser and could be replaced 
there by 'parser._study2(); parser.stmt_bracketing'. TODO?

Integer lastopenbracketpos is only conditionally set as an instance attribute, 
which masks the class attribute, in _study2 with
if stack:  # of opener indices
self.lastopenbracketpos = stack[-1]

However, self.lastopenbracketpos in only accessed (as 'j') in  
compute_bracket_indent, which is only called when a statement is continued to 
the next line because of an open bracket.  Indeed, the call is guarded by 
assert self.continuation == C_BRACKET  # TODO: move up
So the class binding is never used because it is always masked bebore being 
accessed.  Its value None would raise if it were. (That may have been 
intentional.)  TODO remove it.

Stopping here would break the current tests.  We could make _study2 return the 
index and change test according. Or we can make _study2 always set the 
attribute with (TODO this)
self.lastopenbracketpos = stack[-1] if stack else None
and remove the workaround test lines:
p.lastopenbracketpos = None

Since _study2 unconditionally sets stmt_bracketing as an instance attribute with
self.stmt_bracketing = tuple(bracketing)
and self.stmt_bracketing is only accessed, in the get function above (or 
possibly directly in the future), after such a call, its class setting is also 
useless.  TODO remove it.  No test change needed.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread Rick Johnson
On Friday, February 16, 2018 at 10:25:32 PM UTC-6, Chris Angelico wrote:
[...]
> This is often touted as a necessity for industrial-grade
> software. It isn't. There are many things that a type
> system, no matter how sophisticated, cannot catch; for some
> reason, though, we don't hear people saying "C is useless
> for industrial-grade software because it doesn't have
> function contracts".

And likewise, there are many problems that a seatbelt cannot
protect you against -- like for instance: a car-jacker
shooting you in the head at point-blank range. But we don't
throw the baby out with the bath water, do we?

> Anyway, if you want some system of type checking, you can
> use static analysis (eg tools like MyPy) to go over your
> code the same way a compiler might.

Are you suggesting this project for std-lib inclusion?

> "The first glaring issue is that I have no guarantee that
> is_valid() returns a bool type." -- huh? It's being used in
> a boolean context, and it has a name that starts "is_". How
> much guarantee are you looking for? *ANY* object can be
> used in an 'if', so it doesn't even matter. This is a
> stupidly contrived criticism.
> 
> > Python markets itself as a dynamically-typed programming
> > language, similar to Perl, Ruby, or JavaScript. The word
> > “dynamically typed” has a positive connotation, more so
> > than “weakly typed.” Conversely, the word “strongly typed”
> > sounds more positive than saying “statically typed.”
> 
> Those are all different terms, and all of them are
> misunderstood. They're not synonyms.

The author was underscoring the unfortunate psychological
semantics at play when words like "strong" are juxtaposed
with words like "weak". Sadly, old boy, i believe you've
missed the point!

> > Python ships with a threading module; but due to how the
> > Python interpreter is implemented, it can only ever run
> > one thread at a time. This is due to the infamous Global
> > Interpreter Lock (GIL). In an age when the only computers
> > around had a single core, this was nothing to fuss over.
> 
> Totally not true. The GIL does not stop other threads from
> running. Also, Python has existed for multiple CPU systems
> pretty much since its inception, I believe. (Summoning the
> D'Aprano for history lesson?)

Unfortunately "D'App-ran?...Oh!" is still debugging his hello
world program. He'll be along later. Or never... Whichever
comes /last/.

[...]


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


Re: How to link to python 3.6.4 library on linux ?

2018-02-19 Thread Jason Qian via Python-list
Thanks  Chris,

I think I figured it out that when build python on Linux, we need to
enable-shared.

Thanks again,

On Mon, Feb 19, 2018 at 5:04 PM, Chris Angelico  wrote:

> On Tue, Feb 20, 2018 at 8:07 AM, Jason Qian via Python-list
>  wrote:
> >  Hi,
> >
> >   I am calling python from a  c application.
> >   It compiles and works fine on the windows. How do I compile and
> link
> > it on the linux for Python 3.6.4  ?
> >
> >   Under python dir, it only have a static library,
> >
> >/opt/Python-3.6.4*/lib*/*libpython3.6m.a*
> >
> > * If I link to it, I got:*
> >
> > */opt/Python-3.6.4/lib/libpython3.6m.a(abstract.o): relocation
> R_X86_64_32S
> > against `_Py_NotImplementedStruct' can not be used when making a shared
> > object; recompile with -fPIC*
> > */opt/Python-3.6.4/lib/libpython3.6m.a: could not read symbols: Bad
> value*
> >
>
> By "calling Python from C", do you mean what the docs call "embedding"?
>
> https://docs.python.org/3/extending/embedding.html
>
> I would recommend following the tutorial there, if you haven't
> already. If you have, and the tutorial code doesn't work for you, post
> your code and what you did, and we'll try to help with that.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31848] "aifc" module does not always initialize "Aifc_read._ssnd_chunk"

2018-02-19 Thread Zackery Spytz

Change by Zackery Spytz :


--
components:  -Tests
nosy: +ZackerySpytz
type: crash -> behavior
versions: +Python 2.7, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32500] PySequence_Length() raises TypeError on dict type

2018-02-19 Thread Zackery Spytz

Change by Zackery Spytz :


--
nosy: +ZackerySpytz
versions: +Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32500] PySequence_Length() raises TypeError on dict type

2018-02-19 Thread Zackery Spytz

Change by Zackery Spytz :


--
keywords: +patch
pull_requests: +5546
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-19 Thread Terry J. Reedy

New submission from Terry J. Reedy :

Pyparse was mostly written in the early 2000s, with the only one code change 
since 2007 in 2014. #32874 will add tests for pyparse 'as is' (though with some 
docstring and comment changes).  This issue will change pyparse code, and 
change or add test as needed.

Here are two items to fix.  More will be added.  Some fixes might be separate 
PRs or spun off into separate issues.

def dump: dump this; print does the same, without hardcoding sys.__stdout__, 
which might be None.

_synchre: Only used in find_good_parse_start. Missing 'if' (mentioned in 
function docstring as 'popular' and 'for' and new things like 'with'. 'async' 
and 'await' are not generally popular, but is not any statement beginning a 
good parse start?

--
assignee: terry.reedy
components: IDLE
messages: 312394
nosy: csabella, terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: Fix and update and cleanup pyparse
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread Steve Dower

Steve Dower  added the comment:


New changeset 8e149ff481acbb3889c825b8bf7b10aa191f09a7 by Steve Dower (Miss 
Islington (bot)) in branch '3.6':
bpo-32409: Ensures activate.bat can handle Unicode contents (GH-5766)
https://github.com/python/cpython/commit/8e149ff481acbb3889c825b8bf7b10aa191f09a7


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32879] Race condition in multiprocessing Queue

2018-02-19 Thread Tim Peters

Tim Peters  added the comment:

The docs could be clearer about this:  the argument to .put() is _not_ pickled 
at the time .put() is called.  The object is remembered (by reference, not by 
value), and a feeder thread pickles the value and puts the pickle on the queue 
when the feeder thread gets around to that.  So if the object is mutated in any 
way in between, it's not defined whether the pre- or post-mutation state is put 
on the queue (or, in some cases, even some partially mutated value).

To make it wholly deterministic you could, e.g., change the .put() to this:

queue.put(data[:])

Or you could use a Manager().Queue() instead, which doesn't use a feeder thread.

--
nosy: +tim.peters

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32879] Race condition in multiprocessing Queue

2018-02-19 Thread Simon Bouchard

New submission from Simon Bouchard :

The clear list function call in made after the put(data) on the queue. But the 
data is sometime clear in the queue (randomly). Since both function are call 
within the same process, a race condition is not expected.

--
files: code.py
messages: 312391
nosy: TwistedSim
priority: normal
severity: normal
status: open
title: Race condition in multiprocessing Queue
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47453/code.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread Steve Dower

Change by Steve Dower :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread Steve Dower

Steve Dower  added the comment:


New changeset a3d6c1b23b8a49b5003fdbd115d3598fe3d4c4bf by Steve Dower (Miss 
Islington (bot)) in branch '3.7':
bpo-32409: Ensures activate.bat can handle Unicode contents (GH-5765)
https://github.com/python/cpython/commit/a3d6c1b23b8a49b5003fdbd115d3598fe3d4c4bf


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread Richard Damon

On 2/19/18 10:35 AM, Chris Angelico wrote:

On Tue, Feb 20, 2018 at 12:34 AM, Steven D'Aprano
 wrote:

On Mon, 19 Feb 2018 20:14:32 +1100, Chris Angelico wrote:


As an integer, 3.141590 is 107853 $

Looks to me like C is perfectly happy to interpret a float as an int.

Yes, but that's not an *automatic* coercion. To count as weakly typed,
the compiler has to do it automatically, without an explicit cast or
conversion.

Fair enough. If you ignore warnings, then C does have that kind of weak typing:

$ cat demo.c
#include 

int main() {
 float f = 3.14159;
 int *i = 
 printf("As an integer, %f is %d\n", f, *i);
 return 0;
}

$ gcc demo.c
demo.c: In function ‘main’:
demo.c:5:14: warning: initialization from incompatible pointer type
[-Wincompatible-pointer-types]
  int *i = 
   ^
$

GCC was quite happy to compile that code, even though the type of ""
is "pointer to float", and it's being assigned to a variable of type
"pointer to int". But C is a language saddled with so much history and
backward compatibility constraints that there are some things you just
CAN'T make into errors; so in terms of "how safe is C?", I'd have to
say that warnings (especially those that are enabled by default - I
didn't need to say "-Wall" for this test), count as "disallowing",
especially if all the major compilers emit warnings on the same code.
But I do see the argument that "it compiles, so the language clearly
permits it".

ChrisA


One thing to note, that is more an issue with GCC than with C. By the 
standard, that is a constraint violation, that requires a diagnostic, 
and the C standard says it provides no definition of what should happen 
here, which is about as strong as it gets to defining something as an 
'Error', the only thing with a stronger requirement is the #error 
statement which must not running the program.


GCC has decided that this diagnostic will be considered just a 'Warning' 
and provides its own meaning to the statement. You really want to run 
with pedantic-errors enabled to get GCC to reject code with constraint 
violations.


--
Richard Damon

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


Re: Python 2 to 3 Conversion

2018-02-19 Thread Chris Angelico
On Tue, Feb 20, 2018 at 12:05 PM, Wildman via Python-list
 wrote:
> On Tue, 20 Feb 2018 10:55:28 +1100, Chris Angelico wrote:
>
>> The given homepage URL is
>> http://alastairs-place.net/projects/netifaces/ - is that the right
>> one?
>>
>> ChrisA
>
> Yes, that is the right one.  Now I'm feeling a little stupid.
> I should have remembered that many python library package
> names start with python- or python3-. 
>
> Problem solved.  A thousand thank-you's.
>

No problem, this is why we don't work alone :) If you can work with
that on all the platforms you need, awesome! The dirtiness of calling
a subprocess or an opaque IOCTL can be wrapped up nicely inside a
library. Always an improvement IMO.

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


[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5545

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5543, 5544

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5543

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread Steve Dower

Steve Dower  added the comment:


New changeset 6240917b773b52f8883387b9e3a5f327a4372068 by Steve Dower in branch 
'master':
bpo-32409: Ensures activate.bat can handle Unicode contents (GH-5757)
https://github.com/python/cpython/commit/6240917b773b52f8883387b9e3a5f327a4372068


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Python 2 to 3 Conversion

2018-02-19 Thread Wildman via Python-list
On Tue, 20 Feb 2018 10:55:28 +1100, Chris Angelico wrote:

> The given homepage URL is
> http://alastairs-place.net/projects/netifaces/ - is that the right
> one?
> 
> ChrisA

Yes, that is the right one.  Now I'm feeling a little stupid.
I should have remembered that many python library package
names start with python- or python3-. 

Problem solved.  A thousand thank-you's.

-- 
 GNU/Linux user #557453
The cow died so I don't need your bull!
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams

2018-02-19 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

OK, never mind with the test. I've finally got to a FreeBSD box and reproduced 
the problem. It has to do with 'revoke' feature of *BSD. When revoke is called 
on a terminal device (as part of logout process, for example), all descriptors 
associated with it are invalidated. They can be dup'ed, but any I/O (including 
fstat) will fail with EBADF. The attached 'repro.c' demonstrates the same 
behavior as Python in your ktrace log.

# sleep 5; ./repro > &
# exit
(login again)
# cat err.txt
isatty: Inappropriate ioctl for device
dup ok: 3
fstat: Bad file descriptor

So it seems that in your case the parent of your Python processes passed a 
descriptor referring to the terminal as fd 0, and then terminal got revoked at 
some point. People have stumbled on that, for example, 
https://bitbucket.org/tildeslash/monit/issues/649/init_env-fails-if-open-2-returns-an

As for Python, it seems OK to fix it as in #30225 since the fd is unusable for 
I/O anyway. I think that we can even drop dup-based validation from 
is_valid_fd() since there is a corner case for Linux too: if a descriptor 
opened with O_PATH inherited as a standard one, dup() will succeed but fstat() 
will fail in kernels before 3.6. And we do fstat() almost immediately after 
is_valid_fd() to get blksize, so the dup-based optimization doesn't seem worth 
the trouble.

Victor, do you have an opinion on that?

--
components: +FreeBSD, IO
nosy: +koobs
versions: +Python 3.7
Added file: https://bugs.python.org/file47452/repro.c

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams

2018-02-19 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

> I think that we can even drop dup-based validation from is_valid_fd()

For POSIX, that is. There is no fstat on Windows, and dup is probably OK there 
(or, even better, dup2(fd, fd) -- no need to close).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32764] Popen doesn't work on Windows when args is a list

2018-02-19 Thread Steve Dower

Steve Dower  added the comment:

Sounds good to me

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Windows: subprocess debug assertion on failure to execute the 
process

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32764] Popen doesn't work on Windows when args is a list

2018-02-19 Thread Zachary Ware

Zachary Ware  added the comment:

I fixed this independently earlier today, tied to bpo-30121 (the issue that 
introduced the test bug) because I didn't find this one.  See PR5758, PR5759 
(3.7), and PR5760 (3.6).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32556] support bytes paths in nt _getdiskusage, _getvolumepathname, and _getfinalpathname

2018-02-19 Thread Steve Dower

Change by Steve Dower :


--
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32878] Document value of st_ino on Windows

2018-02-19 Thread Steve Dower

Change by Steve Dower :


--
keywords: +patch
pull_requests: +5542
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Python 2 to 3 Conversion

2018-02-19 Thread Chris Angelico
On Tue, Feb 20, 2018 at 10:09 AM, Wildman via Python-list
 wrote:
> Yes, you are correct.  Third-party pip packages are always
> a no-no.
>
> Speaking of which, there is a library called Netifaces that
> will easily do exactly what I want with a few lines of code.
> But, it is not to be found in any Linux distro's repository
> that I can find.  Oh well...
>

$ apt-cache search netifaces
python-netifaces - portable network interface information - Python 2.x
python-netifaces-dbg - portable network interface information - Python
2.x debug extension
python3-netifaces - portable network interface information - Python 3.x
python3-netifaces-dbg - portable network interface information -
Python 3.x debug extension
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.3 (stretch)
Release: 9.3
Codename: stretch

The given homepage URL is
http://alastairs-place.net/projects/netifaces/ - is that the right
one?

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


[issue32857] tkinter after_cancel does not behave correctly when called with id=None

2018-02-19 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I had also noticed that the `after` commands didn't have tests.  Did you want 
me to add tests in a separate issue before this one is merged or did you want 
me to add tests under this PR?

Thanks!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32870] Documentation typo (2.x only) for deque.remove

2018-02-19 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32870] Documentation typo (2.x only) for deque.remove

2018-02-19 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
keywords: +patch
pull_requests: +5541
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32764] Popen doesn't work on Windows when args is a list

2018-02-19 Thread Steve Dower

Steve Dower  added the comment:

Turns out this is a trivial typo in the test, so I stole the issue from Greg 
and pushed a PR.

--
assignee: gregory.p.smith -> steve.dower

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32764] Popen doesn't work on Windows when args is a list

2018-02-19 Thread Steve Dower

Change by Steve Dower :


--
keywords: +patch
pull_requests: +5540
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Python 2 to 3 Conversion

2018-02-19 Thread Wildman via Python-list
On Tue, 20 Feb 2018 05:31:27 +1100, Chris Angelico wrote:

> On Tue, Feb 20, 2018 at 3:49 AM, Wildman via Python-list
>  wrote:
>> On Mon, 19 Feb 2018 12:32:49 +, Rhodri James wrote:
>>
>>> On 18/02/18 16:18, Wildman via Python-list wrote:
> But that's only going to show one (uplink) address. If I needed to get
> ALL addresses for ALL network adapters, I'd either look for a library,
> and if one wasn't easily found, I'd shell out to the "ip" command and
> parse its output.:)
>
 I considered using the "ip" command but I prefer not to
 depend on external programs if I can get around it.  I
 know that might be considered silly but that's just me.
>>>
>>> It's not silly at all, but for Linux networking it might be the best
>>> idea.  I believe in theory you are supposed to use libnl (in some
>>> suitable wrapping), but my experience with that is that it is badly
>>> documented and horrendously unreliable.
>>
>> It looks like libnl would do what I want but there is
>> a problem.  When finished, my program will be released
>> in the form of a Debian (*.deb) package and used by,
>> for the most part, 'average' Linux users.  These are
>> people that know their way around Linux but know
>> nothing or very little about Python.  Installing a
>> package using pip by them is pretty much out of the
>> question.  The system's package manager must be able
>> to handle the program's dependencies so third-party
>> packages are out of the question.
>>
>> But thanks for the suggestion.
> 
> If you're distributing it as a .deb, you don't want to use pip to grab
> additional libraries. Ideally, you'd want the library to *also* be
> available through the package manager, which would mean you can simply
> record it as a dependency. If it's not... it's not gonna be easy.
> 
> ChrisA

Yes, you are correct.  Third-party pip packages are always
a no-no.

Speaking of which, there is a library called Netifaces that
will easily do exactly what I want with a few lines of code.
But, it is not to be found in any Linux distro's repository
that I can find.  Oh well...

-- 
 GNU/Linux user #557453
"There are only 10 types of people in the world...
those who understand Binary... and those who don't."
  -Spike
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32876] HTMLParser raises exception on some inputs

2018-02-19 Thread Ezio Melotti

Ezio Melotti  added the comment:

The HTMLParser has been updated to handle HTML5 and should never fail parsing a 
document, so if it raises an error it's probably a bug.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32840] Must install python 3.6.3 when 3.6.4 already installed

2018-02-19 Thread Steve Dower

Steve Dower  added the comment:

We confirmed offline that it's not a bug.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Python 2 to 3 Conversion

2018-02-19 Thread Wildman via Python-list
On Tue, 20 Feb 2018 05:39:15 +1100, Chris Angelico wrote:

> On Tue, Feb 20, 2018 at 3:53 AM, Wildman via Python-list
>  wrote:
>> On Tue, 20 Feb 2018 02:26:19 +1100, Chris Angelico wrote:
>>
>>> * Opaque IOCTLs
>>
>> Would you mind to elaborate a little about your
>> concerns?
> 
> Look at your original code: it's impossible to figure out what it's
> doing or whether it's doing it correctly. "Opaque" in this context
> means that you can't grok the code without external help. This is a
> code smell, and a strong indication that you're "fiddling" in stuff
> way lower level than you normally want to be working with. It's
> usable, but it's dirty and leaves everything up to you (do you know
> for sure, for instance, if this is backward compatible?
> Cross-platform?), and that makes it comparable to depending on an
> external program.
> 
> ChrisA

I understand and I agree for the most part.  It does concern
me that I don't understand the code.  Anytime in Linux you
start poking around things at kernel level, you need your
eyes to be wide open.  However, to me it looks like the
code is only quarying ioctl and not trying to change any-
thing.  If this is true, there is no problem.

For the issue of backward compatibility, there are good
people on a few of the Linux newsgroups that are willing
to test code snippets for me.  I can get a wide range of
distros, desktops and kernel versions.  And of course
different python3 versions.  I know it is impossible
to write code that will be guaranteed to run on all
conditions.  But the test results I get will or should
let me know right off if there are glaring problems.

As far as cross-platform goes, that is not an issue.
Every thing I do is targeted for the Linux platform.

I will keep "ip" in mind as a backup plan.  As a novice
Python programmer, I am looking at the amount of code
it will take to parse ip's output compared to the few
lines of code it takes to call ioctl.

I really appreciate your insight.  Thank you.

-- 
 GNU/Linux user #557453
"There are only 10 types of people in the world...
those who understand Binary... and those who don't."
  -Spike
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32876] HTMLParser raises exception on some inputs

2018-02-19 Thread Hanno Boeck

Hanno Boeck  added the comment:

Actually BeautifulSoup also uses the python html parser in the backend, so it 
has the same problem. (It can use alternative backends, but the python parser 
is the default and they also describe it as "lenient", which I would interpret 
as "it can handle that".)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32876] HTMLParser raises exception on some inputs

2018-02-19 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

The stdlib HTML parser requires correct HTML.

To parse broken HTML, as you find in the real world, you need a third-party 
library like BeautifulSoup. BeautifulSoup is much more complex (about 7-8 times 
as many LOC) but can handle nearly anything a browser can.

I doubt the stdlib will ever compete with BeautifulSoup.

--
nosy: +steven.daprano

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29241] sys._enablelegacywindowsfsencoding() don't apply to os.fsencode and os.fsdecode

2018-02-19 Thread Steve Dower

Steve Dower  added the comment:

I took another look at this and it's still unclear whether it's worth the 
performance loss.

Perhaps moving fsencode and fsdecode (almost) entirely into C would be a better 
approach? That shouldn't send us backwards at all, and all they really do is a 
typecheck and then calling a function that's already written in C.

--
assignee: steve.dower -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32556] support bytes paths in nt _getdiskusage, _getvolumepathname, and _getfinalpathname

2018-02-19 Thread Steve Dower

Change by Steve Dower :


--
keywords: +patch
pull_requests: +5539
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32556] support bytes paths in nt _getdiskusage, _getvolumepathname, and _getfinalpathname

2018-02-19 Thread Steve Dower

Change by Steve Dower :


--
assignee:  -> steve.dower
stage: patch review -> needs patch
versions: +Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32873] Pickling of typing types

2018-02-19 Thread Guido van Rossum

Guido van Rossum  added the comment:

I'm honestly not too concerned about what happens with List[int] (though
doing a sensible thing here is not wrong :-), but I feel strongly that a
pickle containing a reference to typing.List should be compatible between
Python 3.6 and 3.7.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: [ANN] Biovarase ver 2

2018-02-19 Thread Beppe
Il giorno lunedì 19 febbraio 2018 23:02:43 UTC+1, Chris Angelico ha scritto:
> On Tue, Feb 20, 2018 at 8:45 AM, Beppe  wrote:
> >
> > Biovarase has been updated to version 2,
> >
> > The project has been migrated from python 2.7 to python 3.5
> >
> > Biovarase is an application to manage clinical quality control data.
> >
> > The purpose of Quality Control Assurance in a clinical laboratory is to 
> > allow the control of the performances of an analytical procedure showing an 
> > alarm as soon as the trial doesn't result in the degree to respect the 
> > defined analytical rules. Biovarase furthermore calculates the classical 
> > statistical parameters for the quality control assurance ,e.g. sd, cv%, 
> > avg, and even the Imp(%), Bias(%) and TEa (total allowable error) using 
> > data retrived from: Current databases on biologic variation: pros, cons and 
> > progress Scand J Clin Lab Invest 1999;59:491-500. updated with the most 
> > recent specifications made available in 2014.
> > It uses even the famous Westgard's rules to monitor results dataset.
> > All the data are managed by SQLite database and matplotlib.
> > To show levey jennings graph, in the main windows select a test and choose 
> > the relative batch.
> > To deactivate/activate a result make double click on it.
> > To insert, update or delete a batch or a result open from File/Batchs and 
> > results.
> > To export data to a temp excel file click on File/Export.
> >
> > Biovarase requires Python 3
> > Biovarase use Tkinter and matplotlib
> >
> > All source code on
> >
> > https://github.com/1966bc/Biovarase
> >
> > I'made it for fun :(.
> > I would appreciate any suggestions you might have.
> 
> Cool! Good to see.
> 
> A few small suggestions, but nothing major. All your git commits are
> "file upload" apart from the occasional web edit; I would recommend
> getting familiar with command-line git and making commits with useful
> messages. (I was hoping to have a look at the changes that you did for
> Py2 -> Py3, but couldn't find them in the pile of big changes.) I'd
> also suggest getting an actual LICENSE or COPYING file, since your
> README says your code is GPL'd. And you may want to look into the
> formatting of your README - there are a few things that probably
> should be turned into bulleted lists rather than flowing as
> paragraphs. But otherwise, cool! I like to see this sort of thing
> published and open sourced.
> 
> ChrisA

Well, I don't manage a lot of git hub yet but I will surely keep in mind of 
your suggestions.

Publishing this project and others is the least one that I can do for thanking 
the python's programmer community of the things that I have learned

...I believe even that I must also work hard on my English

thank you very much for your attention Chris

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


[issue32878] Document value of st_ino on Windows

2018-02-19 Thread Guido van Rossum

New submission from Guido van Rossum :

We received a report from a well-meaning security researcher who was confused 
by the non-zero and arbitrary value of st_ino in stat() results on Windows 
(where in Python 2 this was always zero). The researcher was worried that this 
was due to an uninitialized memory read. The actual cause is the way this field 
is filled with arbitary data:
https://github.com/python/cpython/blob/master/Python/fileutils.c#L758

Let's make sure this is documented properly for all versions where we still 
update the docs.

--
assignee: steve.dower
components: Documentation
messages: 312376
nosy: gvanrossum, steve.dower
priority: normal
severity: normal
status: open
title: Document value of st_ino on Windows

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How to link to python 3.6.4 library on linux ?

2018-02-19 Thread Chris Angelico
On Tue, Feb 20, 2018 at 8:07 AM, Jason Qian via Python-list
 wrote:
>  Hi,
>
>   I am calling python from a  c application.
>   It compiles and works fine on the windows. How do I compile and link
> it on the linux for Python 3.6.4  ?
>
>   Under python dir, it only have a static library,
>
>/opt/Python-3.6.4*/lib*/*libpython3.6m.a*
>
> * If I link to it, I got:*
>
> */opt/Python-3.6.4/lib/libpython3.6m.a(abstract.o): relocation R_X86_64_32S
> against `_Py_NotImplementedStruct' can not be used when making a shared
> object; recompile with -fPIC*
> */opt/Python-3.6.4/lib/libpython3.6m.a: could not read symbols: Bad value*
>

By "calling Python from C", do you mean what the docs call "embedding"?

https://docs.python.org/3/extending/embedding.html

I would recommend following the tutorial there, if you haven't
already. If you have, and the tutorial code doesn't work for you, post
your code and what you did, and we'll try to help with that.

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


Re: [ANN] Biovarase ver 2

2018-02-19 Thread Chris Angelico
On Tue, Feb 20, 2018 at 8:45 AM, Beppe  wrote:
>
> Biovarase has been updated to version 2,
>
> The project has been migrated from python 2.7 to python 3.5
>
> Biovarase is an application to manage clinical quality control data.
>
> The purpose of Quality Control Assurance in a clinical laboratory is to allow 
> the control of the performances of an analytical procedure showing an alarm 
> as soon as the trial doesn't result in the degree to respect the defined 
> analytical rules. Biovarase furthermore calculates the classical statistical 
> parameters for the quality control assurance ,e.g. sd, cv%, avg, and even the 
> Imp(%), Bias(%) and TEa (total allowable error) using data retrived from: 
> Current databases on biologic variation: pros, cons and progress Scand J Clin 
> Lab Invest 1999;59:491-500. updated with the most recent specifications made 
> available in 2014.
> It uses even the famous Westgard's rules to monitor results dataset.
> All the data are managed by SQLite database and matplotlib.
> To show levey jennings graph, in the main windows select a test and choose 
> the relative batch.
> To deactivate/activate a result make double click on it.
> To insert, update or delete a batch or a result open from File/Batchs and 
> results.
> To export data to a temp excel file click on File/Export.
>
> Biovarase requires Python 3
> Biovarase use Tkinter and matplotlib
>
> All source code on
>
> https://github.com/1966bc/Biovarase
>
> I'made it for fun :(.
> I would appreciate any suggestions you might have.

Cool! Good to see.

A few small suggestions, but nothing major. All your git commits are
"file upload" apart from the occasional web edit; I would recommend
getting familiar with command-line git and making commits with useful
messages. (I was hoping to have a look at the changes that you did for
Py2 -> Py3, but couldn't find them in the pile of big changes.) I'd
also suggest getting an actual LICENSE or COPYING file, since your
README says your code is GPL'd. And you may want to look into the
formatting of your README - there are a few things that probably
should be turned into bulleted lists rather than flowing as
paragraphs. But otherwise, cool! I like to see this sort of thing
published and open sourced.

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


How to link to python 3.6.4 library on linux ?

2018-02-19 Thread Jason Qian via Python-list
 Hi,

  I am calling python from a  c application.
  It compiles and works fine on the windows. How do I compile and link
it on the linux for Python 3.6.4  ?

  Under python dir, it only have a static library,

   /opt/Python-3.6.4*/lib*/*libpython3.6m.a*

* If I link to it, I got:*

*/opt/Python-3.6.4/lib/libpython3.6m.a(abstract.o): relocation R_X86_64_32S
against `_Py_NotImplementedStruct' can not be used when making a shared
object; recompile with -fPIC*
*/opt/Python-3.6.4/lib/libpython3.6m.a: could not read symbols: Bad value*


*Thanks for the help,*
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32874] IDLE: Add tests for pyparse

2018-02-19 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

My only contact with pyparse has been #21765, which modified hyperparser and 
pyparse to support unicode identifiers.  It also added tests for hyperparser, 
but not pyparse (msg223150: "it seems to be working as expected").  Thanks for 
filling in this hole.

--
versions: +Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ANN] Biovarase ver 2

2018-02-19 Thread Beppe

Biovarase has been updated to version 2, 

The project has been migrated from python 2.7 to python 3.5

Biovarase is an application to manage clinical quality control data.

The purpose of Quality Control Assurance in a clinical laboratory is to allow 
the control of the performances of an analytical procedure showing an alarm as 
soon as the trial doesn't result in the degree to respect the defined 
analytical rules. Biovarase furthermore calculates the classical statistical 
parameters for the quality control assurance ,e.g. sd, cv%, avg, and even the 
Imp(%), Bias(%) and TEa (total allowable error) using data retrived from: 
Current databases on biologic variation: pros, cons and progress Scand J Clin 
Lab Invest 1999;59:491-500. updated with the most recent specifications made 
available in 2014.
It uses even the famous Westgard's rules to monitor results dataset.
All the data are managed by SQLite database and matplotlib.
To show levey jennings graph, in the main windows select a test and choose the 
relative batch.
To deactivate/activate a result make double click on it.
To insert, update or delete a batch or a result open from File/Batchs and 
results.
To export data to a temp excel file click on File/Export.

Biovarase requires Python 3 
Biovarase use Tkinter and matplotlib

All source code on

https://github.com/1966bc/Biovarase

I'made it for fun :(.
I would appreciate any suggestions you might have.

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


[issue32877] Login to bugs.python.org with Google account NOT working

2018-02-19 Thread ruffsl

New submission from ruffsl :

I've been unable to login to bugs.python.org using Google's oauth.

After clicking the google oauth logo on the sidebar on bugs.python.org, I am 
either slowly redirected to a google login page (after about 1 min) to select 
an account, then after selecting the relevant google account or if I'm only 
active in it, I'm eventually given a error message after about 2 min of loading 
time:

``` html
An error has occurred
An error has occurred
A problem was encountered processing your request.
The tracker maintainers have been notified of the problem.

```

Other outputs from the browser debug console:
```
Failed to load resource: the server responded with a status of 404 
(/tracker/favicon.ico)
Failed to load resource: the server responded with a status of 500 (Internal 
Server Error)
```
This has persisted for about a week now, on multiple machines, bowsers, and 
ISPs. Presently, the only way I've been able to post this issue at all is due 
to my first and only login session on one workstation is still active. I 
suspect this might be a larger issue, only that no one else using google oauth 
to login has been able to login to file and voise the bug?

Related?
https://bugs.python.org/issue29544
https://bugs.python.org/issue28887

--
messages: 312374
nosy: ruffsl
priority: normal
severity: normal
status: open
title: Login to bugs.python.org with Google account NOT working

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32566] Not able to run Python 3.6 on Windows

2018-02-19 Thread Steve Dower

Change by Steve Dower :


--
resolution:  -> works for me
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30439] Expose the subinterpreters C-API in the stdlib.

2018-02-19 Thread pmpp

Change by pmpp :


--
nosy: +pmpp

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-02-19 Thread pmpp

Change by pmpp :


--
nosy: +pmpp

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Help on convert PyObject to string (c) Python 3.6

2018-02-19 Thread Jason Qian via Python-list
Thanks a lot and I will take a look Cython,

On Mon, Feb 19, 2018 at 3:23 PM, Stefan Behnel  wrote:

> Jason Qian via Python-list schrieb am 04.02.2018 um 17:52:
> >This is the case of calling python from c and the python function
> will
> > return a string.
>
> Hi Jason,
>
> I noticed that you ran into a couple of problems using the C-API, so I
> suggest looking into Cython instead. It basically translates Python to C
> and supports optional static usage of C and C++ data types, so you get all
> the native code interaction *and* all the Python interaction and features,
> without having to go through the hassle of learning how the Python
> internals work (and why they don't work for you). The code it generates is
> probably also faster and safer than what you are currently writing (no
> offence, just experience from reading and writing a lot of such code).
>
> http://cython.org/
>
> Stefan
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30121] Windows: subprocess debug assertion on failure to execute the process

2018-02-19 Thread miss-islington

miss-islington  added the comment:


New changeset 622a824802771fc5aa133ae92101bc8303360294 by Miss Islington (bot) 
in branch '3.7':
bpo-30121: Fix test_subprocess for Windows Debug builds (GH-5758)
https://github.com/python/cpython/commit/622a824802771fc5aa133ae92101bc8303360294


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32856] Optimize the `for y in [x]` idiom in comprehensions

2018-02-19 Thread Stefan Behnel

Change by Stefan Behnel :


--
nosy: +scoder

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-02-19 Thread Zachary Ware

Zachary Ware  added the comment:

I'm pretty sure that report is still running on the last changeset on 
hg.python.org; can you confirm that Antoine?

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30121] Windows: subprocess debug assertion on failure to execute the process

2018-02-19 Thread miss-islington

miss-islington  added the comment:


New changeset ef0bb5c7b76a49a5f3c5b85b5f9112cfefe54328 by Miss Islington (bot) 
in branch '3.6':
bpo-30121: Fix test_subprocess for Windows Debug builds (GH-5758)
https://github.com/python/cpython/commit/ef0bb5c7b76a49a5f3c5b85b5f9112cfefe54328


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-02-19 Thread Yury Selivanov

Yury Selivanov  added the comment:

FYI I found out about this refleak from 
https://mail.python.org/pipermail/python-checkins/2018-February/153907.html

So it's definitely not Mac OS X specific thing.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-02-19 Thread Zachary Ware

Zachary Ware  added the comment:

Looks like macOS rather than Windows, and I can't reproduce it locally with 
current master:

14:28 $ ./python.exe -m test -R3:3 test_multiprocessing_fork
Run tests sequentially
0:00:00 load avg: 2.68 [1/1] test_multiprocessing_fork
beginning 6 repetitions
123456
..
test_multiprocessing_fork passed in 9 min 20 sec
1 test OK.

Total duration: 9 min 20 sec
Tests result: SUCCESS



The Windows and Linux refleak buildbots [1] are currently unhappy about other 
things that appear to be unrelated.

[1] http://buildbot.python.org/all/#/builders?tags=%2Brefleak

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Help on convert PyObject to string (c) Python 3.6

2018-02-19 Thread Stefan Behnel
Jason Qian via Python-list schrieb am 04.02.2018 um 17:52:
>This is the case of calling python from c and the python function  will
> return a string.

Hi Jason,

I noticed that you ran into a couple of problems using the C-API, so I
suggest looking into Cython instead. It basically translates Python to C
and supports optional static usage of C and C++ data types, so you get all
the native code interaction *and* all the Python interaction and features,
without having to go through the hassle of learning how the Python
internals work (and why they don't work for you). The code it generates is
probably also faster and safer than what you are currently writing (no
offence, just experience from reading and writing a lot of such code).

http://cython.org/

Stefan

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


[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-02-19 Thread Eric Snow

Eric Snow  added the comment:

Davin, any thoughts on how my most recent commit (for this issue) might be 
causing the leaks Yury found?

--
nosy: +davin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-02-19 Thread Eric Snow

Eric Snow  added the comment:

I'm not seeing any refleak (on linux/clang).  I'm guessing this is 
Windows-specific (based on use of "./python.exe").  How does 
test_multiprocessing_fork even run on Windows?  I thought "fork" is an 
unsupported start method on Windows (see 
https://docs.python.org/3.7/library/multiprocessing.html#contexts-and-start-methods).

Also, I'm not sure how my change might cause a refleak outside of code using 
the _xxsubinterpreters module.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32872] backport of #32305 causes regressions in various packages

2018-02-19 Thread Brett Cannon

Brett Cannon  added the comment:

I'm personally fine if the change gets reverted. I don't think the odd 
behaviour is severe enough to justify breaking projects in a maintenance 
release. Besides, they will learn soon enough about their code breaking in 
Python 3.7.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: c code generator from python

2018-02-19 Thread Stefan Behnel
bhattacharya.kush...@gmail.com schrieb am 17.01.2018 um 12:03:
> Is there any python framework or any tool as  which can generate C code from 
> python code as it is .

http://cython.org/

Stefan

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


[issue32876] HTMLParser raises exception on some inputs

2018-02-19 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +ezio.melotti

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30121] Windows: subprocess debug assertion on failure to execute the process

2018-02-19 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5537

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30121] Windows: subprocess debug assertion on failure to execute the process

2018-02-19 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5538

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30121] Windows: subprocess debug assertion on failure to execute the process

2018-02-19 Thread Zachary Ware

Zachary Ware  added the comment:


New changeset 5537646bfacec463b450871dde31cb06c44a0556 by Zachary Ware in 
branch 'master':
bpo-30121: Fix test_subprocess for Windows Debug builds (GH-5758)
https://github.com/python/cpython/commit/5537646bfacec463b450871dde31cb06c44a0556


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams

2018-02-19 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

Thank you for checking. If this issue happens even when Python is run manually 
from an ordinary shell, fixing it in the same way as in #30225 is probably not 
what you want because while the error message will be gone the corresponding 
std stream will be None (sys.stdin in the case that you ktrace'd). However, if 
fd 0 really becomes unusable for some reason, there isn't anything Python can 
do.

Given your description and ktrace log, I can't imagine why fd 0 would behave 
strangely only in Python. I've attached a small C program to check fd 0. Could 
you compile it and run in an infinite loop from the shell in an attempt to 
reproduce this?

--
Added file: https://bugs.python.org/file47451/fstat0.c

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32876] HTMLParser raises exception on some inputs

2018-02-19 Thread Hanno Boeck
New submission from Hanno Boeck :

I noticed that the HTMLParser will raise an exception on some inputs.
I'm not sure what the expectations here are, but given that real-world HTML 
often contains all kinds of broken content I would assume an HTMLParser to 
always try to parse a document and not be interrupted by an exception if an 
error occurs.

Here's a minified example:
#!/usr/bin/env python3
import html.parser
html.parser.HTMLParser().feed("https://kafanews.com/

Exception of minified example:

Traceback (most recent call last):
  File "./foo.py", line 5, in 
html.parser.HTMLParser().feed("
<https://bugs.python.org/issue32876>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com


[issue30121] Windows: subprocess debug assertion on failure to execute the process

2018-02-19 Thread Zachary Ware

Change by Zachary Ware :


--
pull_requests: +5536

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-02-19 Thread Eric Snow

Eric Snow  added the comment:

@Yury, thanks!  I thought I had checked before I made the PR, but apparently 
not.  I'll git it fixed.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32820] Add bits method to ipaddress

2018-02-19 Thread Eric Osborne

Eric Osborne  added the comment:

I brought it up on python-ideas.  Since I've not been through this process
before - what happens now?  Do I wait for code review on github, or is
there more I need to do?

eric

On Tue, Feb 13, 2018 at 11:56 PM Nick Coghlan 
wrote:

>
> Nick Coghlan  added the comment:
>
> Aye, definitely worth a thread on python-ideas. My rationale for
> suggesting something based on the built-in numeric codes is that it makes
> it straightforward for *users* to transfer knowledge from that
> mini-language.
>
> As far as parsing goes, I was thinking of something along the lines of the
> following naive approach:
>
> typechar = fmt[-1:]
> if not typechar or typechar not in ("b", "n", "x"):
> return super().__format__(fmt)
> prefix, group_sep, suffix = fmt[:-1].rpartition("_")
> if prefix and prefix != "#" or suffix:
> return super().__format__(fmt)
> field_width = self._calculate_field_width(typechar)
> return format(int(self),
> f"{prefix}0{field_width}{group_sep}{type_char}")
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread Ned Batchelder

On 2/19/18 1:01 PM, Paul Moore wrote:

On 19 February 2018 at 17:11, Ned Batchelder  wrote:

On 2/19/18 10:39 AM, Paul Moore wrote:

I'm curious - How would you explain Python's "variables" to someone
who knows how C variables work, in a way that ensures they don't carry
across any unfortunate misconceptions based on how C works? If I had a
good way of doing that, maybe I wouldn't need to play apple/orange
games when discussing the subject.

I would (and did) explain it like this:
https://nedbatchelder.com/text/names1.html

That talk was pretty much powered by hating the phrase "Python has no
variables" :)

Interesting (and somewhat embarrassing :-() That talk (which I'd
forgotten was yours) was one of the key things that made me start
thinking in terms of Python naming values rather than assigning values
to variables! I still find that your explanation (which never uses the
term "variable" until you refer to the "Python has no variables" idea
at the end) is one of the best ways to describe how Python assignment
works.

But using your explanation as a way to defend a statement that you
don't agree with is wrong, so I'll stop doing that in future. Sorry!

In terms of your talk, would I be right to say that "names" (in the
sense you use them in that talk) are Python's "variables"? That
equates to common usage, so I can go with that ("Python's variables
act like names, unlike other languages"). But I'd hate to replace one
misunderstanding of what you said with another, so let me know if I've
still got it wrong...


TBH, I forget the exact words I used during the talk, but: names are 
Python's variables. That sounds good to me.


--Ned.

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


[issue31937] Add the term "dunder" to the glossary

2018-02-19 Thread Brett Cannon

Change by Brett Cannon :


--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32875] Add __exit__() method to event loops

2018-02-19 Thread Victor Porton

New submission from Victor Porton :

Please add `__exit__()` method to event loops, to use them with `with`.

--
components: asyncio
messages: 312360
nosy: asvetlov, porton, yselivanov
priority: normal
severity: normal
status: open
title: Add __exit__() method to event loops
type: enhancement
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Python 2 to 3 Conversion

2018-02-19 Thread Chris Angelico
On Tue, Feb 20, 2018 at 3:53 AM, Wildman via Python-list
 wrote:
> On Tue, 20 Feb 2018 02:26:19 +1100, Chris Angelico wrote:
>
>> * Opaque IOCTLs
>
> Would you mind to elaborate a little about your
> concerns?

Look at your original code: it's impossible to figure out what it's
doing or whether it's doing it correctly. "Opaque" in this context
means that you can't grok the code without external help. This is a
code smell, and a strong indication that you're "fiddling" in stuff
way lower level than you normally want to be working with. It's
usable, but it's dirty and leaves everything up to you (do you know
for sure, for instance, if this is backward compatible?
Cross-platform?), and that makes it comparable to depending on an
external program.

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


[issue32854] Add ** Map Unpacking Support for namedtuple

2018-02-19 Thread Jay Crotts

Jay Crotts  added the comment:

Thanks Raymond, I wasn't sure if it was a common pattern or not, that makes 
sense.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32872] backport of #32305 causes regressions in various packages

2018-02-19 Thread Ned Deily

Change by Ned Deily :


--
priority: critical -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Python 2 to 3 Conversion

2018-02-19 Thread Chris Angelico
On Tue, Feb 20, 2018 at 3:49 AM, Wildman via Python-list
 wrote:
> On Mon, 19 Feb 2018 12:32:49 +, Rhodri James wrote:
>
>> On 18/02/18 16:18, Wildman via Python-list wrote:
 But that's only going to show one (uplink) address. If I needed to get
 ALL addresses for ALL network adapters, I'd either look for a library,
 and if one wasn't easily found, I'd shell out to the "ip" command and
 parse its output.:)

>>> I considered using the "ip" command but I prefer not to
>>> depend on external programs if I can get around it.  I
>>> know that might be considered silly but that's just me.
>>
>> It's not silly at all, but for Linux networking it might be the best
>> idea.  I believe in theory you are supposed to use libnl (in some
>> suitable wrapping), but my experience with that is that it is badly
>> documented and horrendously unreliable.
>
> It looks like libnl would do what I want but there is
> a problem.  When finished, my program will be released
> in the form of a Debian (*.deb) package and used by,
> for the most part, 'average' Linux users.  These are
> people that know their way around Linux but know
> nothing or very little about Python.  Installing a
> package using pip by them is pretty much out of the
> question.  The system's package manager must be able
> to handle the program's dependencies so third-party
> packages are out of the question.
>
> But thanks for the suggestion.

If you're distributing it as a .deb, you don't want to use pip to grab
additional libraries. Ideally, you'd want the library to *also* be
available through the package manager, which would mean you can simply
record it as a dependency. If it's not... it's not gonna be easy.

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


[issue32872] backport of #32305 causes regressions in various packages

2018-02-19 Thread Ned Deily

Ned Deily  added the comment:

Now that we know that this change *does* break some existing code, I think it 
is worth having that talk as mentioned in PR 5481:

"I suppose it's possible that this will break existing code, but I'd argue that 
because current behavior runs counter to the documentation and makes no sense 
given the inconsistencies, it is better to fix them. I propose this change be 
applied to 3.7 and 3.6, although if you, my friendly reviewer, disagrees about 
3.6, we can talk about it!"

The question I have is: is the problem the backport is trying to fix severe 
enough to cause package regressions in the middle of a maintenance release 
cycle?  Sure, the third-party packages should be fixed and such a change is 
fine for 3.7 but we also kinda promise that installing a maintenance release 
should be painless.  I don't know what is the right answer and I don't want to 
spend a lot of time on this but I'd like to get a bit more input on this before 
we go ahead with releasing it in 3.6.5.

--
nosy: +brett.cannon, ncoghlan, ned.deily
resolution: wont fix -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Python 2 to 3 Conversion

2018-02-19 Thread Wildman via Python-list
On Tue, 20 Feb 2018 02:26:19 +1100, Chris Angelico wrote:

> * Opaque IOCTLs

Would you mind to elaborate a little about your
concerns?

-- 
 GNU/Linux user #557453
"There are only 10 types of people in the world...
those who understand Binary... and those who don't."
  -Spike
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread Steve Dower

Change by Steve Dower :


--
keywords: +patch
pull_requests: +5535
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How to run script from interpreter?

2018-02-19 Thread windhorn
On Saturday, February 17, 2018 at 8:50:48 AM UTC-6, Steven D'Aprano wrote:
> 
> For me, the tool I use is a set of re-usable tools:
> 
> - a text editor;
> - a system command prompt in a terminal/console window;
> - a Python REPL for running code snippets and looking up help(obj).
> 
> Other people prefer a IDE like Spyder (or many others). Either way, 
> they're designed for the edit-run-debug-edit cycle.

I hadn't looked at Spyder, it seems very useful.

> I edit the source code of my script in the text editor, then run it from 
> the command prompt using
> 
> python myscript.py
> 
> If I need the debugger, I use:
> 
> python -i myscript.py
> ... 
> then edit the script to make the tests work.
> 
> The best part of this is each time you run the script, it is guaranteed 
> to be running *fresh*, with no left-over cruft from previous runs.

Good point. But some of that is stuff I'm using, so maybe it has to go in the 
script.

And this from Ian seems to work for me:

> py> import foo  # Get the module to reload
> py> reload(foo)  # Reload it
> py> from foo import *  # Update all the names previously *-imported

Thanks all for some good advice.

Regards,
Allen
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread Paul Moore
On 19 February 2018 at 17:11, Ned Batchelder  wrote:
> On 2/19/18 10:39 AM, Paul Moore wrote:
>>
>> I'm curious - How would you explain Python's "variables" to someone
>> who knows how C variables work, in a way that ensures they don't carry
>> across any unfortunate misconceptions based on how C works? If I had a
>> good way of doing that, maybe I wouldn't need to play apple/orange
>> games when discussing the subject.
>
> I would (and did) explain it like this:
> https://nedbatchelder.com/text/names1.html
>
> That talk was pretty much powered by hating the phrase "Python has no
> variables" :)

Interesting (and somewhat embarrassing :-() That talk (which I'd
forgotten was yours) was one of the key things that made me start
thinking in terms of Python naming values rather than assigning values
to variables! I still find that your explanation (which never uses the
term "variable" until you refer to the "Python has no variables" idea
at the end) is one of the best ways to describe how Python assignment
works.

But using your explanation as a way to defend a statement that you
don't agree with is wrong, so I'll stop doing that in future. Sorry!

In terms of your talk, would I be right to say that "names" (in the
sense you use them in that talk) are Python's "variables"? That
equates to common usage, so I can go with that ("Python's variables
act like names, unlike other languages"). But I'd hate to replace one
misunderstanding of what you said with another, so let me know if I've
still got it wrong...

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


[issue32872] backport of #32305 causes regressions in various packages

2018-02-19 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread Ned Batchelder

On 2/19/18 10:39 AM, Paul Moore wrote:

On 19 February 2018 at 15:18, Ned Batchelder  wrote:

On 2/19/18 9:54 AM, Steven D'Aprano wrote:

On Mon, 19 Feb 2018 13:28:26 +, Paul Moore wrote:


[1] The most basic question, which people making such claims often can't
answer, is "Do you mean that values are strongly typed, or that names
are? Or did you mean that variables are, because if so Python doesn't
even have variables in the sense that you mean" Programming language
semantics are complex.

An excellent point.

The distinction between typing *values* and *names* is a good one.


I guess I'll have to continue to grit my teeth as people say, "Python
doesn't have variables."   Why can't we say, "Python's variables work
differently than other languages"?

Apologies, Ned. I didn't mean to make your teeth sore :-)

I've found that when people refer to "variables" they pretty much
inevitably have a picture in their mind of a named box that "contains"
a value (or pointer to a value). They find it difficult to understand
that Python doesn't have those boxes but rather names the values
directly. Sort of. And yes, that 's very much "sort of". It's
certainly just as viable to say to people that Python's idea of
variables is different than (say) C's, but in my experience you end up
qualifying so much that it's easier to use a different term without
the connotations. Sort of like saying "I like apples - the orange ones
that are a type of citrus fruit" :-)

In common usage I'll happily use the terms "variable" and "name"
somewhat interchangeably, but when things degenerate into detail-level
picking over specifics, I avoid doing so. I was wrong to casually say
"Python doesn't have variables", though - if I want to be detailed and
specific, I should make sure my writing reflects that that's what I'm
doing.

I'm curious - How would you explain Python's "variables" to someone
who knows how C variables work, in a way that ensures they don't carry
across any unfortunate misconceptions based on how C works? If I had a
good way of doing that, maybe I wouldn't need to play apple/orange
games when discussing the subject.


I would (and did) explain it like this: 
https://nedbatchelder.com/text/names1.html


That talk was pretty much powered by hating the phrase "Python has no 
variables" :)


--Ned.


Paul


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


  1   2   >