当前位置:网站首页>[Q&A]AttributeError: module ‘signal‘ has no attribute ‘SIGALRM‘
[Q&A]AttributeError: module ‘signal‘ has no attribute ‘SIGALRM‘
2022-07-07 10:28:00 【镰刀韭菜】
问题描述:
当使用spellpy对日志文件进行解析时,出现如下错误:
执行的代码为:
for log_name in ['openstack_abnormal.log', 'openstack_normal2.log', 'openstack_normal1.log']:
parser.parse(log_name)
错误信息为:
Traceback (most recent call last):
File "preprocess.py", line 62, in <module>
parser.parse(log_name)
File "D:\Anaconda\lib\site-packages\spellpy\spell.py", line 188, in parse
self.load_data()
File "D:\Anaconda\lib\site-packages\spellpy\spell.py", line 300, in load_data
self.df_log = self.log_to_dataframe(os.path.join(self.path, self.logname), regex, headers, self.logformat)
File "D:\Anaconda\lib\site-packages\spellpy\spell.py", line 316, in log_to_dataframe
signal.signal(signal.SIGALRM, self._log_to_dataframe_handler)
AttributeError: module 'signal' has no attribute 'SIGALRM'
问题分析
spell调用了signal模块,该模块可以在linux下正常使用,但在windows下却有一些限制:
“On Windows, signal() can only be called with SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, or SIGTERM. A ValueError will be raised in any other case.”
在Windows环境下只有这个几个信号类型允许被使用:
- SIGABRT
- SIGFPE
- SIGILL
- SIGINT
- SIGSEGV
- SIGTERM
边栏推荐
- Solutions to cross domain problems
- Problem: the string and characters are typed successively, and the results conflict
- 解决 Server returns invalid timezone. Go to ‘Advanced’ tab and set ‘serverTimezone’ property manually
- 110.网络安全渗透测试—[权限提升篇8]—[Windows SqlServer xp_cmdshell存储过程提权]
- 百度数字人度晓晓在线回应网友喊话 应战上海高考英语作文
- 数据库系统原理与应用教程(011)—— 关系数据库
- <No. 9> 1805. Number of different integers in the string (simple)
- DOM parsing XML error: content is not allowed in Prolog
- (待会删)yyds,付费搞来的学术资源,请低调使用!
- Baidu digital person Du Xiaoxiao responded to netizens' shouts online to meet the Shanghai college entrance examination English composition
猜你喜欢
zero-shot, one-shot和few-shot
"Series after reading" my God! It's so simple to understand throttling and anti shake~
College entrance examination composition, high-frequency mention of science and Technology
SQL Lab (41~45) (continuous update later)
Sign up now | oar hacker marathon phase III midsummer debut, waiting for you to challenge
Visual studio 2019 (localdb) \mssqllocaldb SQL Server 2014 database version is 852 and cannot be opened. This server supports version 782 and earlier
小红书微服务框架及治理等云原生业务架构演进案例
数据库系统原理与应用教程(010)—— 概念模型与数据模型练习题
Routing strategy of multi-point republication [Huawei]
Idea 2021 Chinese garbled code
随机推荐
Attack and defense world ----- summary of web knowledge points
SQL lab 11~20 summary (subsequent continuous update) contains the solution that Firefox can't catch local packages after 18 levels
EPP+DIS学习之路(2)——Blink!闪烁!
(to be deleted later) yyds, paid academic resources, please keep a low profile!
Routing strategy of multi-point republication [Huawei]
Static comprehensive experiment
Unity map auto match material tool map auto add to shader tool shader match map tool map made by substance painter auto match shader tool
MATLAB實現Huffman編碼譯碼含GUI界面
College entrance examination composition, high-frequency mention of science and Technology
Tutorial on the principle and application of database system (008) -- exercises on database related concepts
When OSPF specifies that the connection type is P2P, it enables devices on both ends that are not in the same subnet to Ping each other
ps链接图层的使用方法和快捷键,ps图层链接怎么做的
RHSA first day operation
数据库系统原理与应用教程(008)—— 数据库相关概念练习题
SQL Lab (41~45) (continuous update later)
Niuke website
ES底层原理之倒排索引
Unity 贴图自动匹配材质工具 贴图自动添加到材质球工具 材质球匹配贴图工具 Substance Painter制作的贴图自动匹配材质球工具
平安证券手机行开户安全吗?
NPC Jincang was invited to participate in the "aerospace 706" I have an appointment with aerospace computer "national Partner Conference