[issue29105] code or doc improvement for logging.handlers.RotatingFileHandler

2016-12-29 Thread iMath

New submission from iMath:

For 
class logging.handlers.RotatingFileHandler(filename, mode='a', maxBytes=0, 
backupCount=0, encoding=None, delay=0) 

if backupCount is zero and maxBytes is non-zero, the log file size could exceed 
maxBytes, i.e. we are not able to restrict the log file size using 
RotatingFileHandler at this case .
I suggest add the above description to the doc 
https://docs.python.org/3.6/library/logging.handlers.html#logging.handlers.RotatingFileHandler
If possible , set backupCount=1 by default to avoid this pitfall as much as 
possible.

The doc right now just says "if either of maxBytes or backupCount is zero, 
rollover never occurs.", it is too difficult to understand the meaning of 
'Rollover' to aviod the pitfall .

--
assignee: docs@python
components: Documentation
messages: 284277
nosy: docs@python, redstone-cold
priority: normal
severity: normal
status: open
title: code or doc improvement for logging.handlers.RotatingFileHandler
type: enhancement
versions: Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29105>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29074] repr doesn't give full result for this re math result

2016-12-26 Thread iMath

New submission from iMath:

I tested with Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC 
v.1900 32 bit (Intel)] on win32

re.search(r'http://v.pptv.com/show/.*?\.html.+', 
'http://v.pptv.com/show/2bwkox9SS4nsatI.html?rcc_src=P5') 
does give a match, but it show the result 
<_sre.SRE_Match object; span=(0, 54), 
match='http://v.pptv.com/show/2bwkox9SS4nsatI.html?rcc_s>
missing rc=P5' in IDLE

BTW, py2.7 works fine

--
components: Regular Expressions
messages: 284024
nosy: ezio.melotti, mrabarnett, redstone-cold
priority: normal
severity: normal
status: open
title: repr doesn't give full result for this re math result
type: behavior
versions: Python 3.5

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29074>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32366] suggestion:html.escape(s, quote=True) escape \n to

2017-12-18 Thread iMath

New submission from iMath <redstone-c...@163.com>:

It would be better if html.escape(s, quote=True) could escape linefeed to 
https://docs.python.org/3/library/html.html#html.escape

--
components: XML
messages: 308546
nosy: redstone-cold
priority: normal
severity: normal
status: open
title: suggestion:html.escape(s, quote=True) escape  \n to 
type: enhancement

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32366>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30904] Python 3 logging HTTPHandler sends duplicate Host header

2017-12-07 Thread iMath

iMath <redstone-c...@163.com> added the comment:

Yes, I met with the same bug, see the post for description and bug 
investigation 
https://stackoverflow.com/questions/43185804/using-httphandler-cause-django-server-side-shows-http-400-and-invalid-http-host/47434323#47434323

--
nosy: +redstone-cold

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue30904>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34221] Any plans to combine collections.OrderedDict with dict

2018-07-25 Thread iMath

New submission from iMath :

Since Python 3.7,dicts remember the order that items were inserted, so any 
plans to combine collections.OrderedDict with dict?
https://docs.python.org/3/library/collections.html?#collections.OrderedDict
https://docs.python.org/3/library/stdtypes.html#dict 

BTW, I think it would be better to move "Dictionaries preserve insertion order" 
part at the end of the doc of 
https://docs.python.org/3/library/stdtypes.html#dict 
up below the doc for 
class dict(**kwarg)
class dict(mapping, **kwarg)
class dict(iterable, **kwarg)
so that people won't miss the feature when consulting the doc

--
messages: 322349
nosy: redstone-cold
priority: normal
severity: normal
status: open
title: Any plans to combine collections.OrderedDict with dict
type: enhancement

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



[issue34450] improve shutil.make_archive

2018-08-21 Thread iMath

New submission from iMath :

The current behavior of shutil.make_archive caused many issues , the problem is 
mainly on the extracted archive directory hierarchy. These are the proofs:
https://stackoverflow.com/questions/51914467/directory-hierarchy-issue-when-using-shutil-make-archive

https://stackoverflow.com/questions/32640053/compressing-directory-using-shutil-make-archive-while-preserving-directory-str

https://stackoverflow.com/questions/41624800/shutil-make-archive-issue-dont-want-directories-included-in-zip-file

https://stackoverflow.com/questions/50156657/unexpected-file-using-shutil-make-archive-to-compress-file
For example , if I want to create a zip archive of the pip package (path 
specified by pip.__path__[0])), and need a directory named pip to hold the  
files and folders which originally reside in the pip package when unpacking the 
archive, then I need give root_dirparameter of shutil.make_archive the parent 
directory of the pippackage path (root_dir=Path(pip.__path__[0]).parent), and 
then the base_dir parameter the final path component of the pip package 
path(base_dir=Path(pip.__path__[0]).name) , so it is os.path.join(root_dir, 
base_dir) that specified the directory to archive , so weird !!!
I suggest to change shutil.make_archive(base_name, format[, root_dir[, 
base_dir]]) to shutil.make_archive(base_name, format[, archived_dir[, 
archive_prfix]]) where archived_dirdenotes the path to be archived and 
archive_prfix denotes the common prefix of all files and directories in the 
archive (it is just a path component and we shouldn’t assume the existence of 
it on the file system).

If the current behavior of shutil.make_archive won’t be changed , I’d suggest 
improve its doc, because  so many people couldn’t grasp the use of 
shutil.make_archive even consulting the doc , these are the proofs:
https://stackoverflow.com/questions/45245079/python-how-to-use-shutil-make-archive
https://stackoverflow.com/questions/30049201/how-to-compress-a-file-with-shutil-make-archive-in-python

--
messages: 323829
nosy: redstone-cold
priority: normal
severity: normal
status: open
title: improve  shutil.make_archive

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



[issue34450] improve shutil.make_archive

2018-08-22 Thread iMath


iMath  added the comment:

one workaround is :
if os.path.join(root_dir, base_dir) exists, use the current implementation , 
this is set for backwards-compatibility, if not exist, please consider the 
feature in my last post(maybe we should recommend Python  users to follow this 
approach in the doc).

--

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



[issue27820] Possible bug in smtplib when initial_response_ok=False

2018-09-12 Thread iMath


iMath  added the comment:

I encountered the same issue ,  Dario D'Amico's changing works ! please fix the 
problem !

--
nosy: +redstone-cold

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