[issue33687] uu.py calls os.path.chmod which doesn't exist

2019-01-17 Thread Berker Peksag


Berker Peksag  added the comment:

Thank you for the report, Poul-Henning and thank you for the PR, Timo!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2019-01-17 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset a261b737617ca8d52e04bf3ead346b1b8786a212 by Berker Peksag (Miss 
Islington (bot)) in branch '3.7':
bpo-33687: Fix call to os.chmod() in uu.decode() (GH-7282)
https://github.com/python/cpython/commit/a261b737617ca8d52e04bf3ead346b1b8786a212


--

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2019-01-17 Thread Berker Peksag


Change by Berker Peksag :


--
pull_requests:  -11290

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2019-01-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11289, 11290

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2019-01-17 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 17f05bbc78dbcd1db308266c31370da9ec1b1d47 by Berker Peksag (Timo 
Furrer) in branch 'master':
bpo-33687: Fix call to os.chmod() in uu.decode() (GH-7282)
https://github.com/python/cpython/commit/17f05bbc78dbcd1db308266c31370da9ec1b1d47


--
nosy: +berker.peksag

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-07-12 Thread STINNER Victor


STINNER Victor  added the comment:

>  Please note that the mode is not just a parameter, it is also a data field 
> inside the encoded input.

Oh... right...

" is the file's Unix file permissions as three octal digits (e.g. 644, 
744). This is typically only significant to unix-like operating systems."

Ok, in that case, it's maybe better to fix the bug instead of removing the 
parameter.

--

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-07-12 Thread Poul-Henning Kamp


Poul-Henning Kamp  added the comment:

Please note that the mode is not just a parameter, it is also a data field 
inside the encoded input.

See: https://en.wikipedia.org/wiki/Uuencoding

(search for "mode")

--

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-07-12 Thread STINNER Victor


STINNER Victor  added the comment:

Is there really an use case which requires to set the permission of the file 
created by uu.decode()? It is already possible to call uu.decode() with an open 
file which has been created with the expected permission. Moreover, it's also 
possible to explicitly call chmod() *after* uu.decode().

I would suggest to deprecate the mode parameter in Python 3.7 and remove it 
from Python 3.8.

--

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-06-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

But 'xb' should be used only if out_file is not specified.

--

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-06-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I concur with Martin. If this feature never worked, there is a risk of breaking 
user code when fix it. Let consider this as adding a new feature in 3.8. For 
older versions it should be documented that the mode of the output file is not 
set.

And I agree that it would be more safe to use os.open(). Either call os.open() 
and pass the file descriptor to the builtin open() (but be careful to not leak 
it) or use the opener argument of open().

def opener(path, flags):
return os.open(path, flags, mode)
fp = open(out_file, 'wb', opener=opener)

It would be worth also to use the 'xb' opening mode instead of 'wb'.

--

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-06-10 Thread Poul-Henning Kamp


Poul-Henning Kamp  added the comment:

I was just playing with it in a prototype and noticed that it didn't work.

--

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-06-10 Thread STINNER Victor


STINNER Victor  added the comment:

> It looks like the module has never set the file mode, at least since it was 
> added to Python in 1994. I suggest just remove the dead code and fix the 
> documentation.

You cannot just remove the mode parameter without a deprecation period. Right 
now, the flag is documented:

https://docs.python.org/dev/library/uu.html
"mode is used to set the permission bits if the file must be created"

I agree with Martin that I am not comfortable to fix the bug in stable branches 
(2.7, 3.6, 3.7).

I'm +0 to fix the uu module in master (future 3.8).

If we fix the bug in master, we should document that mode is ignored in 2.7, 
3.6 and 3.7 (update their documentation).

--

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-06-10 Thread Martin Panter

Martin Panter  added the comment:

What is your use case, Poul-Henning?

It looks like the module has never set the file mode, at least since it was 
added to Python in 1994. I suggest just remove the dead code and fix the 
documentation. At least you shouldn’t make this change in bug fix releases. It 
is just as likely to break people’s code as fix it.

If you do want to change the behaviour, I suggest using “os.open” to set the 
mode when the file is created. Otherwise you risk errors and messing up the 
filesystem when using special files e.g. uu.decode(..., "/dev/null").

--
nosy: +martin.panter

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-06-06 Thread Xiang Zhang


Change by Xiang Zhang :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-06-06 Thread Xiang Zhang


Xiang Zhang  added the comment:

I modified it for the feature, not maintain it. I remember at that time I get 
the feeling it's somewhat strange there are two APIs, with similar 
functionality resides in two modules, need to be updated.

--
nosy:  -r.david.murray

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-06-06 Thread R. David Murray


R. David Murray  added the comment:

The email module uses it, so I would object to its being removed.  It may not 
be used often (probably only when working with old email archives), but there's 
no good reason I can see to break something that currently works.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-06-06 Thread STINNER Victor


STINNER Victor  added the comment:

Is the uu module still maintained? Christian Heimes wants to remove the module:
https://github.com/tiran/peps/blob/oldbatteries/pep-.rst

Xiang Zhang made a change in uu last year to add a new feature: new backtick 
optional parameter, bpo-30103.

--
nosy: +christian.heimes, vstinner, xiang.zhang

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-05-31 Thread Timo Furrer


Timo Furrer  added the comment:

I've added a test and updated the PR.

--
nosy: +tuxtimo

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-05-31 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Would be nice to add a test.

--

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-05-31 Thread Timo Furrer


Change by Timo Furrer :


--
keywords: +patch
pull_requests: +6908
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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-05-29 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +easy
stage:  -> needs patch
versions: +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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-05-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Looks as the proper fix to me.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-05-29 Thread Poul-Henning Kamp


New submission from Poul-Henning Kamp :

Library file uu.py on at least 2.7 and 3.6 contains:

try:
os.path.chmod(out_file, mode)
except AttributeError:
pass

As far as I can tell, os.path.chmod does not exist, so this always raises 
AttributeError and becomes a no-op.

Is suspect the proper fix is to remove the ".path" ?

--
components: Library (Lib)
messages: 318119
nosy: bsdphk
priority: normal
severity: normal
status: open
title: uu.py calls os.path.chmod which doesn't exist
type: behavior
versions: Python 2.7, Python 3.6

___
Python tracker 

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