[issue28488] shutil.make_archive (xxx, zip, root_dir) is adding './' entry to archive which is wrong

2016-10-20 Thread Alexander Belchenko

New submission from Alexander Belchenko:

Running shutil.make_archive('a', 'zip', 'subdir') is created wrong and not 
really needed entry "./" which is visible in zipfile.ZipFile.namelist():

['./', 'foo/', 'hello.txt', 'foo/bar.txt']

This "./" affects some (windows) unzip tools which produces warnings/errors 
about this incorrect entry.

This error present in Python 2.7.11-12 and Python 3.4.4 (those I have installed 
right now). But Python 3.3.5 does not have it, maybe because it omits entries 
for directories at all.

I've attached a simple script which illustrates problem. Tested on Windows with 
mentioned python versions.

Can't reproduce on Centos 7.2 with Python 3.4.3 and 2.7.5.

I suppose it could be realted to the change I spot in latest 2.7 changelog:

- Issue #24982: shutil.make_archive() with the "zip" format now adds entries
  for directories (including empty directories) in ZIP file.

--
components: Library (Lib)
files: make-archive-test.py
messages: 279031
nosy: bialix
priority: normal
severity: normal
status: open
title: shutil.make_archive (xxx, zip, root_dir) is adding './' entry to archive 
which is wrong
versions: Python 2.7, Python 3.4
Added file: http://bugs.python.org/file45151/make-archive-test.py

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



[issue25121] python logger RotatingFileHandler can't wrap log file and blows with traceback

2015-09-15 Thread Alexander Belchenko

Alexander Belchenko added the comment:

Based on my last assumption I'm able to reproduce this issue with simple test 
attached. If I comment out the line

  setup_logger(loggerB)

The everything works OK.

Once this line in - it's traceback.

I guess it's fair to say the bug in my code and one never should use this 
approach. On Linux it never traceback but I think it may have other unvisible 
issues.

I expect you mark this as "won't fix" but maybe you want to look at it.

--
Added file: http://bugs.python.org/file40474/test-issue25121.py

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



[issue25121] python logger RotatingFileHandler can't wrap log file and blows with traceback

2015-09-15 Thread Alexander Belchenko

Alexander Belchenko added the comment:

According to documentation on RotateFileHandler

"When this file is filled, it is closed and renamed to app.log.1, and if files 
app.log.1, app.log.2, etc. exist, then they are renamed to app.log.2, app.log.3 
etc. respectively."

But we have 2 loggers which holds open file inside the same process. And while 
one handler is trying to close and rename file, another handler (tornado, which 
writes something to log only when there are errors actually) is holding file 
open.

--

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



[issue25121] python logger RotatingFileHandler can't wrap log file and blows with traceback

2015-09-15 Thread Alexander Belchenko

Alexander Belchenko added the comment:

Update to previous comment. I use the same settings for tornado logger (e.g. 
filename).

logger = logging.getLogger('tornado')
setup_logger(logger, log_config)

So I have 2 loggers in one application which are trying to write to the same 
file. I guess it's out of supported use cases?

--

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



[issue25121] python logger RotatingFileHandler can't wrap log file and blows with traceback

2015-09-15 Thread Alexander Belchenko

Alexander Belchenko added the comment:

I have suspicion about this issue.

In my application tornado framework is used. I setup logger for my own code, 
but use the same logger for tornado, so all messages from tornado itself go 
into the same log file.

As I said earlier it's strange but one log file works as expected. This log 
file is not used by tornado.

--

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



[issue25121] python logger RotatingFileHandler can't wrap log file and blows with traceback

2015-09-15 Thread Alexander Belchenko

Changes by Alexander Belchenko :


--
title: python logger can't wrap log file and blows with traceback -> python 
logger RotatingFileHandler can't wrap log file and blows with traceback

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



[issue25121] python logger can't wrap log file and blows with traceback

2015-09-15 Thread Alexander Belchenko

Alexander Belchenko added the comment:

Yes. it's rotating file handler.

I'll try to recreate this issue with simpler test application, so I can provide 
something as example.

--

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



[issue25121] python logger can't wrap log file and blows with traceback

2015-09-15 Thread Alexander Belchenko

Alexander Belchenko added the comment:

PermissionError mentions file name 
"C:\\Users\\Andrew\\Desktop\\server\\logs\\2015-0
9-09_10-44-03\\2015-09-09_10-44-04-middleman-684.log.1" - but this file does 
not exist in log directory. There is only 
"C:\\Users\\Andrew\\Desktop\\server\\logs\\2015-0
9-09_10-44-03\\2015-09-09_10-44-04-middleman-684.log" so I think it's about 
unable to rename.

Python 3.3.5 64 bits
Windows 7 64 bits.

--

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



[issue25121] python logger can't wrap log file and blows with traceback

2015-09-15 Thread Alexander Belchenko

New submission from Alexander Belchenko:

We're using standard logging library for logs. On machine of my colleague there 
is constantly traceback like this:

[11:21:29]  PermissionError: [WinError 32] The process cannot access 
the file because it is
being used by another process: 'C:\\Users\\Andrew\\Desktop\\server\\logs\\2015-0
9-09_10-44-03\\2015-09-09_10-44-04-middleman-684.log.1'
Logged from file middleman.py, line 379
Traceback (most recent call last):
  File "c:\python33\lib\logging\handlers.py", line 73, in emit
self.doRollover()
  File "c:\python33\lib\logging\handlers.py", line 176, in doRollover
self.rotate(self.baseFilename, dfn)
  File "c:\python33\lib\logging\handlers.py", line 116, in rotate
os.rename(source, dest)

middleman.py, line 379 is simple call to logger.debug:

self.logger.debug('node %s is already processing, packet %s postponed', 
node_id, packet_no) 

It's strange that another log file with different basename in the same logs 
directory is wrapping without problems.

Anyway, my complain is about traceback. I don't think it's good behavior that 
my application crashes because logging library can't wrap file. The problem for 
me - I have no idea how to catch and ignore such problem, because it's in the 
logging internals.

--
components: Library (Lib), Windows
messages: 250747
nosy: bialix, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: python logger can't wrap log file and blows with traceback
type: crash
versions: Python 3.3

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



[issue16164] there is no easy way to force unittest.main to use stdout rather than stderr

2012-10-08 Thread Alexander Belchenko

New submission from Alexander Belchenko:

Why by default unittest.main (which uses unittest.TextTestRunner) prints 
everything to stderr. What the reason behind this behavior?
It makes very inconvenient to run big test suite with less, i.e.

python test.py | less 

or

python test.py > test.log

does not show me failed tests. They all go to stderr. Why?

Another thing: there is no easy way to override this. I have to subclass either 
TestProgram or TextTestRunner and force sys.stdout rather than sys.stderr. E.g.

class TestProgram(unittest.TestProgram):

def runTests(self):
if self.testRunner is None:
self.testRunner = unittest.TextTestRunner(stream=sys.stdout, 
verbosity=self.verbosity)
result = self.testRunner.run(self.test)
sys.exit(not result.wasSuccessful())

if __name__ == '__main__':
TestProgram()

Although it works for me I feel there is something wrong. Am I the only person 
who needs test output on stdout?

--
components: Library (Lib)
messages: 172375
nosy: bialix
priority: normal
severity: normal
status: open
title: there is no easy way to force unittest.main to use stdout rather than 
stderr
type: behavior
versions: Python 2.6

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



[issue12694] crlf.py script from Tools doesn't work with Python 3.2

2011-08-05 Thread Alexander Belchenko

New submission from Alexander Belchenko :

Attempt to use crlf.py script from standard windows install always fail with 
traceback:

C:\Python32\Tools\Scripts>C:\Python32\python.exe crlf.py 2to3.py
Traceback (most recent call last):
  File "crlf.py", line 23, in 
main()
  File "crlf.py", line 12, in main
if '\0' in data:
TypeError: Type str doesn't support the buffer API

C:\Python32\Tools\Scripts>C:\Python32\python.exe -V
Python 3.2

--
messages: 141650
nosy: bialix
priority: normal
severity: normal
status: open
title: crlf.py script from Tools doesn't work with Python 3.2
versions: Python 3.2

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



[issue11594] 2to3 does not preserve line endings

2011-03-21 Thread Alexander Belchenko

Alexander Belchenko  added the comment:

Éric, thank you for the proposal, but I'm not familiar enough with the codebase 
to work on it. 

The short scan over the tests reveals that there is at least one test which 
tries to test CRLF behavior, in the file test_refactor.py, but I don't 
understand what it doing?

def test_crlf_newlines(self):
old_sep = os.linesep
os.linesep = "\r\n"
try:
fn = os.path.join(TEST_DATA_DIR, "crlf.py")
fixes = refactor.get_fixers_from_package("lib2to3.fixes")
self.check_file_refactoring(fn, fixes)
finally:
os.linesep = old_sep

So, in theory I can modify that test to check what if the file has LF-only 
line-endings originally, but os.linesep is CRLF, but then I don't know what the 
content I should create and how to run fixer over that.

--

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



[issue11594] 2to3 tool does not preserve line-endings

2011-03-21 Thread Alexander Belchenko

Alexander Belchenko  added the comment:

@Éric Araujo: I've ran tests with python 3.2. All tests have passed:

--
Ran 540 tests in 37.688s

OK

--

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



[issue11594] 2to3 tool does not preserve line-endings

2011-03-18 Thread Alexander Belchenko

New submission from Alexander Belchenko :

I'm using LF-only line-endings for development of my IntelHex library. I'm 
working on Windows most of the time.

After 2to3 tool has been ran on my library it has not only changed the Python 
syntax, but it also saved all files with CRLF line-endings. As result I have 
all changed files completelly modified and diff shows change in every line. 

2to3 tool should respect my line-endings and must not use simple open(xxx, 
"wt") mode for writing modified files.

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 131335
nosy: bialix
priority: normal
severity: normal
status: open
title: 2to3 tool does not preserve line-endings
type: behavior
versions: Python 2.7, Python 3.2

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



[issue1616979] cp720 encoding map

2009-11-16 Thread Alexander Belchenko

Alexander Belchenko  added the comment:

OK, thanks.

--

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



[issue1616979] cp720 encoding map

2009-11-16 Thread Alexander Belchenko

Alexander Belchenko  added the comment:

As the author of original patch I want to note that it seems your merged
patch does not update the documentation (list of standard encodings).

Please, update the docs as well.

--

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



[issue1526] DeprecationWarning in zipfile.py while zipping 113000 files

2007-11-30 Thread Alexander Belchenko

Changes by Alexander Belchenko:


--
nosy: bialix
severity: normal
status: open
title: DeprecationWarning in zipfile.py while zipping 113000 files
type: behavior
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1526>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1526] DeprecationWarning in zipfile.py while zipping 113000 files

2007-11-30 Thread Alexander Belchenko

New submission from Alexander Belchenko:

C:\Python\2.5.1\lib\zipfile.py:719: DeprecationWarning: 'H' format
requires 0 <= number <= 65535
  0, 0, count, count, pos2 - pos1, pos1, 0)

--
components: +Library (Lib)

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1526>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com